diff --git a/src/proxy-animation.js b/src/proxy-animation.js index 417d9e5..c7bcc9f 100644 --- a/src/proxy-animation.js +++ b/src/proxy-animation.js @@ -921,7 +921,9 @@ function autoAlignStartTime(details) { // TODO: Clarify how range duration should be resolved details.rangeDuration = endOffset.value - startOffset.value; // 7. Set start time to start offset if effective playback rate ≥ 0, and end offset otherwise. - const playbackRate = effectivePlaybackRate(details); + // Not by spec: Applying the pending playback rate. If not, the start time will be re-aligned in `commitPendingPlay()` + applyPendingPlaybackRate(details); + const playbackRate = details.animation.playbackRate; details.startTime = fromCssNumberish(details,playbackRate >= 0 ? startOffset : endOffset); // 8. Clear hold time. diff --git a/test/expected.txt b/test/expected.txt index 84d7f50..cf676bc 100644 --- a/test/expected.txt +++ b/test/expected.txt @@ -838,12 +838,12 @@ PASS /scroll-animations/scroll-timelines/play-animation.html The ready promise s PASS /scroll-animations/scroll-timelines/play-animation.html A pending ready promise should be resolved and not replaced when the animation enters the running state PASS /scroll-animations/scroll-timelines/play-animation.html Resuming an animation from paused realigns with scroll position. PASS /scroll-animations/scroll-timelines/play-animation.html If a pause operation is interrupted, the ready promise is reused -FAIL /scroll-animations/scroll-timelines/play-animation.html A pending playback rate is used when determining timeline range alignment +PASS /scroll-animations/scroll-timelines/play-animation.html A pending playback rate is used when determining timeline range alignment PASS /scroll-animations/scroll-timelines/play-animation.html Playing a canceled animation sets the start time PASS /scroll-animations/scroll-timelines/play-animation.html Playing a canceled animation backwards sets the start time PASS /scroll-animations/scroll-timelines/reverse-animation.html Setting current time while reverse-pending preserves currentTime PASS /scroll-animations/scroll-timelines/reverse-animation.html Reversing an animation inverts the playback rate -FAIL /scroll-animations/scroll-timelines/reverse-animation.html Reversing an animation resets a sticky start time. +PASS /scroll-animations/scroll-timelines/reverse-animation.html Reversing an animation resets a sticky start time. PASS /scroll-animations/scroll-timelines/reverse-animation.html Reversing an animation does not cause it to leave the pending state PASS /scroll-animations/scroll-timelines/reverse-animation.html Reversing an animation does not cause it to resolve the ready promise PASS /scroll-animations/scroll-timelines/reverse-animation.html Reversing an animation with a negative playback rate should cause the animation to play in a forward direction