[webkit-changes] [WebKit/WebKit] 2f41a2: [scroll-animations] multiple `timeline-scope` WPT ...
Antoine Quint
noreply at github.com
Tue Jan 21 05:26:42 PST 2025
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 2f41a237286ad02b6bd743fc2c9f596a0c00ae43
https://github.com/WebKit/WebKit/commit/2f41a237286ad02b6bd743fc2c9f596a0c00ae43
Author: Antoine Quint <graouts at webkit.org>
Date: 2025-01-21 (Tue, 21 Jan 2025)
Changed paths:
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/scroll-timeline-multi-pass.tentative-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/scroll-timeline-range-animation-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/timeline-scope-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-range-animation-expected.txt
M Source/WebCore/animation/KeyframeEffect.cpp
M Source/WebCore/dom/Element.cpp
Log Message:
-----------
[scroll-animations] multiple `timeline-scope` WPT tests are failing
https://bugs.webkit.org/show_bug.cgi?id=286264
rdar://143271212
Reviewed by Antti Koivisto and Simon Fraser.
When properties of an animation change, we end up calling `Element::invalidateStyleForAnimation()` on the
associated effect target to ensure that those updated animation properties are represented in the animated
style.
The creation of style-originated animations (CSS Animations and CSS Transitions) occur during style resolution,
typically under `Document::resolveStyle()`. During that process, we ensure that the new style-originated
animations do not call into `Element::invalidateStyleForAnimation()` so as not to produce some inconsistent
state.
As part of scroll-driven animations, in the case of `timeline-scope`, we do new work during style resolution to
set the timeline of a style-originated animation. The previous protections we had in place to avoid calling
`Element::invalidateStyleForAnimation()` did not apply there. This would yield inconsistent node states where
the Style::Validity::AnimationInvalid flag would be set but ancestors would no longer have the
`NodeStyleFlag::DescendantNeedsStyleResolution` flag set, preventing further style resolution on animated
elements.
We now add a more direct check in the `invalidateElement()` static function of `KeyframeEffect.cpp` to check
that we do not call `Element::invalidateStyleForAnimation()` during style resolution. Furthermore, we also
add an `ASSERT()` in `Element::invalidateStyleForAnimation()` to check that this holds true for any future
call to that function.
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/scroll-timeline-multi-pass.tentative-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/scroll-timeline-range-animation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/timeline-scope-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/view-timeline-range-animation-expected.txt:
* Source/WebCore/animation/KeyframeEffect.cpp:
(WebCore::invalidateElement):
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::invalidateStyleForAnimation):
Canonical link: https://commits.webkit.org/289180@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