⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 273656 in webkit


Ignore:
Timestamp:
Mar 1, 2021, 10:47:02 AM (6 years ago)
Author:
graouts@webkit.org
Message:

REGRESSION(r272004): transform transition with delay doesn't behave correctly
​https://bugs.webkit.org/show_bug.cgi?id=222545
<rdar://problem/74865413>

Reviewed by Dean Jackson.

Source/WebCore:

To support accelerated animations of individual transform properties, we introduced the notion of
non-interpolating animations to apply the underlying value for a given property before applying
the actual animations for this property with additivity set to true.

These non-interpolating animations were meant to last between the time at which animations were
committed and the effective start of the first animation for that property, accounting for any
delay.

However, we neglected to handle the case where that first animation had a fill mode that would
make it fill backwards, such as CSS Transitions. In that situation, the animation would have
its first keyframe applied on top of the underlying value, effectively applying the underlying
value twice with additivity.

We now only add these non-interpolating animations if the first animation has a delay and does
not fill backwards.

Test: webanimations/transform-transition-with-delay-on-forced-layer-with-transform.html

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::updateAnimations):

LayoutTests:

Add a new test where an element with a non-identity transform starts a transform transition with a
long delay. Prior to this patch, this test failed because, while in the delay phase, the transition
would mean the underlying transform was applied twice: once by the non-interpolating animation
generated for the underlying "transform" value, and once by the first keyframe of the transition
since it fills backwards.

  • webanimations/transform-transition-with-delay-on-forced-layer-with-transform-expected.html: Added.
  • webanimations/transform-transition-with-delay-on-forced-layer-with-transform.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r273648 r273656  
     12021-03-01  Antoine Quint  <graouts@webkit.org>
     2
     3        REGRESSION(r272004): transform transition with delay doesn't behave correctly
     4        https://bugs.webkit.org/show_bug.cgi?id=222545
     5        <rdar://problem/74865413>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Add a new test where an element with a non-identity transform starts a transform transition with a
     10        long delay. Prior to this patch, this test failed because, while in the delay phase, the transition
     11        would mean the underlying transform was applied twice: once by the non-interpolating animation
     12        generated for the underlying "transform" value, and once by the first keyframe of the transition
     13        since it fills backwards.
     14
     15        * webanimations/transform-transition-with-delay-on-forced-layer-with-transform-expected.html: Added.
     16        * webanimations/transform-transition-with-delay-on-forced-layer-with-transform.html: Added.
     17
    1182021-03-01  Chris Gambrell  <cgambrell@apple.com>
    219
  • trunk/Source/WebCore/ChangeLog

    r273655 r273656  
     12021-03-01  Antoine Quint  <graouts@webkit.org>
     2
     3        REGRESSION(r272004): transform transition with delay doesn't behave correctly
     4        https://bugs.webkit.org/show_bug.cgi?id=222545
     5        <rdar://problem/74865413>
     6
     7        Reviewed by Dean Jackson.
     8
     9        To support accelerated animations of individual transform properties, we introduced the notion of
     10        non-interpolating animations to apply the underlying value for a given property before applying
     11        the actual animations for this property with additivity set to true.
     12
     13        These non-interpolating animations were meant to last between the time at which animations were
     14        committed and the effective start of the first animation for that property, accounting for any
     15        delay.
     16
     17        However, we neglected to handle the case where that first animation had a fill mode that would
     18        make it fill backwards, such as CSS Transitions. In that situation, the animation would have
     19        its first keyframe applied on top of the underlying value, effectively applying the underlying
     20        value twice with additivity.
     21
     22        We now only add these non-interpolating animations if the first animation has a delay and does
     23        not fill backwards.
     24
     25        Test: webanimations/transform-transition-with-delay-on-forced-layer-with-transform.html
     26
     27        * platform/graphics/ca/GraphicsLayerCA.cpp:
     28        (WebCore::GraphicsLayerCA::updateAnimations):
     29
    1302021-03-01  Chris Dumez  <cdumez@apple.com>
    231
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r272303 r273656  
    30643064            }
    30653065
    3066             Seconds earliestBeginTime = 0_s;
     3066            LayerPropertyAnimation* earliestAnimation = nullptr;
    30673067            for (auto* animation : animations) {
    30683068                if (auto beginTime = animation->computedBeginTime()) {
    3069                     if (!earliestBeginTime || earliestBeginTime > *beginTime)
    3070                         earliestBeginTime = *beginTime;
     3069                    if (!earliestAnimation || *earliestAnimation->computedBeginTime() > *beginTime)
     3070                        earliestAnimation = animation;
    30713071                }
    30723072            }
    30733073
    3074             if (earliestBeginTime)
    3075                 earliestBeginTime += animationGroupBeginTime;
    3076 
    30773074            Vector<RefPtr<PlatformCAAnimation>> caAnimations;
    3078             if (earliestBeginTime > currentTime) {
    3079                 if (auto* baseValueTransformAnimation = makeBaseValueTransformAnimation(property, TransformationMatrixSource::AskClient, earliestBeginTime)) {
    3080                     prepareAnimationForAddition(*baseValueTransformAnimation);
    3081                     caAnimations.append(baseValueTransformAnimation->m_animation);
     3075
     3076            // If we have an animation with an explicit begin time that does not fill backwards and starts with a delay,
     3077            // we must create a non-interpolating animation to set the current value for this transform-related property
     3078            // until that animation begins.
     3079            if (earliestAnimation) {
     3080                auto fillMode = earliestAnimation->m_animation->fillMode();
     3081                if (fillMode != PlatformCAAnimation::Backwards && fillMode != PlatformCAAnimation::Both) {
     3082                    Seconds earliestBeginTime = *earliestAnimation->computedBeginTime() + animationGroupBeginTime;
     3083                    if (earliestBeginTime > currentTime) {
     3084                        if (auto* baseValueTransformAnimation = makeBaseValueTransformAnimation(property, TransformationMatrixSource::AskClient, earliestBeginTime)) {
     3085                            prepareAnimationForAddition(*baseValueTransformAnimation);
     3086                            caAnimations.append(baseValueTransformAnimation->m_animation);
     3087                        }
     3088                    }
    30823089                }
    30833090            }
    … …  
    31023109            }
    31033110
    3104             Seconds earliestBeginTime = 0_s;
     3111            LayerPropertyAnimation* earliestAnimation = nullptr;
    31053112            Vector<RefPtr<PlatformCAAnimation>> caAnimations;
    31063113            for (auto* animation : WTF::makeReversedRange(animations)) {
    31073114                if (auto beginTime = animation->computedBeginTime()) {
    3108                     if (!earliestBeginTime || earliestBeginTime > *beginTime)
    3109                         earliestBeginTime = *beginTime;
     3115                    if (!earliestAnimation || *earliestAnimation->computedBeginTime() > *beginTime)
     3116                        earliestAnimation = animation;
    31103117                }
    31113118                prepareAnimationForAddition(*animation);
    … …  
    31133120            }
    31143121
    3115             if (earliestBeginTime)
    3116                 earliestBeginTime += animationGroupBeginTime;
    3117 
    3118             if (earliestBeginTime > currentTime) {
    3119                 if (auto* baseValueTransformAnimation = makeBaseValueTransformAnimation(property, TransformationMatrixSource::AskClient, earliestBeginTime)) {
    3120                     prepareAnimationForAddition(*baseValueTransformAnimation);
    3121                     caAnimations.append(baseValueTransformAnimation->m_animation);
     3122            // If we have an animation with an explicit begin time that does not fill backwards and starts with a delay,
     3123            // we must create a non-interpolating animation to set the current value for this transform-related property
     3124            // until that animation begins.
     3125            if (earliestAnimation) {
     3126                auto fillMode = earliestAnimation->m_animation->fillMode();
     3127                if (fillMode != PlatformCAAnimation::Backwards && fillMode != PlatformCAAnimation::Both) {
     3128                    Seconds earliestBeginTime = *earliestAnimation->computedBeginTime() + animationGroupBeginTime;
     3129                    if (earliestBeginTime > currentTime) {
     3130                        if (auto* baseValueTransformAnimation = makeBaseValueTransformAnimation(property, TransformationMatrixSource::AskClient, earliestBeginTime)) {
     3131                            prepareAnimationForAddition(*baseValueTransformAnimation);
     3132                            caAnimations.append(baseValueTransformAnimation->m_animation);
     3133                        }
     3134                    }
    31223135                }
    31233136            }
Note: See TracChangeset for help on using the changeset viewer.