Skip to content

Commit 7001a97

Browse files
committed
Bug 1998892 [wpt PR 55933] - Add flip-x/flip-y tests for anchored(fallback), a=testonly
Automatic update from web-platform-tests Add flip-x/flip-y tests for anchored(fallback) The new keywords were introduced for <try-tactic> in position-try-fallbacks and should be queryable by anchored() queries too. Change-Id: I5a6cb05f9779544bcbfbc11660c46e2a0e287ec5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7129979 Auto-Submit: Rune Lillesveen <futharkchromium.org> Commit-Queue: Rune Lillesveen <futharkchromium.org> Reviewed-by: Anders Hartvoll Ruud <andruudchromium.org> Commit-Queue: Anders Hartvoll Ruud <andruudchromium.org> Cr-Commit-Position: refs/heads/main{#1541662} -- wpt-commits: 26d1c29ed2cdd34123dc1c1fdfe8f4a3dd7380ac wpt-pr: 55933 UltraBlame original commit: 0c01778b476a7079e33d9fb298a7add4c7faa623
1 parent 5108bf1 commit 7001a97

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

testing/web-platform/tests/css/css-anchor-position/container-queries/anchored-fallback-try-tactic.html

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,26 @@
2525
#a2 {
2626
position-try-fallbacks: flip-inline flip-block;
2727
}
28-
#t1, #t2 {
28+
#a3 {
29+
position-try-fallbacks: flip-x flip-y;
30+
}
31+
#t1, #t2, #t3 {
2932
--flip-block: no;
3033
--flip-inline: no;
3134
--flip-inline-block: no;
3235
--flip-block-inline: no;
36+
--flip-x: no;
37+
--flip-y: no;
38+
--flip-x-y: no;
39+
--flip-y-x: no;
3340
@container anchored(fallback: flip-block) { --flip-block: yes; }
3441
@container anchored(fallback: flip-inline) { --flip-inline: yes; }
3542
@container anchored(fallback: flip-inline flip-block) { --flip-inline-block: yes; }
3643
@container anchored(fallback: flip-block flip-inline) { --flip-block-inline: yes; }
44+
@container anchored(fallback: flip-x) { --flip-x: yes; }
45+
@container anchored(fallback: flip-y) { --flip-y: yes; }
46+
@container anchored(fallback: flip-x flip-y) { --flip-x-y: yes; }
47+
@container anchored(fallback: flip-y flip-x) { --flip-y-x: yes; }
3748
}
3849
</style>
3950
<div id="anchor"></div>
@@ -43,13 +54,20 @@
4354
<div id="a2" class="anchored">
4455
<div id="t2"></div>
4556
</div>
57+
<div id="a3" class="anchored">
58+
<div id="t3"></div>
59+
</div>
4660
<script>
4761
test(() => {
4862
const style = getComputedStyle(t1);
4963
assert_equals(style.getPropertyValue("--flip-block"), "yes");
5064
assert_equals(style.getPropertyValue("--flip-inline"), "no");
5165
assert_equals(style.getPropertyValue("--flip-inline-block"), "no");
5266
assert_equals(style.getPropertyValue("--flip-block-inline"), "no");
67+
assert_equals(style.getPropertyValue("--flip-x"), "no");
68+
assert_equals(style.getPropertyValue("--flip-y"), "no");
69+
assert_equals(style.getPropertyValue("--flip-x-y"), "no");
70+
assert_equals(style.getPropertyValue("--flip-y-x"), "no");
5371
}, "@container anchored(fallback) matching flip-block");
5472

5573
test(() => {
@@ -58,5 +76,21 @@
5876
assert_equals(style.getPropertyValue("--flip-inline"), "no");
5977
assert_equals(style.getPropertyValue("--flip-inline-block"), "yes");
6078
assert_equals(style.getPropertyValue("--flip-block-inline"), "no");
79+
assert_equals(style.getPropertyValue("--flip-x"), "no");
80+
assert_equals(style.getPropertyValue("--flip-y"), "no");
81+
assert_equals(style.getPropertyValue("--flip-x-y"), "no");
82+
assert_equals(style.getPropertyValue("--flip-y-x"), "no");
6183
}, "@container anchored(fallback) matching flip-inline flip-block");
84+
85+
test(() => {
86+
const style = getComputedStyle(t3);
87+
assert_equals(style.getPropertyValue("--flip-block"), "no");
88+
assert_equals(style.getPropertyValue("--flip-inline"), "no");
89+
assert_equals(style.getPropertyValue("--flip-inline-block"), "no");
90+
assert_equals(style.getPropertyValue("--flip-block-inline"), "no");
91+
assert_equals(style.getPropertyValue("--flip-x"), "no");
92+
assert_equals(style.getPropertyValue("--flip-y"), "no");
93+
assert_equals(style.getPropertyValue("--flip-x-y"), "yes");
94+
assert_equals(style.getPropertyValue("--flip-y-x"), "no");
95+
}, "@container anchored(fallback) matching flip-x flip-y");
6296
</script>

testing/web-platform/tests/css/css-anchor-position/container-queries/at-container-anchored-parsing.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
test_cq_condition_known('anchored(fallback: none)');
1313
test_cq_condition_known('(anchored(fallback: inline-start block-end))');
1414
test_cq_condition_known('anchored(not ((fallback: --foo) or (fallback: --bar flip-inline)))');
15+
test_cq_condition_known('anchored(fallback: flip-x flip-y flip-start flip-block flip-inline)');
1516

1617
test_cq_condition_unknown('anchored(fallback < none)');
1718
test_cq_condition_unknown('anchored((fallback = none))');

0 commit comments

Comments
 (0)