Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a770c443fc9e6d3563244a316e7920011425dae2
https://github.com/WebKit/WebKit/commit/a770c443fc9e6d3563244a316e7920011425dae2
Author: Antoine Quint <[email protected]>
Date: 2026-02-16 (Mon, 16 Feb 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/scroll-timeline-paused-animations-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-paused-animations-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-paused-animations.html
A
LayoutTests/platform/glib/imported/w3c/web-platform-tests/scroll-animations/css/scroll-timeline-paused-animations-expected.txt
M Source/WebCore/animation/CSSAnimation.cpp
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.h
Log Message:
-----------
[scroll-animations] WPT test `css/scroll-timeline-paused-animations.html`
fails
https://bugs.webkit.org/show_bug.cgi?id=307782
rdar://170309012
Reviewed by Anne van Kesteren.
There were two issues that prevented us from passing the subtest that checks
that pausing
a CSS Animation by setting the CSS property `animation-play-state` dynamically
would successfully
pause a scroll-driven animation:
1. in `syncStyleOriginatedTimeline()`, which is called when a style update
changes CSS
properties related to animations, we would reset the animation's timeline
when the `scroll()`
notation was used because the equality check in
`WebAnimation::setTimeline()` would fail as
indeed a new `ScrollTimeline` instanced was created. We now have a method to
check whether
a `scroll()` notation would indeed yield a new timeline and avoid setting
the timeline in
case it would not.
2. in `syncPropertiesWithBackingAnimation()`, which is also called when a style
update
changes CSS properties related to animations, we would fail to pause an
animation when
`animation-play-state` was set to `paused` if the animation was not running,
as for instance
when it is finished as in this test. We now pause animations as long as it's
not idle.
The behavior caught in 1 was not tested for view timelines, so we added a new
test and a similar
function for the view timeline notation.
Test:
imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-paused-animations.html
*
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/scroll-timeline-paused-animations-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-paused-animations-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-paused-animations.html:
Added.
*
LayoutTests/platform/glib/imported/w3c/web-platform-tests/scroll-animations/css/scroll-timeline-paused-animations-expected.txt:
Added.
* Source/WebCore/animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
(WebCore::CSSAnimation::syncStyleOriginatedTimeline):
* Source/WebCore/animation/ScrollTimeline.cpp:
(WebCore::ScrollTimeline::ScrollTimeline):
(WebCore::ScrollTimeline::matchesAnonymousScrollFunctionForSource const):
* Source/WebCore/animation/ScrollTimeline.h:
(WebCore::ScrollTimeline::isStyleOriginated const):
* Source/WebCore/animation/ViewTimeline.cpp:
(WebCore::ViewTimeline::matchesAnonymousViewFunctionForSubject const):
* Source/WebCore/animation/ViewTimeline.h:
* Source/WebCore/animation/WebAnimation.h:
(WebCore::WebAnimation::hasPendingPlayTask const):
Canonical link: https://commits.webkit.org/307645@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications