Re: [csswg-drafts] [web-animations-1] Fixed play animation procedure for scroll animations (#2075) (#5059)

>     * reverse() example:
> 
> 
> ```
> promise_test(async t => {
>   const animation = createScrollLinkedAnimation(t); // duration: 1000
>   // Wait for new animation frame which allows the timeline to compute new
>   // current time.
>   await waitForNextFrame();
>   animation.play();
>   animation.currentTime = 2000;
>   // play() invoked by reverse() sets start time to 1000 based on the
>   // effective playback rate, which is -1.
>   animation.reverse(); 
>   // This fails. Current time is calculated based on playback rate, which is 1.
>   assert_equals(animation.currentTime, 1000, 
>     'reverse() should start playing from the animation effect end ' +
>     'if the playbackRate > 0 and the currentTime > effect end');
> }, 'Reversing an animation when playbackRate > 0 and currentTime > ' +
>    'effect end should make it play from the end');
> ```

Thank you!

Thinking about this, I think this is just an artifact of the fact that we are seeking using the start time rather than the hold time -- hence the effect doesn't take place until the animation is ready.

But thinking about this further, currently the whole point of the pending task is typically to resolve a suitable start time. That's why [setting the start time](https://drafts.csswg.org/web-animations-1/#setting-the-start-time-of-an-animation) cancels any pending tasks.

Do we now want animations to remain pending if they don't have an active timeline? If so, we need to update the procedure to set the start time (and possibly other places). If not, we could possibly just call that procedure here instead.

-- 
GitHub Notification of comment by birtles
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/pull/5059#issuecomment-627088872 using your GitHub account

Received on Tuesday, 12 May 2020 03:38:17 UTC