summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/ScriptedAnimationController.cpp
diff options
context:
space:
mode:
authorJames Simonsen <simonjam@chromium.org>2013-04-08 10:36:11 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-08 21:04:58 +0200
commit57992527bde37706ebfc4ed4940bc20a0784eb0c (patch)
tree1bf10bee5f2201c7a0eef60604cdafa64f896a2f /Source/WebCore/dom/ScriptedAnimationController.cpp
parent7e9bbda3e9bfbe90ca0b017ec1f8b1b1efd746c4 (diff)
downloadqtwebkit-57992527bde37706ebfc4ed4940bc20a0784eb0c.tar.gz
Restore old semantics to webkitRequestAnimationFrame callbacks
https://bugs.webkit.org/show_bug.cgi?id=106697 MERGE NOTE: Fixes regression from r131131, webkit bug #66683 Reviewed by James Robinson. Source/WebCore: Sites that use GWT <= 2.4 are buggy and rely on Date.now()-like callback values. We'll restore that behavior to the prefixed version of webkitRequestAnimationFrame. requestAnimationFrame will continue to follow the spec. Test: fast/animation/request-animation-frame-prefix.html * dom/RequestAnimationFrameCallback.h: (RequestAnimationFrameCallback): * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::serviceScriptedAnimations): * page/DOMWindow.cpp: (WebCore::DOMWindow::requestAnimationFrame): (WebCore): (WebCore::DOMWindow::webkitRequestAnimationFrame): * page/DOMWindow.h: (DOMWindow): * page/DOMWindow.idl: LayoutTests: * fast/animation/request-animation-frame-prefix-expected.txt: Added. * fast/animation/request-animation-frame-prefix.html: Added. * fast/animation/script-tests/request-animation-frame-prefix.js: Added. (busyWait): (window.webkitRequestAnimationFrame): Change-Id: Ibdd0b3aaa4154ad0861f3b95e0ab405ccffd0297 git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139509 268f45cc-cd09-0410-ab3c-d52691b4dbfc Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'Source/WebCore/dom/ScriptedAnimationController.cpp')
-rw-r--r--Source/WebCore/dom/ScriptedAnimationController.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/WebCore/dom/ScriptedAnimationController.cpp b/Source/WebCore/dom/ScriptedAnimationController.cpp
index 2f7862bdd..afa131b1a 100644
--- a/Source/WebCore/dom/ScriptedAnimationController.cpp
+++ b/Source/WebCore/dom/ScriptedAnimationController.cpp
@@ -114,6 +114,7 @@ void ScriptedAnimationController::serviceScriptedAnimations(double monotonicTime
return;
double highResNowMs = 1000.0 * m_document->loader()->timing()->monotonicTimeToZeroBasedDocumentTime(monotonicTimeNow);
+ double legacyHighResNowMs = 1000.0 * m_document->loader()->timing()->monotonicTimeToPseudoWallTime(monotonicTimeNow);
// First, generate a list of callbacks to consider. Callbacks registered from this point
// on are considered only for the "next" frame, not this one.
@@ -128,7 +129,10 @@ void ScriptedAnimationController::serviceScriptedAnimations(double monotonicTime
if (!callback->m_firedOrCancelled) {
callback->m_firedOrCancelled = true;
InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireAnimationFrame(m_document, callback->m_id);
- callback->handleEvent(highResNowMs);
+ if (callback->m_useLegacyTimeBase)
+ callback->handleEvent(legacyHighResNowMs);
+ else
+ callback->handleEvent(highResNowMs);
InspectorInstrumentation::didFireAnimationFrame(cookie);
}
}