commit d7fd3fb3a2699dd6570ecd8caa84ec5dfa6e4104
parent 207cd79686b495fe9c1a35e1c123d72bbb7ecea2
Author: Ian Kilpatrick <ikilpatrick@chromium.org>
Date: Fri, 10 Oct 2025 07:48:52 +0000
Bug 1992742 [wpt PR 55247] - [anchor] Update position-area-scrolling-005 test., a=testonly
Automatic update from web-platform-tests
[anchor] Update position-area-scrolling-005 test.
These tests were written before the "scrollable containing block" was
present in the spec.
Split the containing-block, and scroller so that we can test the
fallback behaviour correctly..
Bug: 438515315
Change-Id: Id16c5c1866f28112f0d1e428f49efd0879ba31bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7008166
Auto-Submit: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: David Grogan <dgrogan@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: David Grogan <dgrogan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1525101}
--
wpt-commits: c2cd84820a82d87528117c3bc59e9651223c5e90
wpt-pr: 55247
Diffstat:
1 file changed, 14 insertions(+), 40 deletions(-)
diff --git a/testing/web-platform/tests/css/css-anchor-position/position-area-scrolling-005.html b/testing/web-platform/tests/css/css-anchor-position/position-area-scrolling-005.html
@@ -12,6 +12,7 @@
border: solid;
position-anchor: --anchor;
position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
+ position-visibility: always;
width: 50%;
height: 50%;
background: cyan;
@@ -20,11 +21,13 @@
border-width: thick;
}
</style>
-<div id="scrollable" style="position:relative; overflow:hidden; width:500px; height:500px; background:yellow;">
- <div style="width:2000px; height:2000px;">
- <div id="container">
- <div style="anchor-name:--anchor; margin:200px; width:50px; height:50px; background:gray;"></div>
- <div id="anchored" style="position-area:top left;"></div>
+<div style="position:relative; width:500px; height:500px; background:yellow;">
+ <div id="scrollable" style="overflow: hidden; width: 500px; height: 500px;">
+ <div style="width:2000px; height:2000px;">
+ <div id="container">
+ <div style="anchor-name:--anchor; margin:200px; width:50px; height:50px; background:gray;"></div>
+ <div id="anchored" style="position-area:top left;"></div>
+ </div>
</div>
</div>
</div>
@@ -54,7 +57,7 @@
scrollable.scrollTo(40, 60);
await waitUntilNextAnimationFrame();
await waitUntilNextAnimationFrame();
- assert_rects_equal(anchored, 100, 100, 100, 100);
+ assert_rects_equal(anchored, 60, 40, 100, 100);
}, "Scroll to 40,60");
promise_test(async() => {
@@ -62,7 +65,7 @@
scrollable.scrollTo(100, 150);
await waitUntilNextAnimationFrame();
await waitUntilNextAnimationFrame();
- assert_rects_equal(anchored, 150, 250, 50, 200);
+ assert_rects_equal(anchored, 50, 100, 50, 200);
}, "Scroll to 100,150");
promise_test(async() => {
@@ -82,46 +85,17 @@
promise_test(async() => {
// Switch to top right.
- scrollable.scrollTo(750, 100);
+ scrollable.scrollTo(200, 100);
await waitUntilNextAnimationFrame();
await waitUntilNextAnimationFrame();
- assert_rects_equal(anchored, 250, 150, 500, 50);
+ assert_rects_equal(anchored, 50, 50, 225, 50);
}, "Scroll to 750,100");
promise_test(async() => {
// Switch to bottom right.
- scrollable.scrollTo(750, 196);
+ scrollable.scrollTo(200, 200);
await waitUntilNextAnimationFrame();
await waitUntilNextAnimationFrame();
- assert_rects_equal(anchored, 250, 250, 500, 223);
+ assert_rects_equal(anchored, 50, 50, 225, 225);
}, "Scroll to 750,196");
-
- promise_test(async() => {
- scrollable.scrollTo(195, 196);
- await waitUntilNextAnimationFrame();
- await waitUntilNextAnimationFrame();
- assert_rects_equal(anchored, 250, 250, 500, 223);
- }, "Scroll to 195,196");
-
- promise_test(async() => {
- // Switch to top left.
- scrollable.scrollTo(194, 196);
- await waitUntilNextAnimationFrame();
- await waitUntilNextAnimationFrame();
- assert_rects_equal(anchored, 194, 250, 6, 223);
- }, "Scroll to 194,195");
-
- promise_test(async() => {
- scrollable.scrollTo(194, 194);
- await waitUntilNextAnimationFrame();
- await waitUntilNextAnimationFrame();
- assert_rects_equal(anchored, 194, 250, 6, 223);
- }, "Scroll to 194,194");
-
- promise_test(async() => {
- await redisplay(anchored);
- await waitUntilNextAnimationFrame();
- await waitUntilNextAnimationFrame();
- assert_rects_equal(anchored, 194, 194, 6, 6);
- }, "Redisplay at 194,194");
</script>