W3C home > Mailing lists > Public > public-web-perf@w3.org > May 2011

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

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 03 May 2011 22:32:05 -0400
Message-ID: <4DC0BAA5.2090007@mit.edu>
To: public-web-perf@w3.org
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.

-Boris
Received on Wednesday, 4 May 2011 02:32:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 4 May 2011 02:32:46 GMT