Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a5afe56ab6894f59331607a179e735410d56ae00
https://github.com/WebKit/WebKit/commit/a5afe56ab6894f59331607a179e735410d56ae00
Author: Antoine Quint <[email protected]>
Date: 2026-02-21 (Sat, 21 Feb 2026)
Changed paths:
M LayoutTests/platform/ios/TestExpectations
M LayoutTests/platform/mac-wk2/TestExpectations
R
LayoutTests/webanimations/threaded-animations/scroll-driven-animation-failed-assertion-in-scroll-timeline-expected.txt
R
LayoutTests/webanimations/threaded-animations/scroll-driven-animation-failed-assertion-in-scroll-timeline.html
A
LayoutTests/webanimations/threaded-animations/scroll-driven-animation-prevents-visual-overflow-expected.txt
A
LayoutTests/webanimations/threaded-animations/scroll-driven-animation-prevents-visual-overflow.html
M Source/WebCore/animation/AnimationTimelinesController.cpp
M Source/WebCore/animation/AnimationTimelinesController.h
M Source/WebCore/dom/Document.cpp
M Source/WebCore/dom/Document.h
M Source/WebCore/page/Page.cpp
M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm
Log Message:
-----------
[threaded-animations] failed assertion`ASSERT(timeline)` in
`RemoteLayerTreeNode::setAcceleratedEffectsAndBaseValues()`
https://bugs.webkit.org/show_bug.cgi?id=308304
rdar://170600376
Reviewed by Simon Fraser.
A common pattern with scroll timelines is that the animation's target is within
the hierarchy of the
scroll timeline's source, the scroll container. As such, it's possible that the
animation modifies the
scroll container's visual overflow, potentially even make the scroll container
not have any content
to scroll.
In the case of threaded animations, an animation will only be accelerated if
its timeline can also be
accelerated. In the case of scroll-driven animations, this requires the scroll
timeline's source to
be composited and have a scrolling node id.
Prior to this patch, we would run an update for threaded animations after the
first layout performed
during a page rendering update, but before the second layout that updates
compositing layers. Because
of that, we could enter a situation where a scroll-driven animation would
initially be associated with
a scroll timeline that qualified for acceleration, but did not after the second
layout. This led to
conflicting information being sent to the remote layer tree where we had
created an accelerated animation
but the timeline eventually was no longer in the update because it disappeared
along the way. This caused
a crash under `RemoteLayerTreeNode::setAcceleratedEffectsAndBaseValues()`
during the timeline lookup.
We now separate the existing `Document::runPostRenderingUpdateAnimationTasks()`
into a second function
which simply has the role of updating stale scroll timelines, which correctly
runs in between layouts.
The code related to updating accelerated timelines and animations remains in
the function and its call
moves more appropriately under `Page::doAfterUpdateRendering()`, after
compositing layers were updated.
We also upgrade the existing `ASSERT()` in
`RemoteLayerTreeNode::setAcceleratedEffectsAndBaseValues()` to
a `RELEASE_ASSERT()` so we get clearer reports if we get in such a situation
again.
Test:
webanimations/threaded-animations/scroll-driven-animation-prevents-visual-overflow.html
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/mac-wk2/TestExpectations:
*
LayoutTests/webanimations/threaded-animations/scroll-driven-animation-prevents-visual-overflow-expected.txt:
Renamed from
LayoutTests/webanimations/threaded-animations/scroll-driven-animation-failed-assertion-in-scroll-timeline-expected.txt.
*
LayoutTests/webanimations/threaded-animations/scroll-driven-animation-prevents-visual-overflow.html:
Renamed from
LayoutTests/webanimations/threaded-animations/scroll-driven-animation-failed-assertion-in-scroll-timeline.html.
* Source/WebCore/animation/AnimationTimelinesController.cpp:
(WebCore::AnimationTimelinesController::updateStaleScrollTimelines):
(WebCore::AnimationTimelinesController::runPostRenderingUpdateTasks):
* Source/WebCore/animation/AnimationTimelinesController.h:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::updateStaleScrollTimelines):
* Source/WebCore/dom/Document.h:
* Source/WebCore/page/Page.cpp:
(WebCore::Page::updateRendering):
(WebCore::Page::doAfterUpdateRendering):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
(WebKit::RemoteLayerTreeNode::setAcceleratedEffectsAndBaseValues):
Canonical link: https://commits.webkit.org/307993@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications