[webkit-changes] [WebKit/WebKit] 11c573: Serialization and equality comparison of CSS numbe...
Antti Koivisto
noreply at github.com
Thu Feb 22 12:14:48 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 11c57336e700b00fa2a46d465be30274518e0816
https://github.com/WebKit/WebKit/commit/11c57336e700b00fa2a46d465be30274518e0816
Author: Antti Koivisto <antti at apple.com>
Date: 2024-02-22 (Thu, 22 Feb 2024)
Changed paths:
M LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid-relative-color-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-style-serialization-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/custom-property-style-queries-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/css/cssom/serialize-custom-props-expected.txt
M Source/WebCore/css/CSSCustomPropertyValue.cpp
M Source/WebCore/css/CSSPropertyRule.cpp
M Source/WebCore/css/CSSVariableData.cpp
M Source/WebCore/css/CSSVariableData.h
M Source/WebCore/css/CSSVariableReferenceValue.cpp
M Source/WebCore/css/parser/CSSParserToken.cpp
M Source/WebCore/css/parser/CSSParserToken.h
M Source/WebCore/css/parser/CSSParserTokenRange.cpp
M Source/WebCore/css/parser/CSSParserTokenRange.h
Log Message:
-----------
Serialization and equality comparison of CSS number tokens in custom properties should use the original string
https://bugs.webkit.org/show_bug.cgi?id=269910
rdar://123435602
Reviewed by Matthieu Dubet.
Custom property value "0.10" should serialize as such and not as "0.1". Also they shouldn't compare equal.
* LayoutTests/imported/w3c/web-platform-tests/css/css-color/parsing/color-valid-relative-color-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-style-serialization-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/custom-property-style-queries-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/cssom/serialize-custom-props-expected.txt:
* Source/WebCore/css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::customCSSText const):
* Source/WebCore/css/CSSPropertyRule.cpp:
(WebCore::CSSPropertyRule::initialValue const):
* Source/WebCore/css/CSSVariableData.cpp:
(WebCore::CSSVariableData::serialize const):
Use the custom property serialization mode.
* Source/WebCore/css/CSSVariableData.h:
* Source/WebCore/css/CSSVariableReferenceValue.cpp:
(WebCore::CSSVariableReferenceValue::customCSSText const):
* Source/WebCore/css/parser/CSSParserToken.cpp:
(WebCore::CSSParserToken::originalText const):
(WebCore::CSSParserToken::operator== const):
Use string equality for numbers. This is used for custom properties only.
(WebCore::CSSParserToken::serialize const):
Add a separate serialization mode for custom properties. It returns the original string for number values.
It will later also preserve whitespace.
* Source/WebCore/css/parser/CSSParserToken.h:
* Source/WebCore/css/parser/CSSParserTokenRange.cpp:
(WebCore::CSSParserTokenRange::serialize const):
* Source/WebCore/css/parser/CSSParserTokenRange.h:
Serialize the original text.
Canonical link: https://commits.webkit.org/275196@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