Commit 6de03dd9 authored by Aleks Totic's avatar Aleks Totic Committed by Commit Bot

[LayoutNG] ComputeMinMax should update ListItem markers

NGBlockNode::PrepareForLayout calls ToLayoutNGListItem(box_)->UpdateMarkerTextIfNeeded
ComputeMinMax also needs to call it to compute correct MixMax sizes.

Bug: 938224
Change-Id: Iebf3183c9e7447857ebc092a29a65cbd90a720bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1504155
Commit-Queue: Aleks Totic <atotic@chromium.org>
Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#637958}
parent 03f2e664
......@@ -304,6 +304,8 @@ void NGBlockNode::PrepareForLayout() {
}
}
// TODO(layoutng) Can UpdateMarkerTextIfNeeded call be moved
// somewhere else? List items need up-to-date markers before layout.
if (IsListItem())
ToLayoutNGListItem(box_)->UpdateMarkerTextIfNeeded();
}
......@@ -346,6 +348,11 @@ MinMaxSize NGBlockNode::ComputeMinMaxSize(
WritingMode container_writing_mode,
const MinMaxSizeInput& input,
const NGConstraintSpace* constraint_space) {
// TODO(layoutng) Can UpdateMarkerTextIfNeeded call be moved
// somewhere else? List items need up-to-date markers before layout.
if (IsListItem())
ToLayoutNGListItem(box_)->UpdateMarkerTextIfNeeded();
bool is_orthogonal_flow_root =
!IsParallelWritingMode(container_writing_mode, Style().GetWritingMode());
......
<!DOCTYPE html>
<title>CSS Position Absolute: Chrome chrash</title>
<link rel="author" href="mailto:atotic@google.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=938224">
<meta name="assert" content="absolute position in LI container does not crash">
<style>
#container {
position: absolute;
top: 0px;
left: 0px;
}
#abs {
position: absolute;
top: 0px;
left: 0px;
}
</style>
<li id="container">
<ul>
<li>
<div id="abs">abs</div>
</li>
</ul>
</li>
<script>
test(() => {
}, 'test passes if it does not crash');
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment