summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>2011-09-26 07:21:45 (GMT)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>2011-09-26 07:21:45 (GMT)
commitf0909a46fa167c84062c63caffef340a6054bc1e (patch)
tree52d6b171d275281f7ce72fe6acdb470969bbaeb4
parent3e0846622e345f4cfcf884f4d631a49ac313244e (diff)
[mac] Timestamp parameter to requestAnimationFrame is busted in USE(REQUEST_ANIMATION_FRAME_TIMER) path
https://bugs.webkit.org/show_bug.cgi?id=68769 Patch by James Robinson <jamesr@chromium.org> on 2011-09-26 Reviewed by Simon Fraser. Source/WebCore: Convert the time parameter from double to DOMTimeStamp using convertSecondsToDOMTimeStamp rather than relying on implicit double->long conversion, which ignores the units of the value. Test: fast/animation/request-animation-frame-timestamps-advance.html * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::animationTimerFired): LayoutTests: Adds a test that the timestamp parameter to the requestAnimationFrame callback advances between calls. * fast/animation/request-animation-frame-timestamps-advance-expected.txt: Added. * fast/animation/request-animation-frame-timestamps-advance.html: Added. * fast/animation/script-tests/request-animation-frame-timestamps-advance.js: Copied from LayoutTests/fast/animation/script-tests/request-animation-frame-timestamps.js. (busyWait): (window.webkitRequestAnimationFrame): * fast/animation/script-tests/request-animation-frame-timestamps.js: Remove the element parameter, they aren't a useful part of the test. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95937 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-rw-r--r--LayoutTests/ChangeLog17
-rw-r--r--LayoutTests/fast/animation/request-animation-frame-timestamps-advance-expected.txt12
-rw-r--r--LayoutTests/fast/animation/request-animation-frame-timestamps-advance.html15
-rw-r--r--LayoutTests/fast/animation/script-tests/request-animation-frame-timestamps-advance.js37
-rw-r--r--LayoutTests/fast/animation/script-tests/request-animation-frame-timestamps.js5
-rw-r--r--Source/WebCore/ChangeLog15
-rw-r--r--Source/WebCore/dom/ScriptedAnimationController.cpp2
7 files changed, 99 insertions, 4 deletions
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 6a80e54..c28e723 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2011-09-26 James Robinson <jamesr@chromium.org>
+
+ [mac] Timestamp parameter to requestAnimationFrame is busted in USE(REQUEST_ANIMATION_FRAME_TIMER) path
+ https://bugs.webkit.org/show_bug.cgi?id=68769
+
+ Reviewed by Simon Fraser.
+
+ Adds a test that the timestamp parameter to the requestAnimationFrame callback advances between calls.
+
+ * fast/animation/request-animation-frame-timestamps-advance-expected.txt: Added.
+ * fast/animation/request-animation-frame-timestamps-advance.html: Added.
+ * fast/animation/script-tests/request-animation-frame-timestamps-advance.js: Copied from LayoutTests/fast/animation/script-tests/request-animation-frame-timestamps.js.
+ (busyWait):
+ (window.webkitRequestAnimationFrame):
+ * fast/animation/script-tests/request-animation-frame-timestamps.js:
+ Remove the element parameter, they aren't a useful part of the test.
+
2011-09-25 Kentaro Hara <haraken@chromium.org>
Implement a CloseEvent constructor for JSC
diff --git a/LayoutTests/fast/animation/request-animation-frame-timestamps-advance-expected.txt b/LayoutTests/fast/animation/request-animation-frame-timestamps-advance-expected.txt
new file mode 100644
index 0000000..dda6e5a
--- /dev/null
+++ b/LayoutTests/fast/animation/request-animation-frame-timestamps-advance-expected.txt
@@ -0,0 +1,12 @@
+Tests the timestamps provided to requestAnimationFrame callbacks advance
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS firstTimestamp is defined.
+PASS secondTimestamp is defined.
+PASS secondTimestamp > firstTimestamp is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/animation/request-animation-frame-timestamps-advance.html b/LayoutTests/fast/animation/request-animation-frame-timestamps-advance.html
new file mode 100644
index 0000000..b66b511
--- /dev/null
+++ b/LayoutTests/fast/animation/request-animation-frame-timestamps-advance.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<span id="e"></span>
+<span id="f"></span>
+<script src="script-tests/request-animation-frame-timestamps-advance.js"></script>
+<script src="../js/resources/js-test-post-function.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/animation/script-tests/request-animation-frame-timestamps-advance.js b/LayoutTests/fast/animation/script-tests/request-animation-frame-timestamps-advance.js
new file mode 100644
index 0000000..52d9b90
--- /dev/null
+++ b/LayoutTests/fast/animation/script-tests/request-animation-frame-timestamps-advance.js
@@ -0,0 +1,37 @@
+description("Tests the timestamps provided to requestAnimationFrame callbacks advance");
+
+function busyWait(millis) {
+ var start = Date.now();
+ while (Date.now()-start < millis) {}
+}
+
+var firstTimestamp = undefined;
+var secondTimestamp = undefined;
+
+window.webkitRequestAnimationFrame(function(timestamp) {
+ firstTimestamp = timestamp;
+ shouldBeDefined("firstTimestamp");
+ window.webkitRequestAnimationFrame(function(timestamp) {
+ secondTimestamp = timestamp;
+ shouldBeDefined("secondTimestamp");
+ shouldBeTrue("secondTimestamp > firstTimestamp");
+ isSuccessfullyParsed();
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ });
+ busyWait(10);
+ if (window.layoutTestController)
+ layoutTestController.display();
+});
+
+
+if (window.layoutTestController)
+ window.setTimeout(function() {
+ layoutTestController.display();
+ });
+
+
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/animation/script-tests/request-animation-frame-timestamps.js b/LayoutTests/fast/animation/script-tests/request-animation-frame-timestamps.js
index 82f98a8..bbbd5e9 100644
--- a/LayoutTests/fast/animation/script-tests/request-animation-frame-timestamps.js
+++ b/LayoutTests/fast/animation/script-tests/request-animation-frame-timestamps.js
@@ -5,21 +5,20 @@ function busyWait(millis) {
while (Date.now()-start < millis) {}
}
-var e = document.getElementById("e");
var firstTimestamp = undefined;
window.webkitRequestAnimationFrame(function(timestamp) {
firstTimestamp = timestamp;
shouldBeDefined("firstTimestamp");
busyWait(10);
-}, e);
+});
var secondTimestamp = undefined;
window.webkitRequestAnimationFrame(function(timestamp) {
secondTimestamp = timestamp;
shouldBeDefined("secondTimestamp");
shouldBe("firstTimestamp", "secondTimestamp");
-}, e);
+});
if (window.layoutTestController)
layoutTestController.display();
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index ffdf452..f759c8e 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2011-09-26 James Robinson <jamesr@chromium.org>
+
+ [mac] Timestamp parameter to requestAnimationFrame is busted in USE(REQUEST_ANIMATION_FRAME_TIMER) path
+ https://bugs.webkit.org/show_bug.cgi?id=68769
+
+ Reviewed by Simon Fraser.
+
+ Convert the time parameter from double to DOMTimeStamp using convertSecondsToDOMTimeStamp rather than relying on
+ implicit double->long conversion, which ignores the units of the value.
+
+ Test: fast/animation/request-animation-frame-timestamps-advance.html
+
+ * dom/ScriptedAnimationController.cpp:
+ (WebCore::ScriptedAnimationController::animationTimerFired):
+
2011-09-25 Mark Hahnenberg <mhahnenberg@apple.com>
Add custom vtable struct to ClassInfo struct
diff --git a/Source/WebCore/dom/ScriptedAnimationController.cpp b/Source/WebCore/dom/ScriptedAnimationController.cpp
index 96cde8a..6ecf47b 100644
--- a/Source/WebCore/dom/ScriptedAnimationController.cpp
+++ b/Source/WebCore/dom/ScriptedAnimationController.cpp
@@ -161,7 +161,7 @@ void ScriptedAnimationController::scheduleAnimation()
void ScriptedAnimationController::animationTimerFired(Timer<ScriptedAnimationController>*)
{
m_lastAnimationFrameTime = currentTime();
- serviceScriptedAnimations(m_lastAnimationFrameTime);
+ serviceScriptedAnimations(convertSecondsToDOMTimeStamp(m_lastAnimationFrameTime));
}
#endif