Re: [RequestAnimationFrame] Canceling animation frame requests from animation frame callbacks may not work

On Tue, Dec 6, 2011 at 8:13 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> The way the processing model is defined, canceling a request from another
> animation frame callback from the same document will not work. Canceling a
> request from an animation frame callback for some other document _will_
> work (though more on this in my next mail).
>

Hmmm - the intent (and WebKit implementation) is that
cancelRequestAnimationFrame() should cancel the callback with that ID
regardless of if it's currently in the animation frame callback list or in
a copy:

https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/RequestAnimationFrame/Overview.html#cancelRequestAnimationFrame

The current normative text is "When cancelRequestAnimationFrame(handle) is
called, the user agent must set thecancelled flag to true for the entry in
the animation frame request callback
list<https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/RequestAnimationFrame/Overview.html#dfn-animation-frame-request-callback-list>
 whose handle is handle. If there is no entry in the list with the given
handle, then this function does nothing."  The Note says "
cancelRequestAnimationFrame<https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/RequestAnimationFrame/Overview.html#cancelRequestAnimationFrame>
might
be called for an entry in the
Document<http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-document>
’s animation frame request callback
list<https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/RequestAnimationFrame/Overview.html#dfn-animation-frame-request-callback-list>
or
in the sample all
animations<https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/RequestAnimationFrame/Overview.html#dfn-sample-all-animations>
operation’s
temporary list. In either case the entry’s cancelled flag is set to true so
that the callback does not run."

I believe that if I modify the lookup to do what the Note says instead of
what the normative text says then it should behave as expected.  Would that
work for you?  It should be an easy edit, modulo some wordsmithing.

- James


I feel like we've discussed this before, but don't recall what we agreed to
> do...
>
> -Boris
>
>
>

Received on Wednesday, 7 December 2011 05:34:43 UTC