Re: [AnimationRequestFrame] Sample all animations operation and cancelRequestAnimationFrame specification updated

On 5/3/11 10:15 PM, James Robinson wrote:
> - Callbacks registered outside of the "sample all animation" operation
> should immediately be eligible to run.
> - Callbacks registered during the "sample all animations" operation
> should run the next time the browser samples animations.

Agreed on these.

> - A callback should never run after it has been cancelled, regardless of
> when it gets cancelled.

This does add another source of ordering dependencies on callbacks 
(which can try to cancel each other).  Disallowing cancellation of 
callbacks that are in the list copy would avoid that, though I agree 
that behavior might surprise developers.

I'd love some more opinions here if people have any.

> I think this is the least surprising behavior for developers.  In the
> spec this is specified using a copy of the callback list and a
> cancellation flag, but implementations can of course do something
> simpler that has the same behavior (such as immediately remove the
> callback from whatever list it is in).  The copy stuff will likely be
> necessary when we add the element visibility checks in so I've left it
> specified that way for now.

The copy stuff also makes it much simpler to handle your second bullet 
point; it Just Works with nothing else needing to be said.


Received on Wednesday, 4 May 2011 02:32:45 UTC