Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7ac36254a04f025e99a9bfcb10e4c7916712d920
https://github.com/WebKit/WebKit/commit/7ac36254a04f025e99a9bfcb10e4c7916712d920
Author: Antoine Quint <[email protected]>
Date: 2026-01-29 (Thu, 29 Jan 2026)
Changed paths:
M
LayoutTests/webanimations/accelerated-animations-and-implicit-keyframes.html
A
LayoutTests/webanimations/threaded-animations/accelerated-animations-and-implicit-keyframes-expected.txt
A
LayoutTests/webanimations/threaded-animations/accelerated-animations-and-implicit-keyframes.html
M Source/WebCore/platform/animation/AcceleratedEffect.cpp
M Source/WebCore/platform/animation/AcceleratedEffect.h
M Source/WebCore/rendering/RenderLayerBacking.cpp
Log Message:
-----------
[threaded-animations] test
`webanimations/accelerated-animation-removed-permanently-when-forward-filling.html`
fails with "Threaded Time-based Animations"
https://bugs.webkit.org/show_bug.cgi?id=306531
rdar://169186310
Reviewed by Cameron McCormack.
The test
`webanimations/accelerated-animation-removed-permanently-when-forward-filling.html`
assumes that
effects associated with a "replaced" animation [0], in other words effects that
have no noticeable effect
because other effects further up the effect stack override them, are not
accelerated, and neither are
effects which are associated with an animation that is not in the "running"
state [1].
These assumptions did not hold in the world of threaded animations where,
because we support additivity [2],
we chose to have all effects that are associated with a "relevant" animation
[3] reflected in the remote
layer tree.
However, it is desirable to keep passing such a test and have a minimal amount
of animations in the remote
layer tree. So we now implement similar logic in
`RenderLayerBacking::updateAcceleratedEffectsAndBaseValues()`
where we make the following changes:
1. iterate over effects in reverse and only add effects which are not
completely replaced,
2. iterate over those effects in case there are properties that are animated by
an effect and yet have no
visible effect.
To that end, we now keep a list of "replaced properties" on `AcceleratedEffect`
including all properties
that have an explicit "from" and "to" value and have a "replace" composite
operation. Then, as we iterate
over effects in `RenderLayerBacking::updateAcceleratedEffectsAndBaseValues()`,
we keep several list of
properties:
1. a list of all encountered animated properties
2. a list of all interpolating animated properties
3. a list of all animated properties that have been replaced by an effect
Using the first two lists we can determine a list of non-interpolating
properties, which we use to implement
step 2 above. Using the third list, we implement step 1 above.
This changes the behavior of one of the existing tests,
`webanimations/accelerated-animations-and-implicit-keyframes.html`,
which now has improved, more restrictive behavior, so we make sure this test
turns off "Threaded Time-based Animations"
to keep testing the existing behavior, and duplicate it in a test where we test
the new behavior with the flag
enabled.
[0] https://drafts.csswg.org/web-animations-1/#replacing-animations
[1] https://drafts.csswg.org/web-animations-1/#play-state-running
[2] https://drafts.csswg.org/web-animations-1/#composite-operation-add
[3] https://drafts.csswg.org/web-animations-1/#relevant-animations-section
Test:
webanimations/threaded-animations/accelerated-animations-and-implicit-keyframes.html
* LayoutTests/webanimations/accelerated-animations-and-implicit-keyframes.html:
*
LayoutTests/webanimations/threaded-animations/accelerated-animations-and-implicit-keyframes-expected.txt:
Added.
*
LayoutTests/webanimations/threaded-animations/accelerated-animations-and-implicit-keyframes.html:
Added.
* Source/WebCore/platform/animation/AcceleratedEffect.cpp:
(WebCore::AcceleratedEffect::AcceleratedEffect):
* Source/WebCore/platform/animation/AcceleratedEffect.h:
(WebCore::AcceleratedEffect::replacedProperties const):
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateAcceleratedEffectsAndBaseValues):
Canonical link: https://commits.webkit.org/306475@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications