Skip to content

Commit f54c89c

Browse files
bfgeekchromium-wpt-export-bot
authored andcommitted
[layout] Fix OOF-positioned margin under-invalidation.
In crrev.com/c/7812714 we simplified the OOF layout code by making the constraint-space construction the same for the two places where we invoke layout on a non-replaced element. This introduced an under-invaldation bug when margins change. Previously when a margin changed, we'd calculate a new fixed-block size, which would cause the cache-miss. Importantly for OOF-positioned we don't mark the layout-object as dirty when a margin changes. With the new code we would potentially just compare the constraint-spaces directly (without computing the block-size), causes the incorrect cache-hit. Skipping the margin layout invalidation likely isn't important for real-world use-cases so just mark a layout object as needing layout for this case. Additionally remove the two bespoke field-diffs: - "margin" just becomes "layout" for OOF. - "out-of-flow" switches to "inset", and now we just check if we have non-static position. Bug: 539404705 Change-Id: If54326af096c8cb30308e7274c515e859760ea9f
1 parent 5a53ac9 commit f54c89c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html">
3+
<link rel="help" href="https://issues.chromium.org/issues/539404705">
4+
<p>Test passes if there is a filled green square.</p>
5+
<div style="position: relative; width: 100px; height: 100px;">
6+
<div id="target" style="position: absolute; inset: 0; background: green; margin-top: 50px;"></div>
7+
</div>
8+
<script>
9+
document.body.offsetTop;
10+
target.style.marginTop = '0px';
11+
</script>

0 commit comments

Comments
 (0)