Changeset 273656 in webkit
- Timestamp:
- Mar 1, 2021, 10:47:02 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/webanimations/transform-transition-with-delay-on-forced-layer-with-transform-expected.html (added)
-
LayoutTests/webanimations/transform-transition-with-delay-on-forced-layer-with-transform.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r273648 r273656 1 2021-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 1 18 2021-03-01 Chris Gambrell <cgambrell@apple.com> 2 19 -
trunk/Source/WebCore/ChangeLog
r273655 r273656 1 2021-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 1 30 2021-03-01 Chris Dumez <cdumez@apple.com> 2 31 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r272303 r273656 3064 3064 } 3065 3065 3066 Seconds earliestBeginTime = 0_s;3066 LayerPropertyAnimation* earliestAnimation = nullptr; 3067 3067 for (auto* animation : animations) { 3068 3068 if (auto beginTime = animation->computedBeginTime()) { 3069 if (!earliest BeginTime || earliestBeginTime> *beginTime)3070 earliest BeginTime = *beginTime;3069 if (!earliestAnimation || *earliestAnimation->computedBeginTime() > *beginTime) 3070 earliestAnimation = animation; 3071 3071 } 3072 3072 } 3073 3073 3074 if (earliestBeginTime)3075 earliestBeginTime += animationGroupBeginTime;3076 3077 3074 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 } 3082 3089 } 3083 3090 } … … 3102 3109 } 3103 3110 3104 Seconds earliestBeginTime = 0_s;3111 LayerPropertyAnimation* earliestAnimation = nullptr; 3105 3112 Vector<RefPtr<PlatformCAAnimation>> caAnimations; 3106 3113 for (auto* animation : WTF::makeReversedRange(animations)) { 3107 3114 if (auto beginTime = animation->computedBeginTime()) { 3108 if (!earliest BeginTime || earliestBeginTime> *beginTime)3109 earliest BeginTime = *beginTime;3115 if (!earliestAnimation || *earliestAnimation->computedBeginTime() > *beginTime) 3116 earliestAnimation = animation; 3110 3117 } 3111 3118 prepareAnimationForAddition(*animation); … … 3113 3120 } 3114 3121 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 } 3122 3135 } 3123 3136 }
Note:
See TracChangeset
for help on using the changeset viewer.