Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 5746045

Browse files
bfgeekjgraham
authored andcommitted
Bug 1557365 [wpt PR 16859] - [LayoutNG] Only reset a legacy cached result if OOF-positioned., a=testonly
Automatic update from web-platform-tests [LayoutNG] Only reset a legacy cached result if OOF-positioned. We had an issue with our simplified layout algorithm + relayout boundary roots. For this to trigger we needed a (legacy) layout object to be marked for simplified layout which was also a relayout boundary root. During LocalFrameView::PerformLayout, LayoutBox::UpdateLayout would run on the legacy LayoutBox, and during LayoutBox::UpdateAfterLayout, this would clear the LayoutBox::cached_layout_result_. During another relayout boundary layout, we'd trigger simplified layout for an NG node. This expects that there is always a cached layout result associated with a box. However this now wasn't the case, as the child had previously cleared it, within LayoutBox::UpdateAfterLayout. The guard inside LayoutBox::UpdateAfterLayout was designed to protect against OOF-positioned nodes changing their layout parent, this modifies that check do only clear the layout result of OOF-positioned legacy layout objects. Bug: 963387, 963433, 963620 Change-Id: Ice1202bdb939689e26e24a8690a52e7d7e82ecbc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1614082 Reviewed-by: Aleks Totic <atotic@chromium.org> Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org> Cr-Commit-Position: refs/heads/master@{#660166} -- wp5At-commits: c40cd30b2d4d686325f3b00403c1c3d0314219e3 wpt-pr: 16859
1 parent e6b86e9 commit 5746045

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html class='reftest-wait'>
3+
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html">
4+
<link rel="help" href="https://www.w3.org/TR/css-position-3/" />
5+
<meta name="assert" content="This test checks that a dynamic change in constraints does not crash the renderer."/>
6+
<script src="/common/reftest-wait.js"></script>
7+
<p>Test passes if there is a filled green square.</p>
8+
<div style="display: flex; width: 100px; height: 100px; overflow: hidden; position: relative;"> <!-- relayout boundary -->
9+
<div style="position: relative;">
10+
<div style="display: flex; position: relative; width: 100px; height: 50px; overflow: hidden;"> <!-- relayout boundary -->
11+
<div id="target1" style="position: absolute; width: 10px; height: 50px; background: green;"></div>
12+
</div>
13+
<div id="target2" style="position: absolute; width: 10px; height: 50px; background: green;"></div>
14+
</div>
15+
</div>
16+
<script>
17+
document.body.offsetTop;
18+
target2.style.width = '100px';
19+
target1.style.width = '100px';
20+
document.body.offsetTop;
21+
takeScreenshot();
22+
</script>

0 commit comments

Comments
 (0)