Re: requestAnimationFrame

On 11/17/10 5:22 PM, Gregg Tavares (wrk) wrote:
> Think about this some more..... the point if the previous suggestion is
> that updating keeping a JS animation in sync with a CSS animation has
> nothing to do with "painting" or rendering. The fact that apparently
> firefox ties those 2 things together is an artifact of firefox's
> implementation.

Oh, I see the issue.  The event name.

The name was just picked as a way of telling script authors something 
about what the callback means.... All that Gecko promises right now is 
that you get the callback, then SMIL and Transitions and any pending 
style changes (including the ones your just caused) are processed and 
the layout/style of the page updated.

Painting is in fact completely decoupled from this process in Gecko at 
the moment, except insofar as they happen on the same thread.  Nothing 
guarantees that you won't get another MozBeforePaint event before 
painting actually happens, or that you won't get multiple paints in a 
row without a MozBeforePaint event in between.  So yeah, the event name 
is somewhat suboptimal.  ;)

Again, all the event means is "we're about to resample declarative 
animations; this is your chance to do script stuff that's supposed to 
look like an animation".

-Boris

Received on Thursday, 18 November 2010 02:27:43 UTC