From c12a83916aeb70ccc456a5f0b4a9734f17edfecd Mon Sep 17 00:00:00 2001 From: Dean Jackson Date: Wed, 15 Aug 2012 01:51:14 +0000 Subject: [PATCH] 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 --- LayoutTests/ChangeLog | 10 +++++++++ ...t-animation-frame-callback-id-expected.txt | 1 + .../request-animation-frame-callback-id.html | 22 +++++++++++++++++++ Source/WebCore/ChangeLog | 15 +++++++++++++ .../dom/ScriptedAnimationController.cpp | 2 +- 5 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 LayoutTests/fast/animation/request-animation-frame-callback-id-expected.txt create mode 100644 LayoutTests/fast/animation/request-animation-frame-callback-id.html diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 4820387479ca1..afd4eecb0f94e 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,13 @@ +2012-08-14 Dean Jackson + + 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 Handle the XPath / (root) operator correctly for nodes that aren't attached to the document. diff --git a/LayoutTests/fast/animation/request-animation-frame-callback-id-expected.txt b/LayoutTests/fast/animation/request-animation-frame-callback-id-expected.txt new file mode 100644 index 0000000000000..6f9df1c8a3ea6 --- /dev/null +++ b/LayoutTests/fast/animation/request-animation-frame-callback-id-expected.txt @@ -0,0 +1 @@ +PASSED: Callback id was > 0 diff --git a/LayoutTests/fast/animation/request-animation-frame-callback-id.html b/LayoutTests/fast/animation/request-animation-frame-callback-id.html new file mode 100644 index 0000000000000..8deed4cc701b6 --- /dev/null +++ b/LayoutTests/fast/animation/request-animation-frame-callback-id.html @@ -0,0 +1,22 @@ + +
\ No newline at end of file diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 97a7b5761d25e..b991e184bd539 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,18 @@ +2012-08-14 Dean Jackson + + 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 r125591 broke tests with SUBPIXEL_LAYOUT disabled diff --git a/Source/WebCore/dom/ScriptedAnimationController.cpp b/Source/WebCore/dom/ScriptedAnimationController.cpp index 974483dd4be20..628f1092b47cb 100644 --- a/Source/WebCore/dom/ScriptedAnimationController.cpp +++ b/Source/WebCore/dom/ScriptedAnimationController.cpp @@ -83,7 +83,7 @@ void ScriptedAnimationController::resume() ScriptedAnimationController::CallbackId ScriptedAnimationController::registerCallback(PassRefPtr callback) { - ScriptedAnimationController::CallbackId id = m_nextCallbackId++; + ScriptedAnimationController::CallbackId id = ++m_nextCallbackId; callback->m_firedOrCancelled = false; callback->m_id = id; m_callbacks.append(callback);