Title: [243374] trunk/Source/WebCore
Revision
243374
Author
[email protected]
Date
2019-03-22 06:46:56 -0700 (Fri, 22 Mar 2019)

Log Message

[Web Animations] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::WebAnimation::timeToNextTick const + 757
https://bugs.webkit.org/show_bug.cgi?id=196125
<rdar://problem/46520059>

Patch by Antoine Quint <[email protected]> on 2019-03-22
Reviewed by Dean Jackson.

Because of floating point math in playState() that wouldn't account for timeEpsilon, we would get into a state where the animation phase
was "after" but the play state was "running" when the current time was about a microsecond away from the active time boundary. This meant
that the early return statement in WebAnimation::timeToNextTick() would not be hit while we would not handle the possibility of being in
the "after" phase in the rest of the function, therefore eventually hitting the ASSERT_NOT_REACHED() at the end of the function.

We now account for timeEpsilon in playState() and correctly report we're in the "finished" play state when in the "after" phase also.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::playState const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (243373 => 243374)


--- trunk/Source/WebCore/ChangeLog	2019-03-22 12:56:32 UTC (rev 243373)
+++ trunk/Source/WebCore/ChangeLog	2019-03-22 13:46:56 UTC (rev 243374)
@@ -1,3 +1,21 @@
+2019-03-22  Antoine Quint  <[email protected]>
+
+        [Web Animations] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::WebAnimation::timeToNextTick const + 757
+        https://bugs.webkit.org/show_bug.cgi?id=196125
+        <rdar://problem/46520059>
+
+        Reviewed by Dean Jackson.
+
+        Because of floating point math in playState() that wouldn't account for timeEpsilon, we would get into a state where the animation phase
+        was "after" but the play state was "running" when the current time was about a microsecond away from the active time boundary. This meant
+        that the early return statement in WebAnimation::timeToNextTick() would not be hit while we would not handle the possibility of being in
+        the "after" phase in the rest of the function, therefore eventually hitting the ASSERT_NOT_REACHED() at the end of the function.
+
+        We now account for timeEpsilon in playState() and correctly report we're in the "finished" play state when in the "after" phase also.
+
+        * animation/WebAnimation.cpp:
+        (WebCore::WebAnimation::playState const):
+
 2019-03-22  Alicia Boya García  <[email protected]>
 
         [MSE][GStreamer] Don't construct segments on PlaybackPipeline::flush

Modified: trunk/Source/WebCore/animation/WebAnimation.cpp (243373 => 243374)


--- trunk/Source/WebCore/animation/WebAnimation.cpp	2019-03-22 12:56:32 UTC (rev 243373)
+++ trunk/Source/WebCore/animation/WebAnimation.cpp	2019-03-22 13:46:56 UTC (rev 243374)
@@ -528,7 +528,7 @@
     // animation's effective playback rate > 0 and current time ≥ target effect end; or
     // animation's effective playback rate < 0 and current time ≤ 0,
     // → finished
-    if (animationCurrentTime && ((effectivePlaybackRate() > 0 && animationCurrentTime.value() >= effectEndTime()) || (effectivePlaybackRate() < 0 && animationCurrentTime.value() <= 0_s)))
+    if (animationCurrentTime && ((effectivePlaybackRate() > 0 && (*animationCurrentTime + timeEpsilon) >= effectEndTime()) || (effectivePlaybackRate() < 0 && (*animationCurrentTime - timeEpsilon) <= 0_s)))
         return PlayState::Finished;
 
     // Otherwise → running
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to