Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4a983f13b9fc3a9ca790ebd9d5cc61cef61cd4f6
https://github.com/WebKit/WebKit/commit/4a983f13b9fc3a9ca790ebd9d5cc61cef61cd4f6
Author: Suraj Thanugundla <[email protected]>
Date: 2026-08-27 (Thu, 27 Aug 2026)
Changed paths:
M LayoutTests/TestExpectations
M
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-all-types-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-all-types.html
M
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-cycle-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-number-invalidation-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-number-invalidation.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-percent-invalidation-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-percent-invalidation.html
M LayoutTests/platform/ios/TestExpectations
M LayoutTests/platform/mac/TestExpectations
M Source/WebCore/style/StyleSubstitutionResolver.cpp
Log Message:
-----------
[css-values-5] Fix invalidation and serialization of properties using attr()
with number or percentage
https://bugs.webkit.org/show_bug.cgi?id=321425
Reviewed by Antti Koivisto.
When an element's attribute changes, the substituted value for properties
using attr() with a number or percentage type was never updated and this
resulted in the stale property value always being used. The new value is
compared with the old one and old value is replaced if they are unequal.
CSSParserToken::operator== is used for comparison and always evaluated
to true for number or percentage values even when unequal as their
original text is used to check equality rather than the parsed values.
The issue was that during attr() substitution, the substituted value’s
text was never stored and only parsed value was stored in CSSParserToken.
In addition, when such CSS properties are serialized, the original text
of the substituted value is used and always returned an empty string.
This change ensures that the original text of the substituted valued is
always passed to CSSParserToken constructor during attr() substitution,
making it available for equality checks and serialization later.
Tests:
imported/w3c/web-platform-tests/css/css-values/attr-number-invalidation.html
imported/w3c/web-platform-tests/css/css-values/attr-percent-invalidation.html
attr-pseudo-element-placeholder.html, attr-cycle-expected.html now
pass as property invalidation and serialization work as expected.
* Source/WebCore/style/StyleSubstitutionResolver.cpp:
(WebCore::Style::SubstitutionResolver::substituteAttrFunction):
Pass the attribute string value instead of an empty StringView
to CSSParserToken constructor for Number and Percentage types
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-cycle-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-number-invalidation-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-number-invalidation.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-percent-invalidation-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-percent-invalidation.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-all-types-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-all-types.html:
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/mac/TestExpectations:
* LayoutTests/TestExpectations:
Update test expectations to remove passing tests
Canonical link: https://commits.webkit.org/319994@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications