Changeset 252951 in webkit


Ignore:
Timestamp:
Nov 29, 2019 2:17:00 PM (4 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r252944.
https://bugs.webkit.org/show_bug.cgi?id=204709

Broke Windows Build (Requested by aakashja_ on #webkit).

Reverted changeset:

"[Web Animations] Forward-filling animations should not
schedule updates while filling"
https://bugs.webkit.org/show_bug.cgi?id=204697
https://trac.webkit.org/changeset/252944

Location:
trunk
Files:
4 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r252944 r252951  
     12019-11-29  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r252944.
     4        https://bugs.webkit.org/show_bug.cgi?id=204709
     5
     6        Broke Windows Build (Requested by aakashja_ on #webkit).
     7
     8        Reverted changeset:
     9
     10        "[Web Animations] Forward-filling animations should not
     11        schedule updates while filling"
     12        https://bugs.webkit.org/show_bug.cgi?id=204697
     13        https://trac.webkit.org/changeset/252944
     14
    1152019-11-29  Antoine Quint  <graouts@apple.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r252950 r252951  
     12019-11-29  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r252944.
     4        https://bugs.webkit.org/show_bug.cgi?id=204709
     5
     6        Broke Windows Build (Requested by aakashja_ on #webkit).
     7
     8        Reverted changeset:
     9
     10        "[Web Animations] Forward-filling animations should not
     11        schedule updates while filling"
     12        https://bugs.webkit.org/show_bug.cgi?id=204697
     13        https://trac.webkit.org/changeset/252944
     14
    1152019-11-29  Charlie Turner  <cturner@igalia.com>
    216
  • trunk/Source/WebCore/animation/DocumentTimeline.cpp

    r252944 r252951  
    351351        return;
    352352
    353     // Updating animations and sending events may invalidate the timing of some animations, so we must set the m_animationResolutionScheduled
    354     // flag to false prior to running that procedure to allow animation with timing model updates to schedule updates.
    355     m_animationResolutionScheduled = false;
    356 
    357353    internalUpdateAnimationsAndSendEvents();
    358354    applyPendingAcceleratedAnimations();
    359355
    360     if (!m_animationResolutionScheduled)
    361         scheduleNextTick();
     356    m_animationResolutionScheduled = false;
     357    scheduleNextTick();
    362358}
    363359
     
    534530        return;
    535531
     532    for (const auto& animation : m_animations) {
     533        if (!animation->isRunningAccelerated()) {
     534            scheduleAnimationResolution();
     535            return;
     536        }
     537    }
     538
    536539    Seconds scheduleDelay = Seconds::infinity();
    537540
  • trunk/Source/WebCore/animation/KeyframeEffect.cpp

    r252944 r252951  
    664664ExceptionOr<void> KeyframeEffect::setKeyframes(JSGlobalObject& lexicalGlobalObject, Strong<JSObject>&& keyframesInput)
    665665{
    666     auto processKeyframesResult = processKeyframes(lexicalGlobalObject, WTFMove(keyframesInput));
    667     if (!processKeyframesResult.hasException() && animation())
    668         animation()->effectTimingDidChange();
    669     return processKeyframesResult;
     666    return processKeyframes(lexicalGlobalObject, WTFMove(keyframesInput));
    670667}
    671668
     
    13461343void KeyframeEffect::addPendingAcceleratedAction(AcceleratedAction action)
    13471344{
    1348     if (action == m_lastRecordedAcceleratedAction)
    1349         return;
    1350 
    13511345    if (action == AcceleratedAction::Stop)
    13521346        m_pendingAcceleratedActions.clear();
     
    13881382
    13891383    auto* renderer = this->renderer();
    1390     if (!renderer || !renderer->isComposited()) {
    1391         // The renderer may no longer be composited because the accelerated animation ended before we had a chance to update it,
    1392         // in which case if we asked for the animation to stop, we can discard the current set of accelerated actions.
    1393         if (m_lastRecordedAcceleratedAction == AcceleratedAction::Stop)
    1394             m_pendingAcceleratedActions.clear();
    1395         return;
    1396     }
     1384    if (!renderer || !renderer->isComposited())
     1385        return;
    13971386
    13981387    auto pendingAcceleratedActions = m_pendingAcceleratedActions;
  • trunk/Source/WebCore/animation/WebAnimation.cpp

    r252944 r252951  
    718718}
    719719
    720 void WebAnimation::timingDidChange(DidSeek didSeek, SynchronouslyNotify synchronouslyNotify, Silently silently)
     720void WebAnimation::timingDidChange(DidSeek didSeek, SynchronouslyNotify synchronouslyNotify)
    721721{
    722722    m_shouldSkipUpdatingFinishedStateWhenResolving = false;
     
    728728    }
    729729
    730     if (silently == Silently::No && m_timeline)
     730    if (m_timeline)
    731731        m_timeline->animationTimingDidChange(*this);
    732732};
     
    980980
    981981    // 5. Run the procedure to update an animation's finished state for animation with the did seek flag set to false, and the synchronously notify flag set to false.
    982     timingDidChange(DidSeek::No, SynchronouslyNotify::No, Silently::Yes);
     982    timingDidChange(DidSeek::No, SynchronouslyNotify::No);
    983983
    984984    invalidateEffect();
     
    11061106    // 6. Run the procedure to update an animation's finished state for animation with the did seek flag set to false, and the
    11071107    //    synchronously notify flag set to false.
    1108     timingDidChange(DidSeek::No, SynchronouslyNotify::No, Silently::Yes);
     1108    timingDidChange(DidSeek::No, SynchronouslyNotify::No);
    11091109
    11101110    invalidateEffect();
     
    12901290Seconds WebAnimation::timeToNextTick() const
    12911291{
    1292     // Any animation that is pending needs immediate resolution.
     1292    ASSERT(isRunningAccelerated());
     1293
    12931294    if (pending())
    12941295        return 0_s;
    12951296
    1296     // If we're not running, or time is not advancing for this animation, there's no telling when we'll end.
    1297     auto playbackRate = effectivePlaybackRate();
    1298     if (playState() != PlayState::Running || !playbackRate)
     1297    // If we're not running, there's no telling when we'll end.
     1298    if (playState() != PlayState::Running)
    12991299        return Seconds::infinity();
    13001300
    1301     auto& effect = *this->effect();
    1302     auto timing = effect.getBasicTiming();
    1303     switch (timing.phase) {
    1304     case AnimationEffectPhase::Before:
    1305         // The animation is in its "before" phase, in this case we can wait until it enters its "active" phase.
    1306         return (effect.delay() - timing.localTime.value()) / playbackRate;
    1307     case AnimationEffectPhase::Active:
    1308         // Non-accelerated animations in the "active" phase will need to update their animated value at the immediate next opportunity.
    1309         if (!isRunningAccelerated())
    1310             return 0_s;
    1311         // Accelerated CSS Animations need to trigger "animationiteration" events, in this case we can wait until the next iteration.
    1312         if (isCSSAnimation()) {
    1313             if (auto iterationProgress = effect.getComputedTiming().simpleIterationProgress)
    1314                 return effect.iterationDuration() * (1 - *iterationProgress);
     1301    // CSS Animations dispatch events for each iteration, so compute the time until
     1302    // the end of this iteration. Any other animation only cares about remaning total time.
     1303    if (isCSSAnimation()) {
     1304        auto* animationEffect = effect();
     1305        auto timing = animationEffect->getComputedTiming();
     1306        // If we're actively running, we need the time until the next iteration.
     1307        if (auto iterationProgress = timing.simpleIterationProgress)
     1308            return animationEffect->iterationDuration() * (1 - *iterationProgress);
     1309
     1310        // Otherwise we're probably in the before phase waiting to reach our start time.
     1311        if (auto animationCurrentTime = currentTime()) {
     1312            // If our current time is negative, we need to be scheduled to be resolved at the inverse
     1313            // of our current time, unless we fill backwards, in which case we want to invalidate as
     1314            // soon as possible.
     1315            auto localTime = animationCurrentTime.value();
     1316            if (localTime < 0_s)
     1317                return -localTime;
     1318            if (localTime < animationEffect->delay())
     1319                return animationEffect->delay() - localTime;
    13151320        }
    1316         // Accelerated animations in the "active" phase can wait until they ended.
    1317         return (effect.endTime() - timing.localTime.value()) / playbackRate;
    1318     case AnimationEffectPhase::After:
    1319         // The animation is in its after phase, which means it will no longer update its value, so it doens't need a tick.
    1320         return Seconds::infinity();
    1321     case AnimationEffectPhase::Idle:
    1322         ASSERT_NOT_REACHED();
    1323         return Seconds::infinity();
    1324     }
     1321    } else if (auto animationCurrentTime = currentTime())
     1322        return effect()->endTime() - *animationCurrentTime;
     1323
     1324    ASSERT_NOT_REACHED();
     1325    return Seconds::infinity();
    13251326}
    13261327
  • trunk/Source/WebCore/animation/WebAnimation.h

    r252944 r252951  
    155155    enum class TimeToRunPendingTask : uint8_t { NotScheduled, ASAP, WhenReady };
    156156
    157     void timingDidChange(DidSeek, SynchronouslyNotify, Silently = Silently::No);
     157    void timingDidChange(DidSeek, SynchronouslyNotify);
    158158    void updateFinishedState(DidSeek, SynchronouslyNotify);
    159159    Seconds effectEndTime() const;
Note: See TracChangeset for help on using the changeset viewer.