Skip to content

Commit 8f748e5

Browse files
committed
[css-anchor-position-1] Re-import css/css-anchor-position WPT
https://bugs.webkit.org/show_bug.cgi?id=281290 Reviewed by Tim Nguyen. This change re-imports css/css-anchor-position WPT test cases. Upstream commit: web-platform-tests/wpt@671df7f * LayoutTests/TestExpectations: * LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-invalid-fallback-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-invalid-fallback.html: * LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-parse-invalid-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-parse-invalid.html: * LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-size-001-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-size-001.html: * LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/popover-implicit-anchor.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/popover-implicit-anchor.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-anchor-004-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-anchor-004.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-anchor-target-with-children-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-anchor-target-with-children-ref.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-anchor-target-with-children.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/w3c-import.log: * LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-anchor-position/popover-implicit-anchor.tentative-expected.txt: Added. Canonical link: https://commits.webkit.org/285249@main
1 parent 4cdc373 commit 8f748e5

16 files changed

+1207
-7
lines changed

LayoutTests/TestExpectations

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8149,6 +8149,10 @@ imported/w3c/web-platform-tests/css/css-anchor-position/position-visibility-remo
81498149
# timeouts
81508150
imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-js-expose.html [ Skip ]
81518151

8152+
# crashes
8153+
imported/w3c/web-platform-tests/css/css-anchor-position/position-anchor-004.html [ Skip ]
8154+
imported/w3c/web-platform-tests/css/css-anchor-position/position-anchor-target-with-children.html [ Skip ]
8155+
81528156
# -- End: Anchor Positioning -- #
81538157

81548158
fast/canvas/image-buffer-resource-limits.html [ Slow ]

LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-invalid-fallback-expected.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ PASS Invalid anchor function, --unknown left
1616
FAIL Invalid anchor function, --unknown width assert_equals: right expected "188.4375px" but got "200px"
1717
PASS Invalid anchor function, cross-axis query (vertical)
1818
PASS Invalid anchor function, cross-axis query (horizontal)
19-
PASS Invalid anchor function, anchor-size() in inset
2019
PASS Invalid anchor function, anchor() in sizing property
2120
PASS Invalid anchor function, nested left
2221
PASS Invalid anchor function, nested right

LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-invalid-fallback.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@
139139
test_ref('top:anchor(--a left)', ' cross-axis query (horizontal)');
140140

141141
// Wrong query for the given property:
142-
test_ref('top:anchor-size(--a width)', 'anchor-size() in inset');
143142
test_ref('width:anchor(--a left)', 'anchor() in sizing property');
144143

145144
// Invalid anchor*() deeper within calc():

LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-parse-invalid-expected.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ PASS e.style['top'] = "anchor(--foo top, 1)" should not set the property value
1818
PASS e.style['top'] = "anchor(--foo top, 100s)" should not set the property value
1919
PASS e.style['top'] = "anchor(--foo top, bottom)" should not set the property value
2020
PASS e.style['top'] = "anchor(--foo top, anchor(bar top))" should not set the property value
21-
FAIL e.style['top'] = "anchor(--foo top, anchor-size(--bar height))" should not set the property value assert_equals: expected "" but got "anchor(--foo top, anchor-size(--bar height))"
21+
PASS e.style['top'] = "anchor(--foo top, anchor-size(bar height))" should not set the property value
2222
PASS e.style['top'] = "anchor(--foo top, auto" should not set the property value
2323
PASS e.style['top'] = "calc(anchor(foo top) + 10px + 10%)" should not set the property value
2424
PASS e.style['top'] = "calc(10px + 100 * anchor(--foo top, anchor(bar bottom)))" should not set the property value
25-
FAIL e.style['top'] = "min(anchor(--foo top), anchor(--bar bottom), anchor-size(--baz height))" should not set the property value assert_equals: expected "" but got "min(anchor(--foo top), anchor(--bar bottom), anchor-size(--baz height))"
25+
PASS e.style['top'] = "min(anchor(--foo top), anchor(--bar bottom), anchor-size(baz height))" should not set the property value
2626

LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-parse-invalid.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535
test_invalid_value('top', 'anchor(--foo top, 100s)');
3636
test_invalid_value('top', 'anchor(--foo top, bottom)');
3737
test_invalid_value('top', 'anchor(--foo top, anchor(bar top))');
38-
test_invalid_value('top', 'anchor(--foo top, anchor-size(--bar height))');
38+
test_invalid_value('top', 'anchor(--foo top, anchor-size(bar height))');
3939
test_invalid_value('top', 'anchor(--foo top, auto');
4040

4141
// Invalid anchor values in calc tree
4242
test_invalid_value('top', 'calc(anchor(foo top) + 10px + 10%)');
4343
test_invalid_value('top', 'calc(10px + 100 * anchor(--foo top, anchor(bar bottom)))');
44-
test_invalid_value('top', 'min(anchor(--foo top), anchor(--bar bottom), anchor-size(--baz height))');
44+
test_invalid_value('top', 'min(anchor(--foo top), anchor(--bar bottom), anchor-size(baz height))');
4545
</script>

LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-size-001-expected.txt

Lines changed: 855 additions & 1 deletion
Large diffs are not rendered by default.

LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-size-001.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,26 @@
4040
<div class="target" style="height: anchor-size(--a1 self-inline)" data-expected-height=5></div>
4141
<div class="target" style="width: anchor-size(--a1 self-block)" data-expected-width=7></div>
4242

43+
<!-- anchor-size() in insets -->
44+
<div class="target" style="left: anchor-size(--a1 width)" data-offset-x=5></div>
45+
<div class="target" style="top: anchor-size(--a1 height)" data-offset-y=7></div>
46+
<div class="target" style="left: anchor-size(--a1 height)" data-offset-x=7></div>
47+
<div class="target" style="top: anchor-size(--a1 width" data-offset-y=5></div>
48+
49+
<!-- anchor-size() in margins -->
50+
<div class="target" style="margin-left: anchor-size(--a1 width)" data-expected-margin-left=5></div>
51+
<div class="target" style="margin-top: anchor-size(--a1 height)" data-expected-margin-top=7></div>
52+
<div class="target" style="margin-right: anchor-size(--a1 height)" data-expected-margin-right=7></div>
53+
<div class="target" style="margin-bottom: anchor-size(--a1 width" data-expected-margin-bottom=5></div>
54+
4355
<!-- Implicit <anchor-size> -->
4456
<div class="target" style="width: anchor-size(--a1)" data-expected-width=5></div>
4557
<div class="target" style="height: anchor-size(--a1)" data-expected-height=7></div>
58+
<div class="target" style="left: anchor-size(--a1)" data-offset-x=5></div>
59+
<div class="target" style="top: anchor-size(--a1)" data-offset-y=7></div>
60+
<div class="target" style="margin-left: anchor-size(--a1)" data-expected-margin-left=5></div>
61+
<div class="target" style="margin-right: anchor-size(--a1)" data-expected-margin-right=5></div>
62+
<div class="target" style="margin-top: anchor-size(--a1)" data-expected-margin-top=7></div>
63+
<div class="target" style="margin-bottom: anchor-size(--a1)" data-expected-margin-bottom=7></div>
4664
</div>
4765
</body>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Button Popover
2+
3+
FAIL Popover invokers form an implicit anchor reference assert_equals: expected 100 but got 55
4+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!DOCTYPE html>
2+
<title>Popover invokers form an implicit anchor reference</title>
3+
<link rel="author" href="mailto:[email protected]">
4+
<link rel="help" href="https://www.w3.org/TR/css-anchor-position-1/#implicit">
5+
<script src="/resources/testharness.js"></script>
6+
<script src="/resources/testharnessreport.js"></script>
7+
<script src="/resources/testdriver.js"></script>
8+
<script src="/resources/testdriver-actions.js"></script>
9+
<script src="/resources/testdriver-vendor.js"></script>
10+
<script src="/html/semantics/popovers/resources/popover-utils.js"></script>
11+
12+
<button id=button popovertarget=popover>Button</button>
13+
<div popover id=popover>Popover</div>
14+
15+
<style>
16+
#button {
17+
position:relative;
18+
top:100px;
19+
left:100px;
20+
}
21+
#popover {
22+
border:1px solid black;
23+
inset: auto;
24+
margin:0;
25+
padding:0;
26+
position-area: top left;
27+
}
28+
body { margin: 0; }
29+
</style>
30+
31+
<script>
32+
promise_test(async (t) => {
33+
assert_false(popover.matches(':popover-open'));
34+
await clickOn(button);
35+
assert_true(popover.matches(':popover-open'));
36+
// Popover should be anchored to the button.
37+
assert_equals(popover.offsetLeft + popover.offsetWidth, 100);
38+
assert_equals(popover.offsetTop + popover.offsetHeight, 100);
39+
}, 'Popover invokers form an implicit anchor reference');
40+
</script>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!DOCTYPE html>
2+
<style>
3+
.anchor {
4+
width: 100px;
5+
height: 100px;
6+
background: orange;
7+
}
8+
9+
.target {
10+
position: fixed;
11+
background: lime;
12+
width: 100px;
13+
height: 100px;
14+
}
15+
16+
body {
17+
margin: 0;
18+
}
19+
20+
#anchor1 {
21+
margin-left: 100px;
22+
}
23+
24+
#target1 {
25+
left: 100px;
26+
top: 100px;
27+
}
28+
29+
#anchor2 {
30+
margin-left: 300px;
31+
margin-top: 100px;
32+
}
33+
34+
#target2 {
35+
left: 300px;
36+
top: 300px;
37+
}
38+
</style>
39+
40+
<div id="anchor1" class="anchor">anchor1</div>
41+
<div id="anchor2" class="anchor">anchor2</div>
42+
43+
<div id="target1" class="target">target1</div>
44+
<div id="target2" class="target">target2</div>

0 commit comments

Comments
 (0)