-
Notifications
You must be signed in to change notification settings - Fork 711
[css-transitions-2][css-animations-2] The event order of the cancelled transitions/animations #11064
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 had a bit of a think about this. For CSS animations we sort by:
So how do we handle cancel events from animations that have been cancelled? Consider a few examples of changes to Case A: If we change Case B: If we change Case C: What if the Given that, I think we could sort as:
So, for example, if both A and B have been cancelled, we just sort by the old positions in the list. If only A or B has been cancelled, the cancelled animation sorts first. If neither A nor B have been cancelled, we sort by the positions in the current list. |
Proposed spec edits:
That last sentence in particular probably needs work but that's the gist anyway. |
Add some tests for animation events sorting, per the spec issue: w3c/csswg-drafts#11064 (comment), and follow the spec: https://drafts.csswg.org/css-animations-2/#animation-composite-order Differential Revision: https://phabricator.services.mozilla.com/D230610 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1933281 gecko-commit: 495c6765094e8da352e02924e824e5876a64a223 gecko-reviewers: hiro
Add some tests for animation events sorting, per the spec issue: w3c/csswg-drafts#11064 (comment), and follow the spec: https://drafts.csswg.org/css-animations-2/#animation-composite-order Differential Revision: https://phabricator.services.mozilla.com/D230610
Add some tests for animation events sorting, per the spec issue: w3c/csswg-drafts#11064 (comment), and follow the spec: https://drafts.csswg.org/css-animations-2/#animation-composite-order Differential Revision: https://phabricator.services.mozilla.com/D230610 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1933281 gecko-commit: 495c6765094e8da352e02924e824e5876a64a223 gecko-reviewers: hiro
Add some tests for animation events sorting, per the spec issue: w3c/csswg-drafts#11064 (comment), and follow the spec: https://drafts.csswg.org/css-animations-2/#animation-composite-order Differential Revision: https://phabricator.services.mozilla.com/D230610
Add some tests for animation events sorting, per the spec issue: w3c/csswg-drafts#11064 (comment), and follow the spec: https://drafts.csswg.org/css-animations-2/#animation-composite-order Differential Revision: https://phabricator.services.mozilla.com/D230610 UltraBlame original commit: 495c6765094e8da352e02924e824e5876a64a223
Add some tests for animation events sorting, per the spec issue: w3c/csswg-drafts#11064 (comment), and follow the spec: https://drafts.csswg.org/css-animations-2/#animation-composite-order Differential Revision: https://phabricator.services.mozilla.com/D230610 UltraBlame original commit: 495c6765094e8da352e02924e824e5876a64a223
Add some tests for animation events sorting, per the spec issue: w3c/csswg-drafts#11064 (comment), and follow the spec: https://drafts.csswg.org/css-animations-2/#animation-composite-order Differential Revision: https://phabricator.services.mozilla.com/D230610 UltraBlame original commit: 495c6765094e8da352e02924e824e5876a64a223
Recently, we noticed a Gecko bug about the event order of
transitioncancel
in Bug 1923208. Per the example this bug, we may have a case whentransitioncancel
andtransitionrun
have the same scheduled time.The example is something like this, when we are replacing a running transition:
So basically, in Blink and Webkit, the event order when replacing the transition is:
However, in Gecko, the order is:
These events have the same schedule time, and Gecko puts
transitioncancel
last.Per spec, we use the following way to decide the order of them (copied from the comments in the bug):
If the scheduled event times are the same then the algorithm is to sort by composite order. That's going to mean we sort as follows:
Since the classes are the same ("transition"), we'll sort by the transition-specific composite order, and then we'll hit step 2 there because the cancelled transitions don't have the owning element:
So it seems we should put the event of the cancelled transition first because it doesn't have the owning element. However, this is not what we expected because we cancel the transition first, and then create the new transition to replace the old one.
We may need to update the spec words to address the case for cancelled transition, e.g. per Brian's suggestion in this Gecko bug:
Also, we have the similar issue for
animationcanel
(in css-animations-2), and we probably need to figure out how to useanimation-name
for a cancelled animation.cc @birtles
The text was updated successfully, but these errors were encountered: