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

On Mon, May 2, 2011 at 6:16 PM, Jatinder Mann <> wrote:

>  James, thanks for getting the spec on to I
> have some feedback on the current draft:
> 2.       To increase adoption of the requestFrameAnimation(), it should be
> syntactically similar to window.setInterval() or window.setTimeout(). This
> means that in addition to taking a FrameRequestCallback, we should also
> allow inline script and additional arguments. For example,

I agree with Boris and Jonas that these are not needed.  In addition to what
they have already said, the additional arguments feature of
window.setTimeout/setInterval is almost never used in practice because it is
not interoperable (IE8 and below ignore it, Firefox adds an extra parameter
in addition to those specified see 'note').  I did
verify that this syntax is close enough to a drop-in replacement for common
JavaScript libraries that currently use setTimeout or setInterval and in
fact several libraries, such as jQuery, are using requestAnimationFrame when
it is available instead of setTimeout or setInterval.

> 3.       The specification should be clear that the element argument in
> the requestAnimationFrame method should be optional and not a normative
> requirement. I recommend adding the ‘optional’ text like so:
 The version I have uploaded currently does not include the element
parameter, but if/when we do add it it will definitely be optional.

4.       More information is needed on the sample() method of the
> FrameRequestCallback interface. A non-normative example use case would be
> appropriate.
> I'm not sure quite what you mean - FrameRequestCallback should be invisible
to the users of the API and exists mostly as a way to talk about the
enqueued callbacks within the specification.  Users will just pass in a
function to requestAnimationFrame.  Is there a better way to spec this,

> 5.       The Introduction section should have an example use case of this
> API. This can be the canonical example of replacing existing use of
> setTimeout() or setInterval() with this API.

There's an example in the Introduction section (
in the light blue box.   A version quite similar to that code is available

- James

> Thanks,
> Jatinder

Received on Tuesday, 3 May 2011 03:06:10 UTC