Title: [266526] trunk
Revision
266526
Author
grao...@webkit.org
Date
2020-09-03 09:31:05 -0700 (Thu, 03 Sep 2020)

Log Message

Consecutive requestAnimationFrame callbacks may be passed the same timestamp
https://bugs.webkit.org/show_bug.cgi?id=216122
<rdar://problem/68269445>

Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/animation/request-animation-frame-unique-timestamp.html

Ensure that the page only sees increasing timestamps in requestAnimationFrame() callbacks.

* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::shouldRescheduleRequestAnimationFrame const):

LayoutTests:

Add a test that two subsequent animation frames as identified via requestAnimationFrame() callbacks
are provided increasing timestamps.

Also removing flaky expectation for two WPT animations tests which pass reliably after this fix.

* fast/animation/request-animation-frame-unique-timestamp-expected.txt: Added.
* fast/animation/request-animation-frame-unique-timestamp.html: Added.
* platform/mac-wk2/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (266525 => 266526)


--- trunk/LayoutTests/ChangeLog	2020-09-03 16:28:55 UTC (rev 266525)
+++ trunk/LayoutTests/ChangeLog	2020-09-03 16:31:05 UTC (rev 266526)
@@ -1,3 +1,20 @@
+2020-09-03  Antoine Quint  <grao...@webkit.org>
+
+        Consecutive requestAnimationFrame callbacks may be passed the same timestamp
+        https://bugs.webkit.org/show_bug.cgi?id=216122
+        <rdar://problem/68269445>
+
+        Reviewed by Simon Fraser.
+
+        Add a test that two subsequent animation frames as identified via requestAnimationFrame() callbacks
+        are provided increasing timestamps.
+
+        Also removing flaky expectation for two WPT animations tests which pass reliably after this fix. 
+
+        * fast/animation/request-animation-frame-unique-timestamp-expected.txt: Added.
+        * fast/animation/request-animation-frame-unique-timestamp.html: Added.
+        * platform/mac-wk2/TestExpectations:
+
 2020-09-03  Hector Lopez  <hector_i_lo...@apple.com>
 
         REGRESSION(r266466): [ iOS wk2 ] fast/encoding/charset-replacement.html is a constant failure

Added: trunk/LayoutTests/fast/animation/request-animation-frame-unique-timestamp-expected.txt (0 => 266526)


--- trunk/LayoutTests/fast/animation/request-animation-frame-unique-timestamp-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/animation/request-animation-frame-unique-timestamp-expected.txt	2020-09-03 16:31:05 UTC (rev 266526)
@@ -0,0 +1,3 @@
+
+PASS Timestamps of requestAnimationFrame() callbacks increase. 
+

Added: trunk/LayoutTests/fast/animation/request-animation-frame-unique-timestamp.html (0 => 266526)


--- trunk/LayoutTests/fast/animation/request-animation-frame-unique-timestamp.html	                        (rev 0)
+++ trunk/LayoutTests/fast/animation/request-animation-frame-unique-timestamp.html	2020-09-03 16:31:05 UTC (rev 266526)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<script src=""
+<script>
+
+promise_test(async t => {
+	let firstFrameTimestamp = await new Promise(requestAnimationFrame);
+	let secondFrameTimestamp = await new Promise(requestAnimationFrame);
+	assert_greater_than(secondFrameTimestamp, firstFrameTimestamp);
+}, "Timestamps of requestAnimationFrame() callbacks increase.");
+
+</script>
+</body>
+</html>

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (266525 => 266526)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2020-09-03 16:28:55 UTC (rev 266525)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2020-09-03 16:31:05 UTC (rev 266526)
@@ -1251,9 +1251,6 @@
 [ arm64 ] inspector/canvas/memory.html [ Failure ]
 [ arm64 ] media/video-canvas-createPattern.html [ Failure ]
 
-# rdar://66798751 (REGRESSION (20A2321a-20A2327a): imported/w3c/web-platform-tests/css/css-animations/event-dispatch.tentative.html is a flaky failure)
-[ arm64 ] imported/w3c/web-platform-tests/css/css-animations/event-dispatch.tentative.html [ Pass Failure ]
-
 # rdar://66806059 (REGRESSION (20A2321a-20A2348b): 4 fast hidpi tests are a flaky image failure)
 [ arm64 ] fast/flexbox/hidpi-simple-line-layout-with-flexbox-and-transition.html [ ImageOnlyFailure ]
 [ arm64 ] fast/forms/hidpi-fieldset-on-subpixel-position-when-legend-is-present.html [ ImageOnlyFailure ]
@@ -1263,9 +1260,6 @@
 # rdar://66807554
 [ arm64 ] imported/w3c/web-platform-tests/css/css-transitions/transition-base-response-002.html  [ Failure ]
 
-# rdar://66808228 (REGRESSION (20A2321a-20A2348b): imported/w3c/web-platform-tests/web-animations/interfaces/Animation/onremove.html is a flaky failure)
-[ arm64 ] imported/w3c/web-platform-tests/web-animations/interfaces/Animation/onremove.html [ Failure ]
-
 webkit.org/b/215581 imported/w3c/web-platform-tests/webrtc/RTCRtpReceiver-getStats.https.html [ Pass Failure ]
 
 webkit.org/b/215606 webgpu/whlsl/do-while-loop-break.html [ Pass Failure ]

Modified: trunk/Source/WebCore/ChangeLog (266525 => 266526)


--- trunk/Source/WebCore/ChangeLog	2020-09-03 16:28:55 UTC (rev 266525)
+++ trunk/Source/WebCore/ChangeLog	2020-09-03 16:31:05 UTC (rev 266526)
@@ -1,3 +1,18 @@
+2020-09-03  Antoine Quint  <grao...@webkit.org>
+
+        Consecutive requestAnimationFrame callbacks may be passed the same timestamp
+        https://bugs.webkit.org/show_bug.cgi?id=216122
+        <rdar://problem/68269445>
+
+        Reviewed by Simon Fraser.
+
+        Test: fast/animation/request-animation-frame-unique-timestamp.html
+
+        Ensure that the page only sees increasing timestamps in requestAnimationFrame() callbacks.
+
+        * dom/ScriptedAnimationController.cpp:
+        (WebCore::ScriptedAnimationController::shouldRescheduleRequestAnimationFrame const):
+
 2020-09-03  Aditya Keerthi  <akeer...@apple.com>
 
         [macOS] Support stepping using keyboard in date inputs

Modified: trunk/Source/WebCore/dom/ScriptedAnimationController.cpp (266525 => 266526)


--- trunk/Source/WebCore/dom/ScriptedAnimationController.cpp	2020-09-03 16:28:55 UTC (rev 266525)
+++ trunk/Source/WebCore/dom/ScriptedAnimationController.cpp	2020-09-03 16:31:05 UTC (rev 266526)
@@ -98,7 +98,7 @@
 
 bool ScriptedAnimationController::shouldRescheduleRequestAnimationFrame(ReducedResolutionSeconds timestamp) const
 {
-    return isThrottledRelativeToPage() && (timestamp - m_lastAnimationFrameTimestamp < preferredScriptedAnimationInterval());
+    return timestamp <= m_lastAnimationFrameTimestamp || (isThrottledRelativeToPage() && (timestamp - m_lastAnimationFrameTimestamp < preferredScriptedAnimationInterval()));
 }
 
 ScriptedAnimationController::CallbackId ScriptedAnimationController::registerCallback(Ref<RequestAnimationFrameCallback>&& callback)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to