Changeset 243374 in webkit


Ignore:
Timestamp:
Mar 22, 2019 6:46:56 AM (5 years ago)
Author:
commit-queue@webkit.org
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 <Antoine Quint> 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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r243372 r243374  
     12019-03-22  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::WebAnimation::timeToNextTick const + 757
     4        https://bugs.webkit.org/show_bug.cgi?id=196125
     5        <rdar://problem/46520059>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Because of floating point math in playState() that wouldn't account for timeEpsilon, we would get into a state where the animation phase
     10        was "after" but the play state was "running" when the current time was about a microsecond away from the active time boundary. This meant
     11        that the early return statement in WebAnimation::timeToNextTick() would not be hit while we would not handle the possibility of being in
     12        the "after" phase in the rest of the function, therefore eventually hitting the ASSERT_NOT_REACHED() at the end of the function.
     13
     14        We now account for timeEpsilon in playState() and correctly report we're in the "finished" play state when in the "after" phase also.
     15
     16        * animation/WebAnimation.cpp:
     17        (WebCore::WebAnimation::playState const):
     18
    1192019-03-22  Alicia Boya García  <aboya@igalia.com>
    220
  • trunk/Source/WebCore/animation/WebAnimation.cpp

    r243346 r243374  
    529529    // animation's effective playback rate < 0 and current time ≤ 0,
    530530    // → finished
    531     if (animationCurrentTime && ((effectivePlaybackRate() > 0 && animationCurrentTime.value() >= effectEndTime()) || (effectivePlaybackRate() < 0 && animationCurrentTime.value() <= 0_s)))
     531    if (animationCurrentTime && ((effectivePlaybackRate() > 0 && (*animationCurrentTime + timeEpsilon) >= effectEndTime()) || (effectivePlaybackRate() < 0 && (*animationCurrentTime - timeEpsilon) <= 0_s)))
    532532        return PlayState::Finished;
    533533
Note: See TracChangeset for help on using the changeset viewer.