Closed
Bug 647517
Opened 13 years ago
Closed 3 years ago
Add an element argument to mozRequestAnimationFrame
Categories
(Core :: DOM: Core & HTML, defect, P2)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: heycam, Unassigned)
Details
We should support an optional second argument to mozRequestAnimationFrame, an element, which would cause the animation callback function not to be called when the element is known not to be visible (e.g. scrolled out of view).
Comment 1•13 years ago
|
||
(In reply to comment #0) > We should support an optional second argument to mozRequestAnimationFrame, an > element, which would cause the animation callback function not to be called > when the element is known not to be visible (e.g. scrolled out of view). How do you define being visible?
Comment 2•13 years ago
|
||
> How do you define being visible?
Current plan, I think, is "overflow area of one of the continuations of the primary frame intersects the viewport".
Taking, but if someone is interested they should feel free to steal.
Assignee: nobody → bzbarsky
Priority: -- → P1
Wouldn't it make more sense to support mozRequestAnimationFrame as an API on elements as well as Window?
I seem to recall that James Robinson thought having it always on Window made it easier to cancel because you don't need an element reference. But I don't think cancellation is going to be widely used, personally. I suppose we could have both.
Comment 5•13 years ago
|
||
Canceling would just use the id of the request; it wouldn't need an element reference. Hanging it off the element does raise questions about the right behavior if the element is move between documents before the refresh timer fires.
Comment 6•13 years ago
|
||
(In reply to comment #5) > Canceling would just use the id of the request; it wouldn't need an element > reference. > > Hanging it off the element does raise questions about the right behavior if the > element is move between documents before the refresh timer fires. Right - I wasn't sure how to handle this case: var id = elem.mozRequestAnimationFrame(foo); someOtherDocument.adoptNode(elem); Is the callback cancelled by this: window.mozCancelRequestAnimationFrame(id); or by: someOtherDocument.window.mozCancelRequestAnimationFrame(id); Also, this would mean that ids would have to be allocated to be global across all possible documents, not just the one. This point isn't too difficult to deal with in the implementation but is somewhat confusing.
Updated•6 years ago
|
Severity: normal → major
Priority: P1 → P2
Assignee | ||
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
Comment 7•4 years ago
|
||
This never got specced; I think we should wontfix this bug.
Assignee: bzbarsky → nobody
Comment 8•3 years ago
|
||
Hey Boris,
Since this has never been specced according to the last comment should we close the bug?
Flags: needinfo?(bzbarsky)
Updated•3 years ago
|
Flags: needinfo?(bzbarsky)
You need to log in
before you can comment on or make changes to this bug.
Description
•