[csswg-drafts] [web-animations-1] Play state should use the effective playback rate

birtles has just created a new issue for https://github.com/w3c/csswg-drafts:

== [web-animations-1] Play state should use the effective playback rate ==
A pending animation's [play state](https://drafts.csswg.org/web-animations-1/#play-states) should reflect the play state it is _entering_.

For example, a play-pending animation will report 'running' (not idle), a pause-pending animation will report 'paused'.

Likewise for finished animations, we should determine if the animation is finished or not based on the outcome once any pending playback rate is applied.

Consider the following example

```js
const animation = div.animate({}, 1000);
// playState: running
// pending: true

animation.updatePlaybackRate(-1);
// playState: running
// pending: true

/* Use play() to skip to the end of the animation */

animation.play();
// playState: finished
// pending: true

await animation.ready;
// playState: running
// pending: true
```

As you can see, the animation reports 'finished' even though it is about to enter the 'running' state.

By making the algorithm for calculating the play state use the effective playback rate, this will return 'running' instead.


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3190 using your GitHub account

Received on Wednesday, 3 October 2018 05:31:04 UTC