Changeset 252527 in webkit


Ignore:
Timestamp:
Nov 16, 2019 9:11:44 AM (4 years ago)
Author:
Philippe Normand
Message:

Unreviewed, rolling out r252526.

broke iOS and mac builds

Reverted changeset:

"Unreviewed, rolling out r252455."
https://bugs.webkit.org/show_bug.cgi?id=204272
https://trac.webkit.org/changeset/252526

Location:
trunk
Files:
5 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r252526 r252527  
     12019-11-16  Philippe Normand  <pnormand@igalia.com>
     2
     3        Unreviewed, rolling out r252526.
     4
     5        broke iOS and mac builds
     6
     7        Reverted changeset:
     8
     9        "Unreviewed, rolling out r252455."
     10        https://bugs.webkit.org/show_bug.cgi?id=204272
     11        https://trac.webkit.org/changeset/252526
     12
    1132019-11-16  Commit Queue  <commit-queue@webkit.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r252526 r252527  
     12019-11-16  Philippe Normand  <pnormand@igalia.com>
     2
     3        Unreviewed, rolling out r252526.
     4
     5        broke iOS and mac builds
     6
     7        Reverted changeset:
     8
     9        "Unreviewed, rolling out r252455."
     10        https://bugs.webkit.org/show_bug.cgi?id=204272
     11        https://trac.webkit.org/changeset/252526
     12
    1132019-11-16  Commit Queue  <commit-queue@webkit.org>
    214
  • trunk/Source/WebCore/animation/AnimationEffect.h

    r252526 r252527  
    6262    virtual void invalidate() = 0;
    6363    virtual void animationDidSeek() = 0;
     64    virtual void animationWasCanceled() = 0;
    6465    virtual void animationSuspensionStateDidChange(bool) = 0;
    6566    virtual void animationTimelineDidChange(AnimationTimeline*) = 0;
  • trunk/Source/WebCore/animation/AnimationTimeline.cpp

    r252526 r252527  
    400400    // Define the before-change style as the computed values of all properties on the element as of the previous style change event, except with
    401401    // any styles derived from declarative animations such as CSS Transitions, CSS Animations, and SMIL Animations updated to the current time.
    402     auto existingAnimation = cssAnimationForElementAndProperty(element, property);
    403     const auto& beforeChangeStyle = existingAnimation ? downcast<CSSAnimation>(existingAnimation.get())->unanimatedStyle() : currentStyle;
    404 
    405     if (!runningTransitionsByProperty.contains(property)
     402    bool hasRunningTransition = runningTransitionsByProperty.contains(property);
     403    auto& beforeChangeStyle = [&]() -> const RenderStyle& {
     404        if (hasRunningTransition && CSSPropertyAnimation::animationOfPropertyIsAccelerated(property)) {
     405            // In case we have an accelerated transition running for this element, we need to get its computed style as the before-change style
     406            // since otherwise the animated value for that property won't be visible.
     407            auto* runningTransition = runningTransitionsByProperty.get(property);
     408            if (is<KeyframeEffect>(runningTransition->effect())) {
     409                auto& keyframeEffect = *downcast<KeyframeEffect>(runningTransition->effect());
     410                if (keyframeEffect.isAccelerated()) {
     411                    auto animatedStyle = RenderStyle::clonePtr(currentStyle);
     412                    runningTransition->resolve(*animatedStyle);
     413                    return *animatedStyle;
     414                }
     415            }
     416        }
     417
     418        if (auto existingAnimation = cssAnimationForElementAndProperty(element, property))
     419            return downcast<CSSAnimation>(existingAnimation.get())->unanimatedStyle();
     420
     421        return currentStyle;
     422    }();
     423
     424    if (!hasRunningTransition
    406425        && !CSSPropertyAnimation::propertiesEqual(property, &beforeChangeStyle, &afterChangeStyle)
    407426        && CSSPropertyAnimation::canPropertyBeInterpolated(property, &beforeChangeStyle, &afterChangeStyle)
     
    436455    }
    437456
    438     bool hasRunningTransition = runningTransitionsByProperty.contains(property);
     457    hasRunningTransition = runningTransitionsByProperty.contains(property);
    439458    if ((hasRunningTransition || completedTransitionsByProperty.contains(property)) && !matchingBackingAnimation) {
    440459        // 3. If the element has a running transition or completed transition for the property, and there is not a matching transition-property
  • trunk/Source/WebCore/animation/DocumentTimeline.cpp

    r252526 r252527  
    308308    AnimationTimeline::removeAnimation(animation);
    309309
    310     if (m_animations.isEmpty())
     310    if (!shouldRunUpdateAnimationsAndSendEventsIgnoringSuspensionState())
    311311        unscheduleAnimationResolution();
    312312}
     
    314314void DocumentTimeline::scheduleAnimationResolution()
    315315{
    316     if (m_isSuspended || m_animations.isEmpty() || m_animationResolutionScheduled)
     316    if (m_isSuspended || m_animationResolutionScheduled || !shouldRunUpdateAnimationsAndSendEventsIgnoringSuspensionState())
    317317        return;
    318318
     
    330330}
    331331
     332bool DocumentTimeline::shouldRunUpdateAnimationsAndSendEventsIgnoringSuspensionState() const
     333{
     334    return !m_animations.isEmpty() || !m_acceleratedAnimationsPendingRunningStateChange.isEmpty();
     335}
     336
    332337void DocumentTimeline::updateAnimationsAndSendEvents(DOMHighResTimeStamp timestamp)
    333338{
     
    338343        cacheCurrentTime(timestamp);
    339344
    340     if (m_isSuspended || m_animations.isEmpty() || !m_animationResolutionScheduled)
     345    if (m_isSuspended || !m_animationResolutionScheduled || !shouldRunUpdateAnimationsAndSendEventsIgnoringSuspensionState())
    341346        return;
    342347
  • trunk/Source/WebCore/animation/DocumentTimeline.h

    r252526 r252527  
    100100    void removeReplacedAnimations();
    101101    bool animationCanBeRemoved(WebAnimation&);
     102    bool shouldRunUpdateAnimationsAndSendEventsIgnoringSuspensionState() const;
    102103
    103104    Timer m_tickScheduleTimer;
  • trunk/Source/WebCore/animation/KeyframeEffect.cpp

    r252526 r252527  
    13351335}
    13361336
     1337void KeyframeEffect::animationWasCanceled()
     1338{
     1339    if (m_shouldRunAccelerated && isRunningAccelerated())
     1340        addPendingAcceleratedAction(AcceleratedAction::Stop);
     1341}
     1342
    13371343void KeyframeEffect::animationSuspensionStateDidChange(bool animationIsSuspended)
    13381344{
  • trunk/Source/WebCore/animation/KeyframeEffect.h

    r252526 r252527  
    114114    void invalidate() override;
    115115    void animationDidSeek() final;
     116    void animationWasCanceled() final;
    116117    void animationSuspensionStateDidChange(bool) final;
    117118    void animationTimelineDidChange(AnimationTimeline*) final;
  • trunk/Source/WebCore/animation/WebAnimation.cpp

    r252526 r252527  
    615615
    616616    invalidateEffect();
     617
     618    if (m_effect)
     619        m_effect->animationWasCanceled();
    617620}
    618621
Note: See TracChangeset for help on using the changeset viewer.