Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[web-animations-1] Play state should use the effective playback rate #3190

Closed
birtles opened this issue Oct 3, 2018 · 2 comments · Fixed by #3191
Closed

[web-animations-1] Play state should use the effective playback rate #3190

birtles opened this issue Oct 3, 2018 · 2 comments · Fixed by #3191
Assignees

Comments

@birtles
Copy link
Contributor

birtles commented Oct 3, 2018

A pending animation's play state 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

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.

@birtles birtles self-assigned this Oct 3, 2018
birtles added a commit to birtles/csswg-drafts that referenced this issue Oct 3, 2018
@birtles
Copy link
Contributor Author

birtles commented Oct 3, 2018

I'm going to go ahead and merge the PR for this since I don't expect this change to be controversial. If there are any concerns, please let me know and I'll back it out.

@birtles
Copy link
Contributor Author

birtles commented Oct 3, 2018

Tests for this will be updated in Mozilla bug 1495647.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant