Skip to content

Commit b748e59

Browse files
committed
Fix missing containing block in css/css-anchor-position/anchor-center-fallback-transition-behavior.html
In css/css-anchor-position/anchor-center-fallback-transition-behavior.html, there's no explicit containing block for anchor #a1 and anchor-positioned #t1, therefore the containing block of #a1 is the viewport and the fallback isn't used (because #t1 will be positioned within the containing block). Add an explicit containing block as parent of #a1 and #t1 to force the fallback behavior. Tested on latest Safari Technology Preview. From the crbug [1] that added the test, it is for a bug in Chrome 127 that was fixed in Chrome 132. I tried and the new test fails in Chromium 127.0.6533.0 (Developer Build) (arm64) and passes in Chromium 139.0.7258.0 (Developer Build) (arm64) [1]: https://issues.chromium.org/issues/342428030
1 parent 18742f5 commit b748e59

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

css/css-anchor-position/anchor-center-fallback-transition-behavior.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@
66
<script src="/resources/testharnessreport.js"></script>
77
<style>
88
body { margin: 0; }
9+
#cb {
10+
position: relative;
11+
width: 400px;
12+
height: 100px;
13+
border: 1px solid black;
14+
}
915
#a1 {
1016
anchor-name: --a1;
1117
width: 100px;
1218
height: 100px;
19+
background: green;
1320
}
1421
#t1 {
1522
position-anchor: --a1;
@@ -20,13 +27,16 @@
2027
position-try-fallbacks: --right;
2128
width: 200px;
2229
height: 100px;
30+
background: cyan;
2331
}
2432
@position-try --right {
2533
position-area: right;
2634
}
2735
</style>
28-
<div id="a1"></div>
29-
<div id="t1"></div>
36+
<div id="cb">
37+
<div id="a1"></div>
38+
<div id="t1"></div>
39+
</div>
3040
<script>
3141
test(() => {
3242
assert_equals(t1.offsetLeft, 100, "Positioned using --right fallback");

0 commit comments

Comments
 (0)