-
Notifications
You must be signed in to change notification settings - Fork 715
[web-animations-1] Animatable.animate() should not flush #3613
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
Labels
Comments
Discussed this with Google, Apple, and Microsoft folk and agreed |
birtles
added a commit
to birtles/csswg-drafts
that referenced
this issue
Feb 15, 2019
WPT for this have been written and will be landed via Mozilla bug 1525809. |
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this issue
Feb 15, 2019
… that does not flush style and use it; r=hiro A forthcoming spec change will require that Animatable.animate() and other methods that mutate animations do not flush style: w3c/csswg-drafts#3613 Bug 1525809 will add web-platform-tests for this change once it is made (and tweak the behavior introduced in this patch if necessary). Currently Firefox and WebKit will flush styles when calling Animatable.animate(). This is undesirable since this method will _also_ invalidate style. As a result, if content triggers multiple animations in a single animation frame, it will restyle every time it creates an animation. This patch removes the style flush from a number of these methods. In general the style flush is not necessary. For example, we don't need to flush style before getting the computed style to pass to UpdateProperties. That's because if there are pending style changes, then UpdateProperties will be called with the updated style once they are applied anyway. Flushing style first means that we may end up resolving style twice, when once would be sufficient. For GetKeyframes() however, when used on a CSS animation, it should return the most up-to-date style so for that call site we *do* want to flush style. The test case added in this patch will fail without the code changes in the patch. Specifically, we will observe 10 non-animation restyles (from the 5 animations) if we flush styles from SetKeyframes. Differential Revision: https://phabricator.services.mozilla.com/D18916 --HG-- extra : moz-landing-system : lando
birtles
added a commit
that referenced
this issue
Feb 15, 2019
mykmelez
pushed a commit
to mykmelez/gecko
that referenced
this issue
Feb 16, 2019
… that does not flush style and use it; r=hiro A forthcoming spec change will require that Animatable.animate() and other methods that mutate animations do not flush style: w3c/csswg-drafts#3613 Bug 1525809 will add web-platform-tests for this change once it is made (and tweak the behavior introduced in this patch if necessary). Currently Firefox and WebKit will flush styles when calling Animatable.animate(). This is undesirable since this method will _also_ invalidate style. As a result, if content triggers multiple animations in a single animation frame, it will restyle every time it creates an animation. This patch removes the style flush from a number of these methods. In general the style flush is not necessary. For example, we don't need to flush style before getting the computed style to pass to UpdateProperties. That's because if there are pending style changes, then UpdateProperties will be called with the updated style once they are applied anyway. Flushing style first means that we may end up resolving style twice, when once would be sufficient. For GetKeyframes() however, when used on a CSS animation, it should return the most up-to-date style so for that call site we *do* want to flush style. The test case added in this patch will fail without the code changes in the patch. Specifically, we will observe 10 non-animation restyles (from the 5 animations) if we flush styles from SetKeyframes. Differential Revision: https://phabricator.services.mozilla.com/D18916
moz-wptsync-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this issue
Feb 20, 2019
…s API Issue: w3c/csswg-drafts#3613 Corresponding spec change: w3c/csswg-drafts@78dc281 Differential Revision: https://phabricator.services.mozilla.com/D20241 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1525809 gecko-commit: 0738638178a900d7a44546181d5b401f9dd5a198 gecko-integration-branch: autoland gecko-reviewers: hiro
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this issue
Feb 21, 2019
… Web Animations API; r=hiro Issue: w3c/csswg-drafts#3613 Corresponding spec change: w3c/csswg-drafts@78dc281 Differential Revision: https://phabricator.services.mozilla.com/D20241 --HG-- extra : moz-landing-system : lando
mykmelez
pushed a commit
to mykmelez/gecko
that referenced
this issue
Feb 21, 2019
… Web Animations API; r=hiro Issue: w3c/csswg-drafts#3613 Corresponding spec change: w3c/csswg-drafts@78dc281 Differential Revision: https://phabricator.services.mozilla.com/D20241
jgraham
pushed a commit
to web-platform-tests/wpt
that referenced
this issue
Feb 25, 2019
…s API Issue: w3c/csswg-drafts#3613 Corresponding spec change: w3c/csswg-drafts@78dc281 Differential Revision: https://phabricator.services.mozilla.com/D20241 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1525809 gecko-commit: 0738638178a900d7a44546181d5b401f9dd5a198 gecko-integration-branch: autoland gecko-reviewers: hiro
marcoscaceres
pushed a commit
to web-platform-tests/wpt
that referenced
this issue
Jul 23, 2019
…s API Issue: w3c/csswg-drafts#3613 Corresponding spec change: w3c/csswg-drafts@78dc281 Differential Revision: https://phabricator.services.mozilla.com/D20241 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1525809 gecko-commit: 0738638178a900d7a44546181d5b401f9dd5a198 gecko-integration-branch: autoland gecko-reviewers: hiro
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this issue
Oct 3, 2019
… that does not flush style and use it; r=hiro A forthcoming spec change will require that Animatable.animate() and other methods that mutate animations do not flush style: w3c/csswg-drafts#3613 Bug 1525809 will add web-platform-tests for this change once it is made (and tweak the behavior introduced in this patch if necessary). Currently Firefox and WebKit will flush styles when calling Animatable.animate(). This is undesirable since this method will _also_ invalidate style. As a result, if content triggers multiple animations in a single animation frame, it will restyle every time it creates an animation. This patch removes the style flush from a number of these methods. In general the style flush is not necessary. For example, we don't need to flush style before getting the computed style to pass to UpdateProperties. That's because if there are pending style changes, then UpdateProperties will be called with the updated style once they are applied anyway. Flushing style first means that we may end up resolving style twice, when once would be sufficient. For GetKeyframes() however, when used on a CSS animation, it should return the most up-to-date style so for that call site we *do* want to flush style. The test case added in this patch will fail without the code changes in the patch. Specifically, we will observe 10 non-animation restyles (from the 5 animations) if we flush styles from SetKeyframes. Differential Revision: https://phabricator.services.mozilla.com/D18916 UltraBlame original commit: 5dac0d4a3c4428a9e553ba7e1c47da7a81636c2a
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this issue
Oct 3, 2019
… Web Animations API; r=hiro Issue: w3c/csswg-drafts#3613 Corresponding spec change: w3c/csswg-drafts@78dc281 Differential Revision: https://phabricator.services.mozilla.com/D20241 UltraBlame original commit: 0738638178a900d7a44546181d5b401f9dd5a198
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this issue
Oct 4, 2019
… that does not flush style and use it; r=hiro A forthcoming spec change will require that Animatable.animate() and other methods that mutate animations do not flush style: w3c/csswg-drafts#3613 Bug 1525809 will add web-platform-tests for this change once it is made (and tweak the behavior introduced in this patch if necessary). Currently Firefox and WebKit will flush styles when calling Animatable.animate(). This is undesirable since this method will _also_ invalidate style. As a result, if content triggers multiple animations in a single animation frame, it will restyle every time it creates an animation. This patch removes the style flush from a number of these methods. In general the style flush is not necessary. For example, we don't need to flush style before getting the computed style to pass to UpdateProperties. That's because if there are pending style changes, then UpdateProperties will be called with the updated style once they are applied anyway. Flushing style first means that we may end up resolving style twice, when once would be sufficient. For GetKeyframes() however, when used on a CSS animation, it should return the most up-to-date style so for that call site we *do* want to flush style. The test case added in this patch will fail without the code changes in the patch. Specifically, we will observe 10 non-animation restyles (from the 5 animations) if we flush styles from SetKeyframes. Differential Revision: https://phabricator.services.mozilla.com/D18916 UltraBlame original commit: 5dac0d4a3c4428a9e553ba7e1c47da7a81636c2a
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this issue
Oct 4, 2019
… Web Animations API; r=hiro Issue: w3c/csswg-drafts#3613 Corresponding spec change: w3c/csswg-drafts@78dc281 Differential Revision: https://phabricator.services.mozilla.com/D20241 UltraBlame original commit: 0738638178a900d7a44546181d5b401f9dd5a198
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this issue
Oct 4, 2019
… that does not flush style and use it; r=hiro A forthcoming spec change will require that Animatable.animate() and other methods that mutate animations do not flush style: w3c/csswg-drafts#3613 Bug 1525809 will add web-platform-tests for this change once it is made (and tweak the behavior introduced in this patch if necessary). Currently Firefox and WebKit will flush styles when calling Animatable.animate(). This is undesirable since this method will _also_ invalidate style. As a result, if content triggers multiple animations in a single animation frame, it will restyle every time it creates an animation. This patch removes the style flush from a number of these methods. In general the style flush is not necessary. For example, we don't need to flush style before getting the computed style to pass to UpdateProperties. That's because if there are pending style changes, then UpdateProperties will be called with the updated style once they are applied anyway. Flushing style first means that we may end up resolving style twice, when once would be sufficient. For GetKeyframes() however, when used on a CSS animation, it should return the most up-to-date style so for that call site we *do* want to flush style. The test case added in this patch will fail without the code changes in the patch. Specifically, we will observe 10 non-animation restyles (from the 5 animations) if we flush styles from SetKeyframes. Differential Revision: https://phabricator.services.mozilla.com/D18916 UltraBlame original commit: 5dac0d4a3c4428a9e553ba7e1c47da7a81636c2a
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this issue
Oct 4, 2019
… Web Animations API; r=hiro Issue: w3c/csswg-drafts#3613 Corresponding spec change: w3c/csswg-drafts@78dc281 Differential Revision: https://phabricator.services.mozilla.com/D20241 UltraBlame original commit: 0738638178a900d7a44546181d5b401f9dd5a198
bhearsum
pushed a commit
to mozilla-releng/staging-firefox
that referenced
this issue
May 1, 2025
… Web Animations API; r=hiro Issue: w3c/csswg-drafts#3613 Corresponding spec change: w3c/csswg-drafts@78dc281 Differential Revision: https://phabricator.services.mozilla.com/D20241
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From Mozilla bug 1524480:
It turns out that whether or not Element.animate flushes is observable (and it doesn't flush in Blink but does in Gecko and WebKit).
Suppose we have:
And then we do:
At this point the computed opacity of
div
is 0.1.Now, suppose we update the specified opacity to 0.2 but DON'T flush style:
Then trigger an animation on the same element:
At this point if
Element.animate()
flushes style it will cause us to trigger a transition from 0.1 to 0.2.However, if
Element.animate()
does NOT flush style we will:Animation
animating from 0.6 to 1.Since the before-change style and after-change style have not changed, no transition will be generated.
Test case: https://codepen.io/birtles/pen/YBxxBd
I propose we spec that
Animatable.animate()
(and similarlyKeyframeEffect.setKeyframes()
, etc.) do not flush style (or, in CSS transitions spec terms, trigger a style change event).The reason is that if we require UAs to flush, it would mean that
Element.animate()
both flushes AND dirties style. As a result, if the author triggers a number of animations in a single animation frame, the browser would be required to flush multiple times per frame.The text was updated successfully, but these errors were encountered: