Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6202190d46456dddc6a9a5c3f47ebb4d95a44a14
https://github.com/WebKit/WebKit/commit/6202190d46456dddc6a9a5c3f47ebb4d95a44a14
Author: Ahmad Saleem <[email protected]>
Date: 2026-10-05 (Mon, 05 Oct 2026)
Changed paths:
A
LayoutTests/fast/css/getComputedStyle/getComputedStyle-pseudo-element-animation-style-resolution-expected.txt
A
LayoutTests/fast/css/getComputedStyle/getComputedStyle-pseudo-element-animation-style-resolution.html
M Source/WebCore/css/CSSComputedStyleDeclaration.cpp
M Source/WebCore/css/typedom/ComputedStylePropertyMapReadOnly.cpp
M Source/WebCore/style/StyleExtractor.cpp
M Source/WebCore/style/StyleExtractor.h
Log Message:
-----------
StyleExtractor::hasValidStyleForProperty() ignores the pseudo-element when
checking for animations
https://bugs.webkit.org/show_bug.cgi?id=325393
rdar://188502400
Reviewed by Antti Koivisto.
hasValidStyleForProperty() decides whether getComputedStyle() can avoid
forcing a style update. When the document has a pending style recalc but
the queried element's own style is valid, it checks whether the element
has a running animation on the property, in which case a style update is
still required to get the current animated value.
That animation check used Styleable(element, { }), hardcoding a null
pseudo-element identifier, so it always queried the originating element's
keyframe effect stack. When extracting a property for a pseudo-element,
animations running on the pseudo-element were therefore missed: the style
update was skipped and getComputedStyle() could return a stale value.
Thread the pseudo-element identifier through updateStyleIfNeededForProperty()
and hasValidStyleForProperty() so the correct Styleable, and thus the
correct keyframe effect stack, is consulted.
Test:
fast/css/getComputedStyle/getComputedStyle-pseudo-element-animation-style-resolution.html
*
LayoutTests/fast/css/getComputedStyle/getComputedStyle-pseudo-element-animation-style-resolution-expected.txt:
Added.
*
LayoutTests/fast/css/getComputedStyle/getComputedStyle-pseudo-element-animation-style-resolution.html:
Added.
* Source/WebCore/css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::length const):
* Source/WebCore/css/typedom/ComputedStylePropertyMapReadOnly.cpp:
(WebCore::ComputedStylePropertyMapReadOnly::size const):
(WebCore::ComputedStylePropertyMapReadOnly::entries const):
* Source/WebCore/style/StyleExtractor.cpp:
(WebCore::Style::hasValidStyleForProperty):
(WebCore::Style::Extractor::updateStyleIfNeededForProperty):
(WebCore::Style::Extractor::computeStyleForCustomProperty const):
(WebCore::Style::Extractor::computeStyle const):
(WebCore::Style::Extractor::appleColorFilterSerializationForTesting):
* Source/WebCore/style/StyleExtractor.h:
Canonical link: https://commits.webkit.org/322681@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications