[webkit-changes] [WebKit/WebKit] 3fa7ff: [scroll-animations] improve support for attachment...
Antoine Quint
noreply at github.com
Mon Dec 9 12:12:58 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3fa7ffbf74469b65cf23a05c1780319954860f3c
https://github.com/WebKit/WebKit/commit/3fa7ffbf74469b65cf23a05c1780319954860f3c
Author: Antoine Quint <graouts at webkit.org>
Date: 2024-12-09 (Mon, 09 Dec 2024)
Changed paths:
M LayoutTests/TestExpectations
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/animation-range-ignored-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/animation-range-normal-matches-cover-expected.txt
A LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/animation-range-scroll-timeline-expected.txt
A LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/animation-range-scroll-timeline.html
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/animation-timeline-view-functional-notation.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-animation-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-animation-range-update.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-dynamic-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-keyframe-boundary-interpolation-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-range-animation-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-used-values-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-with-transform-on-subject-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/intrinsic-iteration-duration.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/setting-timeline.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/animation-events-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/block-view-timeline-nested-subject.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/change-animation-range-updates-play-state-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/contain-alignment-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/sticky/view-timeline-sticky-offscreen-1-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/sticky/view-timeline-sticky-offscreen-2-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/sticky/view-timeline-sticky-offscreen-3-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/sticky/view-timeline-sticky-offscreen-4-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/sticky/view-timeline-sticky-offscreen-5-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/sticky/view-timeline-sticky-offscreen-6-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/sticky/view-timeline-sticky-offscreen-7-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/timeline-offset-in-keyframe-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/view-timeline-get-set-range-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/view-timeline-inset-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/view-timeline-range-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/view-timeline-range-large-subject-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/view-timeline-root-source-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/view-timeline-snapport-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/view-timeline-sticky-block-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/view-timeline-sticky-inline-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/view-timeline-subject-size-changes-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/zero-intrinsic-iteration-duration.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/scroll-timeline-overallProgress.tentative-expected.txt
M LayoutTests/platform/ios/TestExpectations
M Source/WebCore/animation/AnimationEffect.cpp
M Source/WebCore/animation/AnimationEffect.h
M Source/WebCore/animation/AnimationEffectTiming.cpp
M Source/WebCore/animation/AnimationTimeline.h
M Source/WebCore/animation/CSSAnimation.cpp
M Source/WebCore/animation/DocumentTimeline.cpp
M Source/WebCore/animation/DocumentTimeline.h
M Source/WebCore/animation/ScrollTimeline.cpp
M Source/WebCore/animation/ScrollTimeline.h
M Source/WebCore/animation/ViewTimeline.cpp
M Source/WebCore/animation/ViewTimeline.h
M Source/WebCore/animation/WebAnimation.cpp
M Source/WebCore/animation/WebAnimation.h
Log Message:
-----------
[scroll-animations] improve support for attachment ranges
https://bugs.webkit.org/show_bug.cgi?id=284298
rdar://141152920
Reviewed by Tim Nguyen.
We overhaul our support for scroll-driven animation attachment ranges [0] to address fundamental issues in how
animations and progress-based timelines deal with them. Most importantly, we would always pass the animation's
attachment range to `AnimationTimeline::currentTime()` whereas the current time of a progress-based timeline is
independent on any associated animation's attachment range. Indeed, an animation's attachment range is only
relevant when computing its auto-aligned start time and effect duration.
We address this by removing the `TimelineRange` argument from `AnimationTimeline::currentTime()` and instead add
a new `intervalForAttachmentRange(const TimelineRange&)` method that we call from `WebAnimation::autoAlignStartTime()`
to correctly compute the animation's start time, accounting for its attachment range.
We also account for the attachment range within `AnimationEffect::updateComputedTimingPropertiesIfNeeded()` to correctly
compute the timeline duration for the purpose of computing the effect duration and all derived timing properties under
`AnimationEffectTiming::updateComputedProperties()`.
Finally, we make sure that we update timing properties when any of the metrics for an element associated with a
progress-based timeline change, or when the animation attachment range changes.
This yields 19 new WPT PASS results, a new ref test pass and addresses a flaky test.
We also add a new WPT test at `scroll-animations/css/animation-range-scroll-timeline.html` to ensure that the relationship
between the `animation-range-*` properties and the `Animation` properties `rangeStart` and `rangeEnd` is correct since it
showed come interoperability issues with Chrome and was not tested otherwise.
[0] https://drafts.csswg.org/scroll-animations-1/#named-range-animation-declaration
* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/animation-range-ignored-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/animation-range-normal-matches-cover-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/animation-range-scroll-timeline-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/animation-range-scroll-timeline.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/animation-timeline-view-functional-notation.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-animation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-animation-range-update.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-dynamic-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-keyframe-boundary-interpolation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-range-animation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-used-values-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-with-transform-on-subject-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/intrinsic-iteration-duration.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/setting-timeline.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/animation-events-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/block-view-timeline-nested-subject.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/change-animation-range-updates-play-state-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/contain-alignment-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/sticky/view-timeline-sticky-offscreen-1-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/sticky/view-timeline-sticky-offscreen-2-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/sticky/view-timeline-sticky-offscreen-3-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/sticky/view-timeline-sticky-offscreen-4-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/sticky/view-timeline-sticky-offscreen-5-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/sticky/view-timeline-sticky-offscreen-6-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/sticky/view-timeline-sticky-offscreen-7-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/timeline-offset-in-keyframe-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/view-timeline-get-set-range-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/view-timeline-inset-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/view-timeline-range-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/view-timeline-range-large-subject-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/view-timeline-root-source-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/view-timeline-snapport-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/view-timeline-sticky-block-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/view-timeline-sticky-inline-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/view-timeline-subject-size-changes-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/view-timelines/zero-intrinsic-iteration-duration.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/scroll-timeline-overallProgress.tentative-expected.txt:
* LayoutTests/platform/ios/TestExpectations:
* Source/WebCore/animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::animationProgressBasedTimelineSourceDidChangeMetrics):
(WebCore::AnimationEffect::animationRangeDidChange):
(WebCore::AnimationEffect::updateComputedTimingPropertiesIfNeeded):
* Source/WebCore/animation/AnimationEffect.h:
* Source/WebCore/animation/AnimationEffectTiming.cpp:
(WebCore::AnimationEffectTiming::updateComputedProperties):
* Source/WebCore/animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::currentTime):
* Source/WebCore/animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::setBindingsRangeStart):
* Source/WebCore/animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::currentTime):
* Source/WebCore/animation/DocumentTimeline.h:
* Source/WebCore/animation/ScrollTimeline.cpp:
(WebCore::ScrollTimeline::cacheCurrentTime):
(WebCore::ScrollTimeline::computeTimelineData const):
(WebCore::ScrollTimeline::intervalForAttachmentRange const):
(WebCore::ScrollTimeline::currentTime):
* Source/WebCore/animation/ScrollTimeline.h:
* Source/WebCore/animation/ViewTimeline.cpp:
(WebCore::ViewTimeline::cacheCurrentTime):
(WebCore::ViewTimeline::computeTimelineData const):
(WebCore::ViewTimeline::intervalForAttachmentRange const):
(WebCore::ViewTimeline::startOffset):
(WebCore::ViewTimeline::endOffset):
* Source/WebCore/animation/ViewTimeline.h:
* Source/WebCore/animation/WebAnimation.cpp:
(WebCore::WebAnimation::currentTime const):
(WebCore::WebAnimation::autoAlignStartTime):
(WebCore::WebAnimation::setBindingsRangeStart):
(WebCore::WebAnimation::setBindingsRangeEnd):
(WebCore::WebAnimation::setRange):
(WebCore::WebAnimation::progressBasedTimelineSourceDidChangeMetrics):
* Source/WebCore/animation/WebAnimation.h:
(WebCore::WebAnimation::range const):
(WebCore::WebAnimation::setRange): Deleted.
Canonical link: https://commits.webkit.org/287563@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list