Skip to content

Commit 857ec50

Browse files
DavMilachromium-wpt-export-bot
authored andcommitted
[animation-trigger] Implement replay behavior for compositor triggers
Bug: 451238244, 390314945 Change-Id: I354e2d64be254f4cde413643ae9d301e703a83fb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7860380 Reviewed-by: Robert Flack <flackr@chromium.org> Commit-Queue: David A <awogbemila@chromium.org> Cr-Commit-Position: refs/heads/main@{#1637300}
1 parent 9ecc31b commit 857ec50

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

scroll-animations/animation-trigger/animation-trigger-replay.tentative.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,19 @@
5757
const ACTIVATION_RANGE_START_PX = COVER_START_OFFSET + CSS_TRIGGER_START_PX;
5858
const ACTIVATION_RANGE_END_PX = COVER_START_OFFSET + CSS_TRIGGER_END_PX;
5959

60+
// TODO(crbug.com/451238244): Replace these with common methods in
61+
// support.js.
6062
const enter = () => {
61-
return runAndWaitForFrameUpdate(async () => {
63+
return runAndWaitForFrameUpdate(() => {
6264
scroller.scrollTop =
6365
(ACTIVATION_RANGE_START_PX + ACTIVATION_RANGE_END_PX) / 2;
64-
});
66+
}).then(waitForCompositorCommit);
6567
}
6668

6769
const exit = () => {
68-
return runAndWaitForFrameUpdate(async () => {
70+
return runAndWaitForFrameUpdate(() => {
6971
scroller.scrollTop = ACTIVATION_RANGE_END_PX + 100;
70-
});
72+
}).then(waitForCompositorCommit);
7173
}
7274

7375
const reset = () => {
@@ -84,7 +86,6 @@
8486
// Entering the activation range should result in playing.
8587
await enter();
8688
assert_equals(animation.playState, "running");
87-
8889
animation.pause();
8990
animation.currentTime = CSS_ANIMATION_DURATION / 2;
9091
assert_times_equal(animation.currentTime, CSS_ANIMATION_DURATION / 2);

0 commit comments

Comments
 (0)