Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial call to webkitRequestAnimationFrame returns 0, Spec indicates…

… the handle should always be > 0


https://bugs.webkit.org/show_bug.cgi?id=85819

Reviewed by James Robinson.

Source/WebCore:

The callback id returned by requestAnimationFrame was beginning at zero, when the spec
says it should be above one. Use a pre-increment rather than a post-increment.

Test: fast/animation/request-animation-frame-callback-id.html

* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::registerCallback): Pre-increment rather than post-increment.

LayoutTests:

* fast/animation/request-animation-frame-callback-id-expected.txt: Added.
* fast/animation/request-animation-frame-callback-id.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125633 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information...
commit c12a83916aeb70ccc456a5f0b4a9734f17edfecd 1 parent b533e4f
@grorg grorg authored
View
10 LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2012-08-14 Dean Jackson <dino@apple.com>
+
+ Initial call to webkitRequestAnimationFrame returns 0, Spec indicates the handle should always be > 0
+ https://bugs.webkit.org/show_bug.cgi?id=85819
+
+ Reviewed by James Robinson.
+
+ * fast/animation/request-animation-frame-callback-id-expected.txt: Added.
+ * fast/animation/request-animation-frame-callback-id.html: Added.
+
2012-08-14 Chris Evans <cevans@google.com>
Handle the XPath / (root) operator correctly for nodes that aren't attached to the document.
View
1  LayoutTests/fast/animation/request-animation-frame-callback-id-expected.txt
@@ -0,0 +1 @@
+PASSED: Callback id was > 0
View
22 LayoutTests/fast/animation/request-animation-frame-callback-id.html
@@ -0,0 +1,22 @@
+<script>
+if (window.testRunner) {
+ window.testRunner.dumpAsText();
+ window.testRunner.waitUntilDone();
+}
+
+function runTest() {
+ var id = window.webkitRequestAnimationFrame(function () {});
+ var results = document.getElementById("results");
+
+ if (id > 0)
+ results.innerText = "PASSED: Callback id was > 0";
+ else
+ results.innerText = "FAILED: Callback id was <= 0";
+
+ if (window.testRunner)
+ window.testRunner.notifyDone();
+}
+
+window.addEventListener("load", runTest, false);
+</script>
+<div id="results"></div>
View
15 Source/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2012-08-14 Dean Jackson <dino@apple.com>
+
+ Initial call to webkitRequestAnimationFrame returns 0, Spec indicates the handle should always be > 0
+ https://bugs.webkit.org/show_bug.cgi?id=85819
+
+ Reviewed by James Robinson.
+
+ The callback id returned by requestAnimationFrame was beginning at zero, when the spec
+ says it should be above one. Use a pre-increment rather than a post-increment.
+
+ Test: fast/animation/request-animation-frame-callback-id.html
+
+ * dom/ScriptedAnimationController.cpp:
+ (WebCore::ScriptedAnimationController::registerCallback): Pre-increment rather than post-increment.
+
2012-08-14 Levi Weintraub <leviw@chromium.org>
r125591 broke tests with SUBPIXEL_LAYOUT disabled
View
2  Source/WebCore/dom/ScriptedAnimationController.cpp
@@ -83,7 +83,7 @@ void ScriptedAnimationController::resume()
ScriptedAnimationController::CallbackId ScriptedAnimationController::registerCallback(PassRefPtr<RequestAnimationFrameCallback> callback)
{
- ScriptedAnimationController::CallbackId id = m_nextCallbackId++;
+ ScriptedAnimationController::CallbackId id = ++m_nextCallbackId;
callback->m_firedOrCancelled = false;
callback->m_id = id;
m_callbacks.append(callback);
Please sign in to comment.
Something went wrong with that request. Please try again.