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

Changeset 273738 in webkit


Ignore:
Timestamp:
Mar 2, 2021, 11:09:56 AM (6 years ago)
Author:
Alan Coon
Message:

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

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-611.1.21.0-branch
Files:
2 added
3 edited

Legend:

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

    r273671 r273738  
     12021-03-02  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r273656. rdar://problem/74883345
     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-01  Alan Coon  <alancoon@apple.com>
    265
  • branches/safari-611.1.21.0-branch/Source/WebCore/ChangeLog

    r273686 r273738  
     12021-03-02  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r273656. rdar://problem/74883345
     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-01  Alan Coon  <alancoon@apple.com>
    277
  • branches/safari-611.1.21.0-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r272528 r273738  
    30413041            }
    30423042
    3043             Seconds earliestBeginTime = 0_s;
     3043            LayerPropertyAnimation* earliestAnimation = nullptr;
    30443044            for (auto* animation : animations) {
    30453045                if (auto beginTime = animation->computedBeginTime()) {
    3046                     if (!earliestBeginTime || earliestBeginTime > *beginTime)
    3047                         earliestBeginTime = *beginTime;
     3046                    if (!earliestAnimation || *earliestAnimation->computedBeginTime() > *beginTime)
     3047                        earliestAnimation = animation;
    30483048                }
    30493049            }
    30503050
    3051             if (earliestBeginTime)
    3052                 earliestBeginTime += animationGroupBeginTime;
    3053 
    30543051            Vector<RefPtr<PlatformCAAnimation>> caAnimations;
    3055             if (earliestBeginTime > currentTime) {
    3056                 if (auto* baseValueTransformAnimation = makeBaseValueTransformAnimation(property, TransformationMatrixSource::AskClient, earliestBeginTime)) {
    3057                     prepareAnimationForAddition(*baseValueTransformAnimation);
    3058                     caAnimations.append(baseValueTransformAnimation->m_animation);
     3052
     3053            // If we have an animation with an explicit begin time that does not fill backwards and starts with a delay,
     3054            // we must create a non-interpolating animation to set the current value for this transform-related property
     3055            // until that animation begins.
     3056            if (earliestAnimation) {
     3057                auto fillMode = earliestAnimation->m_animation->fillMode();
     3058                if (fillMode != PlatformCAAnimation::Backwards && fillMode != PlatformCAAnimation::Both) {
     3059                    Seconds earliestBeginTime = *earliestAnimation->computedBeginTime() + animationGroupBeginTime;
     3060                    if (earliestBeginTime > currentTime) {
     3061                        if (auto* baseValueTransformAnimation = makeBaseValueTransformAnimation(property, TransformationMatrixSource::AskClient, earliestBeginTime)) {
     3062                            prepareAnimationForAddition(*baseValueTransformAnimation);
     3063                            caAnimations.append(baseValueTransformAnimation->m_animation);
     3064                        }
     3065                    }
    30593066                }
    30603067            }
    … …  
    30793086            }
    30803087
    3081             Seconds earliestBeginTime = 0_s;
     3088            LayerPropertyAnimation* earliestAnimation = nullptr;
    30823089            Vector<RefPtr<PlatformCAAnimation>> caAnimations;
    30833090            for (auto* animation : WTF::makeReversedRange(animations)) {
    30843091                if (auto beginTime = animation->computedBeginTime()) {
    3085                     if (!earliestBeginTime || earliestBeginTime > *beginTime)
    3086                         earliestBeginTime = *beginTime;
     3092                    if (!earliestAnimation || *earliestAnimation->computedBeginTime() > *beginTime)
     3093                        earliestAnimation = animation;
    30873094                }
    30883095                prepareAnimationForAddition(*animation);
    … …  
    30903097            }
    30913098
    3092             if (earliestBeginTime)
    3093                 earliestBeginTime += animationGroupBeginTime;
    3094 
    3095             if (earliestBeginTime > currentTime) {
    3096                 if (auto* baseValueTransformAnimation = makeBaseValueTransformAnimation(property, TransformationMatrixSource::AskClient, earliestBeginTime)) {
    3097                     prepareAnimationForAddition(*baseValueTransformAnimation);
    3098                     caAnimations.append(baseValueTransformAnimation->m_animation);
     3099            // If we have an animation with an explicit begin time that does not fill backwards and starts with a delay,
     3100            // we must create a non-interpolating animation to set the current value for this transform-related property
     3101            // until that animation begins.
     3102            if (earliestAnimation) {
     3103                auto fillMode = earliestAnimation->m_animation->fillMode();
     3104                if (fillMode != PlatformCAAnimation::Backwards && fillMode != PlatformCAAnimation::Both) {
     3105                    Seconds earliestBeginTime = *earliestAnimation->computedBeginTime() + animationGroupBeginTime;
     3106                    if (earliestBeginTime > currentTime) {
     3107                        if (auto* baseValueTransformAnimation = makeBaseValueTransformAnimation(property, TransformationMatrixSource::AskClient, earliestBeginTime)) {
     3108                            prepareAnimationForAddition(*baseValueTransformAnimation);
     3109                            caAnimations.append(baseValueTransformAnimation->m_animation);
     3110                        }
     3111                    }
    30993112                }
    31003113            }
Note: See TracChangeset for help on using the changeset viewer.