Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 870d2f5946c851edcc990bae81eef2e84cb4c809
https://github.com/WebKit/WebKit/commit/870d2f5946c851edcc990bae81eef2e84cb4c809
Author: Antoine Quint <[email protected]>
Date: 2025-11-21 (Fri, 21 Nov 2025)
Changed paths:
M
LayoutTests/webanimations/threaded-animations/scroll-timeline-nested-scroller.html
M
LayoutTests/webanimations/threaded-animations/scroll-timeline-root-scroller.html
M Source/WebCore/animation/KeyframeEffect.cpp
M Source/WebCore/platform/animation/AcceleratedEffect.cpp
M Source/WebCore/platform/animation/AcceleratedEffect.h
M Source/WebKit/UIProcess/RemoteLayerTree/RemoteAnimation.cpp
Log Message:
-----------
[threaded-animations] scroll-driven animations stop updating after reaching
100%
https://bugs.webkit.org/show_bug.cgi?id=302870
rdar://165130574
Reviewed by Simon Fraser.
Once an accelerated scroll-driven animation reaches 100%, and we update the
animation timing
model, `KeyframeEffect::animationDidFinish()` is called and we update the
associated accelerated
effect stack for the associated target while the associated animation's hold
time [0] is set,
as the animation is indeed finished.
This yields an update of that animation's counterpart in the remote layer tree
with the
`AcceleratedEffect::m_holdTime` member set to `100%`. From that point on, even
though the
associated remote timeline is indeed updated based on the scroll offset, the
computed value
for `localTime` in `AcceleratedEffect::apply()` is stuck to `100%` as we assume
the hold time
indicates a paused time, not a finished time in that case.
We fix this bug by, first, not triggering an accelerated effect stack update
when a scroll-driven
animation is "finished" since it really doesn't mean much for an animation that
is not monotonic.
Additionally, we ensure we only use the hold time when computing the local time
[1] if the remote
animation is paused, meaning this bug would have been fixed even if the remote
animation had been
updated when reaching 100%.
To check that we indeed update the remote animation's effect as the remote
animation's timeline
updates, we add a new `progress` property to the JSON object returned via
`UIScriptController`
and add assertions to existing tests that check updates occur even after
reaching 100%.
[0] https://drafts.csswg.org/web-animations-1/#animation-hold-time
[1] https://drafts.csswg.org/web-animations-1/#local-time-section
*
LayoutTests/webanimations/threaded-animations/scroll-timeline-nested-scroller.html:
*
LayoutTests/webanimations/threaded-animations/scroll-timeline-root-scroller.html:
* Source/WebCore/animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::animationDidFinish):
* Source/WebCore/platform/animation/AcceleratedEffect.cpp:
(WebCore::AcceleratedEffect::resolvedTimingForTesting const):
(WebCore::AcceleratedEffect::resolvedTiming const):
(WebCore::AcceleratedEffect::apply const):
* Source/WebCore/platform/animation/AcceleratedEffect.h:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteAnimation.cpp:
(WebKit::RemoteAnimation::toJSONForTesting const):
Canonical link: https://commits.webkit.org/303400@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications