Bug 85819 (RAF_returning_zero) - Initial call to webkitRequestAnimationFrame returns 0, Spec indicates the handle should always be > 0
Summary: Initial call to webkitRequestAnimationFrame returns 0, Spec indicates the han...
Status: RESOLVED FIXED
Alias: RAF_returning_zero
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Minor
Assignee: Dean Jackson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-05-07 12:54 PDT by ctrlfrk
Modified: 2012-08-14 18:52 PDT (History)
4 users (show)

See Also:


Attachments
Patch (3.92 KB, patch)
2012-08-14 18:18 PDT, Dean Jackson
jamesr: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ctrlfrk 2012-05-07 12:54:15 PDT
Looking at http://www.w3.org/TR/animation-timing/ there is a section that reads: "The requestAnimationFrame method is used to signal to the user agent that a script-based animation needs to be resampled. When requestAnimationFrame(callback) is called, the user agent must schedule a script-based animation resampling by appending to the end of the animation frame request callback list an entry whose handle is a user-agent-defined integer greater than zero that uniquely identifies the entry in the list and whose callback is callback."

However the first call to webkitRequestAnimationFrame seems to be returning a handle of 0. 
It's minor, but worth mentioning.
Comment 1 Dean Jackson 2012-05-08 13:21:36 PDT
Yeah, easy fix.
Comment 2 James Robinson 2012-05-08 13:33:47 PDT
Whoops!  Pre-increment when it should be a post-increment.

For the record, the intent of that text is that the return value should never be false-y and it should match setTimeout/setInterval
Comment 3 Radar WebKit Bug Importer 2012-08-14 17:13:58 PDT
<rdar://problem/12100411>
Comment 4 Dean Jackson 2012-08-14 18:18:01 PDT
Created attachment 158471 [details]
Patch
Comment 5 Dean Jackson 2012-08-14 18:52:21 PDT
Committed r125633: <http://trac.webkit.org/changeset/125633>