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

Re: [AnimationRequestFrame] Initial editor's draft of AnimationRequestFrame spec available

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 03 May 2011 09:44:06 -0400
Message-ID: <4DC006A6.7060508@mit.edu>
To: robert@ocallahan.org
CC: James Robinson <jamesr@google.com>, public-web-perf@w3.org
On 5/3/11 2:05 AM, Robert O'Callahan wrote:
> Then we can improve the iterative algorithm a bit by running callbacks
> as soon as we think they are likely to be needed, like so:
> 1) Resample declarative animations
> 2) Run all animation callbacks with no associated element (we know these
> need to run, best to run them first)
> 3) While there are callbacks that have not run yet:
>    a) Flush restyles and layout
>    b) Compute the set of callbacks that have not run yet whose elements
> are currently visible in the viewport
>    c) If that set is empty, go to step 4
>    d) Otherwise, run all those callbacks
> 4) Flush restyles and layout
> 5) Paint

That's precisely what I was proposing.  ;)

> Unfired callbacks need to stay in the list so that if the element
> becomes visible, a callback fires. However, we can avoid wakeups by
> observing that we only need to reschedule a scan of the list if a reflow
> or scroll operation has occurred. Then for a page that's quiescent apart
> from an animation callback for an element outside the viewport, we
> wouldn't wake up.

Excellent.  Sold.

-Boris
Received on Tuesday, 3 May 2011 13:44:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 May 2011 13:45:00 GMT