Skip to content

Commit d2f9ead

Browse files
lillesmoz-wptsync-bot
authored andcommitted
Bug 1988833 [wpt PR 54843] - Make some scroll-animation tests not rely on dirty-tree snapshot, a=testonly
Automatic update from web-platform-tests Make some scroll-animation tests not rely on dirty-tree snapshot An HTML PR[1] is attempting to move snapshotting of post-layout state to where the layout tree is actually clean. The plan is for the scroll-animations spec to also be expressed in terms of post-layout state snapshotting. The test changes here makes them valid both when timelines are updated before the rendering update, and when they are only updated post-layout. This CL starts with a few edits to check if this is an acceptable approach. [1] whatwg/html#11613 Bug: 384523570 Change-Id: I29c9d7d22c5abf481117857e9463b37413ef5a92 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6947907 Reviewed-by: Kevin Ellis <[email protected]> Commit-Queue: Rune Lillesveen <[email protected]> Cr-Commit-Position: refs/heads/main@{#1515714} -- wpt-commits: dbc92090de5866a72b5d48f979791979f895b177 wpt-pr: 54843
1 parent 5cc7d85 commit d2f9ead

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

testing/web-platform/tests/scroll-animations/css/animation-range-ignored.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@
6363
const anim = startAnimation(t);
6464
await anim.ready;
6565

66-
scroller.scrollTop = 650;
67-
await waitForNextFrame();
66+
await runAndWaitForFrameUpdate(() => {
67+
scroller.scrollTop = 650;
68+
});
6869

6970
// Timline time = (scroll pos - cover 0%) / (cover 100% - cover 0%) * 100%
7071
// = (650 - 600)/(900 - 600) * 100% = 100/6%

testing/web-platform/tests/scroll-animations/css/animation-range-normal-matches-cover.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@
7070
assert_range_equals(anims[1].rangeEnd,
7171
{ rangeName: 'cover', offset: CSS.percent(100) });
7272

73-
scroller.scrollTop = 600; // Start boundary for cover range.
74-
await waitForNextFrame();
73+
await runAndWaitForFrameUpdate(() => {
74+
scroller.scrollTop = 600; // Start boundary for cover range.
75+
});
7576

7677
assert_percents_equal(anims[0].currentTime, 0,
7778
'currentTime at start of normal range');

testing/web-platform/tests/scroll-animations/css/progress-based-animation-timeline.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@
4848
await waitForNextFrame();
4949
const anim = document.getAnimations()[0];
5050
await anim.ready;
51-
scroller1.scrollTop = 20;
52-
await waitForNextFrame();
51+
await runAndWaitForFrameUpdate(() => {
52+
scroller1.scrollTop = 20;
53+
});
5354
assert_equals(getComputedStyle(element).top, '120px');
5455
}, 'progress based animation timeline works');
5556
};

testing/web-platform/tests/scroll-animations/scroll-timelines/cancel-animation.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@
2525
'use strict';
2626

2727
promise_test(async t => {
28-
const animation = createScrollLinkedAnimation(t);
28+
let animation;
2929
// Wait for new animation frame which allows the timeline to compute new
3030
// current time.
31-
await waitForNextFrame();
31+
await runAndWaitForFrameUpdate(() => {
32+
animation = createScrollLinkedAnimation(t);
33+
});
3234
animation.play();
3335
animation.cancel();
3436

@@ -170,9 +172,9 @@
170172
await animation.ready;
171173

172174
// Make the scroll timeline inactive.
173-
scroller.style.overflow = 'visible';
174-
scroller.scrollTop;
175-
await waitForNextFrame();
175+
await runAndWaitForFrameUpdate(() => {
176+
scroller.style.overflow = 'visible';
177+
});
176178
assert_equals(animation.timeline.currentTime, null,
177179
'Sanity check the timeline is inactive.');
178180
animation.cancel();
@@ -194,9 +196,9 @@
194196
await animation.ready;
195197

196198
// Make the scroll timeline inactive.
197-
scroller.style.overflow = 'visible';
198-
scroller.scrollTop;
199-
await waitForNextFrame();
199+
await runAndWaitForFrameUpdate(() => {
200+
scroller.style.overflow = 'visible';
201+
});
200202
assert_equals(animation.timeline.currentTime, null,
201203
'Sanity check the timeline is inactive.');
202204

0 commit comments

Comments
 (0)