-
Notifications
You must be signed in to change notification settings - Fork 715
[css-animations-1] Removing the target of an animation has different behaviour between CSS Animations, CSS Transitions and Web Animations #2948
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
Comments
I believe the distinction here is that for CSS animations and CSS transitions the animation is defined by style whereas for the API it is defined by script. Last I checked, there was some mismatch about what the the spec and implementations do about
Similarly, since
Since animations defined by the API don't rely on the cascade to be defined, they can continue to run even when the element not included in the box tree. That is, in the absence of anything saying they don't run on such elements (unlike CSS animations/transitions), they should run. |
What I wonder though is what procedure is expected to run as a result of an element with a style-originated animation no longer participating in the cascade. It seems to me that both Chrome and Firefox do something similar to calling cancel() on the animation, but I can't find spec text that makes this clear. |
Right, that is the yet-to-be-written text for CSS Animations 2 and CSS Transitions 2. (There's an issue in CSS Transitions 2 specifically mentioning that this needs to be defined, but presumably we need to do the same for CSS Animations 2 as well.) |
Uh oh!
There was an error while loading. Please reload this page.
I wrote three different tests that have different behaviour in various browsers. They all test what happens when you start an animation and then remove the animation's target and check the animation play state before and after.
css-animation.html
css-transition.html
web-animation.html
Here are the results:
So it seems we have first some disagreements between browsers on what the initial state would be, Firefox and WebKit both thinking it's "running" and Chrome thinking it's "pending", although I assume this is just due to Chrome not having yet made the change to remove "pending" as one of the play states.
What I wonder about is why would removing the target of a CSS Animation or CSS Transition would result in the play state being "idle" for everyone, but not for a vanilla Web Animations. What spec says why that is the case?
@flackr @stephenmcgruer @birtles
The text was updated successfully, but these errors were encountered: