Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[Web Animations] Ensure that changing the timing model updates styles…
… synchronously https://bugs.webkit.org/show_bug.cgi?id=182836 Reviewed by Dean Jackson. LayoutTests/imported/w3c: Update test expectations for progressions. * web-platform-tests/css-timing-1/cubic-bezier-timing-functions-output-expected.txt: * web-platform-tests/css-timing-1/frames-timing-functions-output-expected.txt: * web-platform-tests/css-timing-1/step-timing-functions-output-expected.txt: * web-platform-tests/css/css-multicol/multicol-gap-animation-001-expected.txt: * web-platform-tests/web-animations/animation-model/animation-types/discrete-expected.txt: * web-platform-tests/web-animations/animation-model/animation-types/visibility-expected.txt: * web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt: * web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-transformed-distance-expected.txt: * web-platform-tests/web-animations/interfaces/Animation/cancel-expected.txt: * web-platform-tests/web-animations/interfaces/KeyframeEffect/iterationComposite-expected.txt: Source/WebCore: We did not invalidate the timing model when properties of an effect's timing object changed and even when we did invalidate the timing model, we did not update styles on effect targets synchronously, only scheduling such updates for the next animation frame. In this patch we expose the effect on the timing object such that changing timing properties can notify the effect of a change in the timing model, which can then be forwarded to the animation (which already informs its timeline, if any). Additionally, when an animation's timing model has changed, we now invalidate the effect, which will update styles synchronously. This produces a number of progressions in WPT tests. * animation/AnimationEffectReadOnly.cpp: (WebCore::AnimationEffectReadOnly::AnimationEffectReadOnly): Set the timing object's effect upon effect construction. (WebCore::AnimationEffectReadOnly::~AnimationEffectReadOnly): Set the timing object's effect to null upon effect destruction. (WebCore::AnimationEffectReadOnly::timingDidChange): Notify the animation (if any) that its timing model changed following a change in the timing properties. * animation/AnimationEffectReadOnly.h: Add a new virtual invalidate() method that subclasses can override to implement invalidation behavior when the animation finds out its timing model changed. * animation/AnimationEffectTimingReadOnly.cpp: Notify the effect when a property changes such that it may notify its animation of a timing model change. (WebCore::AnimationEffectTimingReadOnly::propertyDidChange): (WebCore::AnimationEffectTimingReadOnly::setIterationStart): (WebCore::AnimationEffectTimingReadOnly::setIterations): (WebCore::AnimationEffectTimingReadOnly::setBindingsDuration): (WebCore::AnimationEffectTimingReadOnly::setEasing): (WebCore::AnimationEffectTimingReadOnly::setDelay): (WebCore::AnimationEffectTimingReadOnly::setEndDelay): (WebCore::AnimationEffectTimingReadOnly::setFill): (WebCore::AnimationEffectTimingReadOnly::setIterationDuration): (WebCore::AnimationEffectTimingReadOnly::setDirection): * animation/AnimationEffectTimingReadOnly.h: (WebCore::AnimationEffectTimingReadOnly::setEffect): (WebCore::AnimationEffectTimingReadOnly::setBindingsDelay): (WebCore::AnimationEffectTimingReadOnly::setBindingsEndDelay): (WebCore::AnimationEffectTimingReadOnly::setDelay): Deleted. (WebCore::AnimationEffectTimingReadOnly::setEndDelay): Deleted. (WebCore::AnimationEffectTimingReadOnly::setFill): Deleted. (WebCore::AnimationEffectTimingReadOnly::setIterationDuration): Deleted. (WebCore::AnimationEffectTimingReadOnly::setDirection): Deleted. * animation/AnimationTimeline.cpp: Rename animationTimingModelDidChange() to timingModelDidChange() to align it with the new WebAnimation::timingModelDidChange() method. (WebCore::AnimationTimeline::addAnimation): (WebCore::AnimationTimeline::removeAnimation): (WebCore::AnimationTimeline::setCurrentTime): * animation/AnimationTimeline.h: (WebCore::AnimationTimeline::timingModelDidChange): (WebCore::AnimationTimeline::animationTimingModelDidChange): Deleted. * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::timingModelDidChange): (WebCore::DocumentTimeline::updateAnimations): (WebCore::DocumentTimeline::animationTimingModelDidChange): Deleted. * animation/DocumentTimeline.h: * animation/KeyframeEffectReadOnly.cpp: (WebCore::KeyframeEffectReadOnly::invalidate): Override the invalidate() method to perform a synchronous style update in order to ensure that timing properties are accounted for right as they change. * animation/KeyframeEffectReadOnly.h: * animation/WebAnimation.cpp: (WebCore::WebAnimation::timingModelDidChange): Invalidate the effect and notify the timeline of a timing model change when an animation is notified that its timing model has changed. (WebCore::WebAnimation::setStartTime): * animation/WebAnimation.h: Canonical link: https://commits.webkit.org/198602@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228537 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
266 additions
and 70 deletions.
- +20 −0 LayoutTests/imported/w3c/ChangeLog
- +4 −4 ...ts/imported/w3c/web-platform-tests/css-timing-1/cubic-bezier-timing-functions-output-expected.txt
- +3 −3 LayoutTests/imported/w3c/web-platform-tests/css-timing-1/frames-timing-functions-output-expected.txt
- +6 −6 LayoutTests/imported/w3c/web-platform-tests/css-timing-1/step-timing-functions-output-expected.txt
- +1 −1 LayoutTests/imported/w3c/web-platform-tests/css/css-multicol/multicol-gap-animation-001-expected.txt
- +5 −5 ...orted/w3c/web-platform-tests/web-animations/animation-model/animation-types/discrete-expected.txt
- +2 −2 ...ted/w3c/web-platform-tests/web-animations/animation-model/animation-types/visibility-expected.txt
- +10 −10 ...imations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt
- +15 −15 ...ts/web-animations/animation-model/keyframe-effects/effect-value-transformed-distance-expected.txt
- +1 −1 LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/cancel-expected.txt
- +1 −1 ...d/w3c/web-platform-tests/web-animations/interfaces/KeyframeEffect/iterationComposite-expected.txt
- +73 −0 Source/WebCore/ChangeLog
- +12 −0 Source/WebCore/animation/AnimationEffectReadOnly.cpp
- +6 −2 Source/WebCore/animation/AnimationEffectReadOnly.h
- +65 −2 Source/WebCore/animation/AnimationEffectTimingReadOnly.cpp
- +13 −8 Source/WebCore/animation/AnimationEffectTimingReadOnly.h
- +3 −3 Source/WebCore/animation/AnimationTimeline.cpp
- +1 −1 Source/WebCore/animation/AnimationTimeline.h
- +2 −2 Source/WebCore/animation/DocumentTimeline.cpp
- +1 −1 Source/WebCore/animation/DocumentTimeline.h
- +9 −0 Source/WebCore/animation/KeyframeEffectReadOnly.cpp
- +1 −0 Source/WebCore/animation/KeyframeEffectReadOnly.h
- +10 −3 Source/WebCore/animation/WebAnimation.cpp
- +2 −0 Source/WebCore/animation/WebAnimation.h
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,6 +1,6 @@ | ||
|
||
FAIL cubic-bezier easing with input progress greater than 1 assert_approx_equals: The left of the animation should be approximately 98.8706654939602 at 230ms expected 98.8706654939602 +/- 0.01 but got 98.890625 | ||
FAIL cubic-bezier easing with input progress greater than 1 and where the tangent on the upper boundary is infinity assert_approx_equals: The left of the animation should be approximately 106.31755608768113 at 230ms expected 106.31755608768113 +/- 0.01 but got 106.359375 | ||
FAIL cubic-bezier easing with input progress less than 0 assert_approx_equals: The left of the animation should be approximately -16.589193103032184 at 10ms expected -16.589193103032184 +/- 0.01 but got -17.5 | ||
FAIL cubic-bezier easing with input progress less than 0 and where the tangent on the lower boundary is infinity assert_approx_equals: The left of the animation should be approximately 0 at 300ms expected 0 +/- 0.01 but got 512.0625 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,8 +1,8 @@ | ||
|
||
PASS step-start easing with input progress greater than 1 | ||
PASS step-end easing with input progress greater than 1 | ||
PASS step-end easing with input progress greater than 2 | ||
PASS step-start easing with input progress less than 0 | ||
PASS step-start easing with input progress less than -1 | ||
PASS step-end easing with input progress less than 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,3 +1,3 @@ | ||
|
||
FAIL column-gap property is animatable assert_equals: expected "150px" but got "100px" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,7 +1,7 @@ | ||
|
||
FAIL Test animating discrete values assert_equals: Animation produces 'from' value just before the middle of the interval expected "normal" but got "oblique 9.75deg" | ||
FAIL Test discrete animation is used when interpolation fails assert_equals: Animation produces 'from' value at start of interval expected "0px" but got "200px" | ||
FAIL Test discrete animation is used only for pairs of values that cannot be interpolated assert_equals: Animation produces 'from' value at start of interval expected "0px" but got "200px" | ||
FAIL Test the 50% switch point for discrete animation is based on the effect easing assert_equals: Animation produces 'from' value at 94% of the iteration time expected "normal" but got "oblique 8.5deg" | ||
FAIL Test the 50% switch point for discrete animation is based on the keyframe easing assert_equals: Animation produces 'from' value at 94% of the iteration time expected "normal" but got "oblique 8.5deg" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,4 +1,4 @@ | ||
|
||
PASS Visibility clamping behavior | ||
PASS Visibility clamping behavior with an easing that has a negative component | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,5 +1,5 @@ | ||
|
||
FAIL Animated style is cleared after calling Animation.cancel() assert_not_equals: transform style is animated before cancelling got disallowed value "none" | ||
FAIL After cancelling an animation, it can still be seeked assert_equals: margin-left style is updated when cancelled animation is seeked expected "150px" but got "0px" | ||
PASS After cancelling an animation, it can still be re-used | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,3 +1,3 @@ | ||
|
||
FAIL iterationComposite can be updated while an animation is in progress assert_equals: Animated style at 50s of the third iteration expected "25px" but got "0px" | ||
|
Oops, something went wrong.