Repository navigation
Make cancelAnimationFrame cancel pending callbacks - #4375
Merged
Merged
Conversation
Calling cancelAnimationFrame from within a requestAnimationFrame callback should cancel any requestAnimationFrame callbacks that are pending for the current frame. The currently specified behavior does not permit that, however, since it clones the set of callbacks before iterating over them. This patch updates the algorithm to run animation frame callbacks such that it is possible to cancel a pending animation frame callback. This also brings the specified behavior into line with its implementation in Blink, EdgeHTML, and WebKit. This closes whatwg#4359.
Contributor
Author
|
Added a WPT in web-platform-tests/wpt#15455 |
birtles
marked this pull request as ready for review
February 19, 2019 07:39
Contributor
Author
|
I made my affiliation with Mozilla public but it's still telling me that I have not signed up to participate. |
Member
|
@birtles I invited you to join Mozilla's GitHub organization for this. Once you join and make your membership public all will be in order. |
annevk
reviewed
Feb 19, 2019
annevk
left a comment
Member
There was a problem hiding this comment.
Thanks, looks great. I have a couple of nits, but I could fix those as well before merging. (I also took the liberty of updating your comment to point to the actual added tests.)
Have you filed a bug against Firefox already?
annevk
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Feb 19, 2019
Contributor
Author
|
Great, thank you! I'll fix the nits tomorrow (unless you get to it first). |
annevk
approved these changes
Feb 19, 2019
Contributor
Author
|
Thanks Anne! |
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this pull request
Mar 15, 2019
…e cancels a pending animation frame callback, a=testonly Automatic update from web-platform-tests HTML: cancelAnimationFrame cancels a pending animation frame callback For whatwg/html#4375. -- wpt-commits: bbbe615d3f5b7b44ed49b4b369f19d4c5dd32e53 wpt-pr: 15455
mykmelez
pushed a commit
to mykmelez/gecko
that referenced
this pull request
Mar 16, 2019
…e cancels a pending animation frame callback, a=testonly Automatic update from web-platform-tests HTML: cancelAnimationFrame cancels a pending animation frame callback For whatwg/html#4375. -- wpt-commits: bbbe615d3f5b7b44ed49b4b369f19d4c5dd32e53 wpt-pr: 15455
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this pull request
Mar 16, 2019
…e cancels a pending animation frame callback, a=testonly Automatic update from web-platform-tests HTML: cancelAnimationFrame cancels a pending animation frame callback For whatwg/html#4375. -- wpt-commits: bbbe615d3f5b7b44ed49b4b369f19d4c5dd32e53 wpt-pr: 15455
mykmelez
pushed a commit
to mykmelez/gecko
that referenced
this pull request
Mar 17, 2019
…e cancels a pending animation frame callback, a=testonly Automatic update from web-platform-tests HTML: cancelAnimationFrame cancels a pending animation frame callback For whatwg/html#4375. -- wpt-commits: bbbe615d3f5b7b44ed49b4b369f19d4c5dd32e53 wpt-pr: 15455
marcoscaceres
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Jul 23, 2019
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
Oct 4, 2019
…e cancels a pending animation frame callback, a=testonly Automatic update from web-platform-tests HTML: cancelAnimationFrame cancels a pending animation frame callback For whatwg/html#4375. -- wpt-commits: bbbe615d3f5b7b44ed49b4b369f19d4c5dd32e53 wpt-pr: 15455 UltraBlame original commit: e7d92d3120c423087b25c70bdcd4c3696ae078a5
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
Oct 4, 2019
…e cancels a pending animation frame callback, a=testonly Automatic update from web-platform-tests HTML: cancelAnimationFrame cancels a pending animation frame callback For whatwg/html#4375. -- wpt-commits: bbbe615d3f5b7b44ed49b4b369f19d4c5dd32e53 wpt-pr: 15455 UltraBlame original commit: 52a879d4e479200bddbe0bf3ee6b4c28e7d220de
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this pull request
Oct 4, 2019
…e cancels a pending animation frame callback, a=testonly Automatic update from web-platform-tests HTML: cancelAnimationFrame cancels a pending animation frame callback For whatwg/html#4375. -- wpt-commits: bbbe615d3f5b7b44ed49b4b369f19d4c5dd32e53 wpt-pr: 15455 UltraBlame original commit: e7d92d3120c423087b25c70bdcd4c3696ae078a5
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this pull request
Oct 4, 2019
…e cancels a pending animation frame callback, a=testonly Automatic update from web-platform-tests HTML: cancelAnimationFrame cancels a pending animation frame callback For whatwg/html#4375. -- wpt-commits: bbbe615d3f5b7b44ed49b4b369f19d4c5dd32e53 wpt-pr: 15455 UltraBlame original commit: 52a879d4e479200bddbe0bf3ee6b4c28e7d220de
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
Oct 4, 2019
…e cancels a pending animation frame callback, a=testonly Automatic update from web-platform-tests HTML: cancelAnimationFrame cancels a pending animation frame callback For whatwg/html#4375. -- wpt-commits: bbbe615d3f5b7b44ed49b4b369f19d4c5dd32e53 wpt-pr: 15455 UltraBlame original commit: e7d92d3120c423087b25c70bdcd4c3696ae078a5
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
Oct 4, 2019
…e cancels a pending animation frame callback, a=testonly Automatic update from web-platform-tests HTML: cancelAnimationFrame cancels a pending animation frame callback For whatwg/html#4375. -- wpt-commits: bbbe615d3f5b7b44ed49b4b369f19d4c5dd32e53 wpt-pr: 15455 UltraBlame original commit: 52a879d4e479200bddbe0bf3ee6b4c28e7d220de
bhearsum
pushed a commit
to mozilla-releng/staging-firefox
that referenced
this pull request
May 1, 2025
…e cancels a pending animation frame callback, a=testonly Automatic update from web-platform-tests HTML: cancelAnimationFrame cancels a pending animation frame callback For whatwg/html#4375. -- wpt-commits: bbbe615d3f5b7b44ed49b4b369f19d4c5dd32e53 wpt-pr: 15455
bhearsum
pushed a commit
to mozilla-releng/staging-firefox
that referenced
this pull request
May 1, 2025
…e cancels a pending animation frame callback, a=testonly Automatic update from web-platform-tests HTML: cancelAnimationFrame cancels a pending animation frame callback For whatwg/html#4375. -- wpt-commits: bbbe615d3f5b7b44ed49b4b369f19d4c5dd32e53 wpt-pr: 15455
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Calling cancelAnimationFrame from within a requestAnimationFrame
callback should cancel any requestAnimationFrame callbacks that are
pending for the current frame. The currently specified behavior does not
permit that, however, since it clones the set of callbacks before
iterating over them.
This patch updates the algorithm to run animation frame callbacks such
that it is possible to cancel a pending animation frame callback.
This also brings the specified behavior into line with its
implementation in Blink, EdgeHTML, and WebKit.
This closes #4359.
/imagebitmap-and-animations.html ( diff )
/infrastructure.html ( diff )