commit e8bb3d30958edea92f3fb4f973057ad33f3e91c2
parent 02ab4982167983981a616a95601883ed634e6e57
Author: Ian Kilpatrick <ikilpatrick@chromium.org>
Date: Fri, 10 Oct 2025 07:48:44 +0000
Bug 1992739 [wpt PR 55245] - [anchor] Update position-area-scrolling-{001,003} tests., a=testonly
Automatic update from web-platform-tests
[anchor] Update position-area-scrolling-{001,003} tests.
These tests were written before the "scrollable containing block" was
present in the spec. Update them such they assert the new sizes.
As the sizes are expected to remain static now, simplify them as well
just testing a few core cases.
Bug: 438515315
Change-Id: I3f2ffc77def484a08e08081982ef92405e02646f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7007247
Auto-Submit: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: David Grogan <dgrogan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1525074}
--
wpt-commits: 5a6a0789b280dde6c797abcda577da374de9f651
wpt-pr: 55245
Diffstat:
2 files changed, 16 insertions(+), 98 deletions(-)
diff --git a/testing/web-platform/tests/css/css-anchor-position/position-area-scrolling-001.tentative.html b/testing/web-platform/tests/css/css-anchor-position/position-area-scrolling-001.tentative.html
@@ -44,32 +44,20 @@
assert_equals(elm.offsetHeight, height, (elm.id + " height"));
}
- function assert_at_initial() {
+ function assert_sizes() {
assert_rects_equal(e1, 100, 100, 100, 100);
assert_rects_equal(e2, 225, 100, 50, 100);
- assert_rects_equal(e3, 300, 100, 100, 100);
+ assert_rects_equal(e3, 300, 100, 350, 100);
assert_rects_equal(e4, 100, 225, 100, 50);
assert_rects_equal(e5, 225, 225, 50, 50);
- assert_rects_equal(e6, 300, 225, 100, 50);
- assert_rects_equal(e7, 100, 300, 100, 100);
- assert_rects_equal(e8, 225, 300, 50, 100);
- assert_rects_equal(e9, 300, 300, 100, 100);
- }
-
- function assert_at_40_60() {
- assert_rects_equal(e1, 120, 130, 80, 70);
- assert_rects_equal(e2, 225, 130, 50, 70);
- assert_rects_equal(e3, 300, 130, 120, 70);
- assert_rects_equal(e4, 120, 225, 80, 50);
- assert_rects_equal(e5, 225, 225, 50, 50);
- assert_rects_equal(e6, 300, 225, 120, 50);
- assert_rects_equal(e7, 120, 300, 80, 130);
- assert_rects_equal(e8, 225, 300, 50, 130);
- assert_rects_equal(e9, 300, 300, 120, 130);
+ assert_rects_equal(e6, 300, 225, 350, 50);
+ assert_rects_equal(e7, 100, 300, 100, 350);
+ assert_rects_equal(e8, 225, 300, 50, 350);
+ assert_rects_equal(e9, 300, 300, 350, 350);
}
promise_test(async() => {
- assert_at_initial();
+ assert_sizes();
}, "Initial scroll position");
promise_test(async() => {
@@ -78,45 +66,16 @@
scrollable.scrollTo(40, 60);
await waitUntilNextAnimationFrame();
await waitUntilNextAnimationFrame();
- assert_at_initial();
+ assert_sizes();
}, "Scroll to 40,60");
promise_test(async() => {
- // As long as we're within the same animation frame (and therefore haven't
- // run ResizeObserver events), there will be no anchor recalculation point.
- container.style.display = "flow-root";
- assert_at_initial();
- container.style.display = "none";
- document.body.offsetTop;
- container.style.display = "block";
- assert_at_initial();
- }, "Reattach at 40,60");
-
- promise_test(async() => {
container.style.display = "none";
await waitUntilNextAnimationFrame();
await waitUntilNextAnimationFrame();
container.style.display = "block";
await waitUntilNextAnimationFrame();
await waitUntilNextAnimationFrame();
- assert_at_40_60();
+ assert_sizes();
}, "Redisplay at 40,60");
-
- promise_test(async() => {
- scrollable.scrollTo(0, 0);
- container.className = "thicker";
- container.style.display = "block";
- await waitUntilNextAnimationFrame();
- await waitUntilNextAnimationFrame();
- assert_at_40_60();
- }, "Scroll to 0,0 and relayout");
-
- promise_test(async() => {
- container.style.display = "none";
- await waitUntilNextAnimationFrame();
- container.style.display = "block";
- await waitUntilNextAnimationFrame();
- await waitUntilNextAnimationFrame();
- assert_at_initial();
- }, "Redisplay at 0,0");
</script>
diff --git a/testing/web-platform/tests/css/css-anchor-position/position-area-scrolling-003.tentative.html b/testing/web-platform/tests/css/css-anchor-position/position-area-scrolling-003.tentative.html
@@ -62,32 +62,20 @@
assert_equals(elm.offsetHeight, height, (elm.id + " height"));
}
- function assert_at_initial() {
+ function assert_sizes() {
assert_rects_equal(e1, 100, 100, 100, 100);
assert_rects_equal(e2, 225, 100, 50, 100);
assert_rects_equal(e3, 300, 100, 100, 100);
assert_rects_equal(e4, 100, 225, 100, 50);
assert_rects_equal(e5, 225, 225, 50, 50);
assert_rects_equal(e6, 300, 225, 100, 50);
- assert_rects_equal(e7, 100, 300, 100, 100);
- assert_rects_equal(e8, 225, 300, 50, 100);
- assert_rects_equal(e9, 300, 300, 100, 100);
- }
-
- function assert_at_40_60() {
- assert_rects_equal(e1, 120, 130, 80, 70);
- assert_rects_equal(e2, 225, 130, 50, 70);
- assert_rects_equal(e3, 300, 130, 120, 70);
- assert_rects_equal(e4, 120, 225, 80, 50);
- assert_rects_equal(e5, 225, 225, 50, 50);
- assert_rects_equal(e6, 300, 225, 120, 50);
- assert_rects_equal(e7, 120, 300, 80, 130);
- assert_rects_equal(e8, 225, 300, 50, 130);
- assert_rects_equal(e9, 300, 300, 120, 130);
+ assert_rects_equal(e7, 100, 300, 100, 350);
+ assert_rects_equal(e8, 225, 300, 50, 350);
+ assert_rects_equal(e9, 300, 300, 100, 350);
}
promise_test(async() => {
- assert_at_initial();
+ assert_sizes();
}, "Initial scroll position");
promise_test(async() => {
@@ -96,46 +84,17 @@
iframe.contentWindow.scrollTo(40, 60);
await waitUntilNextAnimationFrame();
await waitUntilNextAnimationFrame();
- assert_at_initial();
+ assert_sizes();
}, "Scroll to 40,60");
promise_test(async() => {
- // As long as we're within the same animation frame (and therefore haven't
- // run ResizeObserver events), there will be no anchor recalculation point.
- container.style.display = "flow-root";
- assert_at_initial();
- container.style.display = "none";
- document.body.offsetTop;
- container.style.display = "block";
- assert_at_initial();
- }, "Reattach at 40,60");
-
- promise_test(async() => {
container.style.display = "none";
await waitUntilNextAnimationFrame();
await waitUntilNextAnimationFrame();
container.style.display = "block";
await waitUntilNextAnimationFrame();
await waitUntilNextAnimationFrame();
- assert_at_40_60();
+ assert_sizes();
}, "Redisplay at 40,60");
-
- promise_test(async() => {
- iframe.contentWindow.scrollTo(0, 0);
- container.className = "thicker";
- container.style.display = "block";
- await waitUntilNextAnimationFrame();
- await waitUntilNextAnimationFrame();
- assert_at_40_60();
- }, "Scroll to 0,0 and relayout");
-
- promise_test(async() => {
- container.style.display = "none";
- await waitUntilNextAnimationFrame();
- container.style.display = "block";
- await waitUntilNextAnimationFrame();
- await waitUntilNextAnimationFrame();
- assert_at_initial();
- }, "Redisplay at 0,0");
}
</script>