Skip to content

Commit 89f0524

Browse files
bfgeekchromium-wpt-export-bot
authored andcommitted
[anchor] Fix under-invalidation of position-try-fallbacks.
*** Duplicate of: https://chromium-review.googlesource.com/c/chromium/src/+/7819103 (as other patch wouldn't trigger CQ). When we use a different fallback style, we recalc the style, then set it on the element, but with ApplyStyleChanges::kNo set. This results in no invalidation from the style changing. If we have two fallback options which both invoke layout (within ComputeOofBlockDimensions) with different constraints, they may end up hitting each other's layout cache resulting in incorrect layout. For the moment fix this by manually invalidating layout when the style changes on the layout object. The downside of this approach is that if we revisit the same OOF multiple times, we need to relayout multiple times. Conceptually we could have a smarter measure cache which also takes a style so that we could do a deep equality check on it. Bug: 486806596 Change-Id: I22dd5c28d784b5886a61eb8ad40aa006de54a6cf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7828781 Reviewed-by: Morten Stenshorne <mstensho@chromium.org> Commit-Queue: Morten Stenshorne <mstensho@chromium.org> Auto-Submit: Ian Kilpatrick <ikilpatrick@chromium.org> Cr-Commit-Position: refs/heads/main@{#1627027}
1 parent a68014e commit 89f0524

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html>
2+
<link rel="help" href="https://crbug.com/486806596">
3+
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html">
4+
<style>
5+
#container {
6+
position: relative;
7+
width: 100px;
8+
height: 100px;
9+
}
10+
#anchor {
11+
position: absolute;
12+
anchor-name: --a;
13+
width: 100px;
14+
height: 10px;
15+
top: 90px;
16+
background: green;
17+
}
18+
#target {
19+
position: absolute;
20+
width: 100px;
21+
min-height: 150px;
22+
bottom: anchor(--a top);
23+
background: green;
24+
position-try-fallbacks: --fallback;
25+
}
26+
@position-try --fallback {
27+
min-height: 90px;
28+
}
29+
</style>
30+
<p>Test passes if there is a filled green square.</p>
31+
<div id="container">
32+
<div id="anchor"></div>
33+
<div id="target"></div>
34+
</div>

0 commit comments

Comments
 (0)