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

Changeset 273802 in webkit


Ignore:
Timestamp:
Mar 2, 2021, 7:09:20 PM (6 years ago)
Author:
Alan Coon
Message:

Cherry-pick r273656. rdar://problem/74952887

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.

git-svn-id: ​https://svn.webkit.org/repository/webkit/trunk@273656 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-612.1.5-branch
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-612.1.5-branch/LayoutTests/ChangeLog

    r273799 r273802  
     12021-03-02  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r273656. rdar://problem/74952887
     4
     5    REGRESSION(r272004): transform transition with delay doesn't behave correctly
     6    https://bugs.webkit.org/show_bug.cgi?id=222545
     7    <rdar://problem/74865413>
     8   
     9    Reviewed by Dean Jackson.
     10   
     11    Source/WebCore:
     12   
     13    To support accelerated animations of individual transform properties, we introduced the notion of
     14    non-interpolating animations to apply the underlying value for a given property before applying
     15    the actual animations for this property with additivity set to true.
     16   
     17    These non-interpolating animations were meant to last between the time at which animations were
     18    committed and the effective start of the first animation for that property, accounting for any
     19    delay.
     20   
     21    However, we neglected to handle the case where that first animation had a fill mode that would
     22    make it fill backwards, such as CSS Transitions. In that situation, the animation would have
     23    its first keyframe applied on top of the underlying value, effectively applying the underlying
     24    value twice with additivity.
     25   
     26    We now only add these non-interpolating animations if the first animation has a delay and does
     27    not fill backwards.
     28   
     29    Test: webanimations/transform-transition-with-delay-on-forced-layer-with-transform.html
     30   
     31    * platform/graphics/ca/GraphicsLayerCA.cpp:
     32    (WebCore::GraphicsLayerCA::updateAnimations):
     33   
     34    LayoutTests:
     35   
     36    Add a new test where an element with a non-identity transform starts a transform transition with a
     37    long delay. Prior to this patch, this test failed because, while in the delay phase, the transition
     38    would mean the underlying transform was applied twice: once by the non-interpolating animation
     39    generated for the underlying "transform" value, and once by the first keyframe of the transition
     40    since it fills backwards.
     41   
     42    * webanimations/transform-transition-with-delay-on-forced-layer-with-transform-expected.html: Added.
     43    * webanimations/transform-transition-with-delay-on-forced-layer-with-transform.html: Added.
     44   
     45    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273656 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     46
     47    2021-03-01  Antoine Quint  <graouts@webkit.org>
     48
     49            REGRESSION(r272004): transform transition with delay doesn't behave correctly
     50            https://bugs.webkit.org/show_bug.cgi?id=222545
     51            <rdar://problem/74865413>
     52
     53            Reviewed by Dean Jackson.
     54
     55            Add a new test where an element with a non-identity transform starts a transform transition with a
     56            long delay. Prior to this patch, this test failed because, while in the delay phase, the transition
     57            would mean the underlying transform was applied twice: once by the non-interpolating animation
     58            generated for the underlying "transform" value, and once by the first keyframe of the transition
     59            since it fills backwards.
     60
     61            * webanimations/transform-transition-with-delay-on-forced-layer-with-transform-expected.html: Added.
     62            * webanimations/transform-transition-with-delay-on-forced-layer-with-transform.html: Added.
     63
    1642021-03-02  Alan Coon  <alancoon@apple.com>
    265
  • branches/safari-612.1.5-branch/Source/WebCore/ChangeLog

    r273801 r273802  
     12021-03-02  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r273656. rdar://problem/74952887
     4
     5    REGRESSION(r272004): transform transition with delay doesn't behave correctly
     6    https://bugs.webkit.org/show_bug.cgi?id=222545
     7    <rdar://problem/74865413>
     8   
     9    Reviewed by Dean Jackson.
     10   
     11    Source/WebCore:
     12   
     13    To support accelerated animations of individual transform properties, we introduced the notion of
     14    non-interpolating animations to apply the underlying value for a given property before applying
     15    the actual animations for this property with additivity set to true.
     16   
     17    These non-interpolating animations were meant to last between the time at which animations were
     18    committed and the effective start of the first animation for that property, accounting for any
     19    delay.
     20   
     21    However, we neglected to handle the case where that first animation had a fill mode that would
     22    make it fill backwards, such as CSS Transitions. In that situation, the animation would have
     23    its first keyframe applied on top of the underlying value, effectively applying the underlying
     24    value twice with additivity.
     25   
     26    We now only add these non-interpolating animations if the first animation has a delay and does
     27    not fill backwards.
     28   
     29    Test: webanimations/transform-transition-with-delay-on-forced-layer-with-transform.html
     30   
     31    * platform/graphics/ca/GraphicsLayerCA.cpp:
     32    (WebCore::GraphicsLayerCA::updateAnimations):
     33   
     34    LayoutTests:
     35   
     36    Add a new test where an element with a non-identity transform starts a transform transition with a
     37    long delay. Prior to this patch, this test failed because, while in the delay phase, the transition
     38    would mean the underlying transform was applied twice: once by the non-interpolating animation
     39    generated for the underlying "transform" value, and once by the first keyframe of the transition
     40    since it fills backwards.
     41   
     42    * webanimations/transform-transition-with-delay-on-forced-layer-with-transform-expected.html: Added.
     43    * webanimations/transform-transition-with-delay-on-forced-layer-with-transform.html: Added.
     44   
     45    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273656 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     46
     47    2021-03-01  Antoine Quint  <graouts@webkit.org>
     48
     49            REGRESSION(r272004): transform transition with delay doesn't behave correctly
     50            https://bugs.webkit.org/show_bug.cgi?id=222545
     51            <rdar://problem/74865413>
     52
     53            Reviewed by Dean Jackson.
     54
     55            To support accelerated animations of individual transform properties, we introduced the notion of
     56            non-interpolating animations to apply the underlying value for a given property before applying
     57            the actual animations for this property with additivity set to true.
     58
     59            These non-interpolating animations were meant to last between the time at which animations were
     60            committed and the effective start of the first animation for that property, accounting for any
     61            delay.
     62
     63            However, we neglected to handle the case where that first animation had a fill mode that would
     64            make it fill backwards, such as CSS Transitions. In that situation, the animation would have
     65            its first keyframe applied on top of the underlying value, effectively applying the underlying
     66            value twice with additivity.
     67
     68            We now only add these non-interpolating animations if the first animation has a delay and does
     69            not fill backwards.
     70
     71            Test: webanimations/transform-transition-with-delay-on-forced-layer-with-transform.html
     72
     73            * platform/graphics/ca/GraphicsLayerCA.cpp:
     74            (WebCore::GraphicsLayerCA::updateAnimations):
     75
    1762021-03-02  Alan Coon  <alancoon@apple.com>
    277
  • branches/safari-612.1.5-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r272303 r273802  
    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.