Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7f655a4e9f5df4f6278acbe61596f8e641b06d83
https://github.com/WebKit/WebKit/commit/7f655a4e9f5df4f6278acbe61596f8e641b06d83
Author: sakupi01 <[email protected]>
Date: 2026-07-05 (Sun, 05 Jul 2026)
Changed paths:
M Source/WebCore/css/CSSCounterStyleDescriptors.cpp
M Source/WebCore/css/CSSCustomIdentValue.cpp
M Source/WebCore/css/CSSValue.cpp
M Source/WebCore/css/CSSValueKeywords.in
M Source/WebCore/css/CSSViewTransitionRule.cpp
M Source/WebCore/css/ShorthandSerializer.cpp
M Source/WebCore/css/calc/CSSCalcTree+Serialization.cpp
M Source/WebCore/css/deprecated-cssom/DeprecatedCSSOMPrimitiveValue.cpp
M Source/WebCore/css/parser/CSSPropertyParserConsumer+Ident.cpp
M Source/WebCore/css/parser/CSSPropertyParserConsumer+ViewTransition.cpp
M Source/WebCore/css/typedom/CSSStyleValueFactory.cpp
M Source/WebCore/css/values/primitives/CSSCustomIdent.cpp
M Source/WebCore/css/values/primitives/CSSCustomIdent.h
M Source/WebCore/style/StyleBuilder.cpp
M Source/WebCore/style/values/primitives/StyleCustomIdent.cpp
Log Message:
-----------
Extend CSS::CustomIdent to support an unresolved ident() function alternative
https://bugs.webkit.org/show_bug.cgi?id=284895
Reviewed by Tim Nguyen.
Change CSS::CustomIdent's representation from a plain AtomString to
Variant<AtomString, IdentFunction>, where IdentFunction models
<ident()> = ident( <ident-arg>+ ), <ident-arg> = <string> | <integer> | <ident>
(https://drafts.csswg.org/css-values-5/#ident). Arguments are stored
unmerged so that the specified value serializes back in function form,
as required by WPT. Resolution happens in ToStyle<CSS::CustomIdent>,
which evaluates <integer> arguments (including math functions) with
BuilderState context and concatenates the argument codepoints.
Remove CustomIdent::tryResolved(), as no call site needs eager
resolution. The @counter-style/@view-transition descriptor converters
use only the plain identifier alternative, since ident() is invalid in
descriptors per the CSSWG resolution "ident() is only valid within an
element context" (https://github.com/w3c/csswg-drafts/issues/12219); a
FIXME in consumeUnresolvedCustomIdent() records the parser-side
rejection needed once ident() parsing lands.
ShorthandSerializer::valueIDIncludingCustomIdent() likewise checks only
the plain identifier alternative, because the animation-name
disambiguation is about lexical ambiguity of the serialized text, which
the ident() function form can never cause. The deprecated CSSOM string
accessors return the plain identifier, falling back to the
function-form serialization.
No behavior change: nothing constructs the new alternative yet. All
code that read CustomIdent's string directly was updated to handle the
unresolved alternative explicitly.
Also add a CSSCustomIdentValue case to
CSSValue::collectComputedStyleDependencies so that a future ident()
with computed-value-time dependencies is correctly rejected in
computationally independent contexts (@property initial values).
* Source/WebCore/css/CSSCounterStyleDescriptors.cpp:
(WebCore::symbolFromCSSValue):
(WebCore::fallbackNameFromCSSValue):
(WebCore::extendsSystemAndFirstSymbolValueFromStyleProperties):
* Source/WebCore/css/CSSCounterValue.cpp:
(WebCore::CSSCounterValue::customCSSText):
* Source/WebCore/css/CSSCustomIdentValue.cpp:
(WebCore::CSSCustomIdentValue::stringValue):
* Source/WebCore/css/CSSValue.cpp:
(WebCore::CSSValue::collectComputedStyleDependencies):
* Source/WebCore/css/CSSValueKeywords.in:
* Source/WebCore/css/CSSViewTransitionRule.cpp:
(WebCore::StyleRuleViewTransition::StyleRuleViewTransition):
* Source/WebCore/css/DeprecatedCSSOMPrimitiveValue.cpp:
(WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue):
* Source/WebCore/css/ShorthandSerializer.cpp:
(WebCore::ShorthandSerializer::valueIDIncludingCustomIdent):
* Source/WebCore/css/calc/CSSCalcTree+Serialization.cpp:
(WebCore::CSSCalc::serializeMathFunctionArguments):
(WebCore::CSSCalc::serializeCalculationTree):
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Ident.cpp:
(WebCore::CSSPropertyParserHelpers::consumeUnresolvedCustomIdent):
(WebCore::CSSPropertyParserHelpers::consumeUnresolvedCustomIdentExcluding):
(WebCore::CSSPropertyParserHelpers::consumeUnresolvedDashedIdent):
* Source/WebCore/css/parser/CSSPropertyParserConsumer+ViewTransition.cpp:
(WebCore::CSSPropertyParserHelpers::consumeViewTransitionTypes):
* Source/WebCore/css/typedom/CSSStyleValueFactory.cpp:
(WebCore::CSSStyleValueFactory::reifyValue):
* Source/WebCore/css/values/primitives/CSSCustomIdent.cpp:
(WebCore::CSS::CustomIdent::isNull):
(WebCore::CSS::CustomIdent::startsWith):
(WebCore::CSS::CustomIdent::operator==):
(WebCore::CSS::Serialize<IdentFunctionIdent>::operator()):
(WebCore::CSS::Serialize<CustomIdent>::operator()):
(WebCore::CSS::ComputedStyleDependenciesCollector<CustomIdent>::operator()):
(WebCore::CSS::CSSValueChildrenVisitor<CustomIdent>::operator()):
(WebCore::CSS::operator<<):
(WebCore::CSS::add):
* Source/WebCore/css/values/primitives/CSSCustomIdent.h:
* Source/WebCore/style/StyleBuilder.cpp:
(WebCore::Style::Builder::applyProperty):
* Source/WebCore/style/values/primitives/StyleCustomIdent.cpp:
(WebCore::Style::ToStyle<CSS::CustomIdent>::operator()):
Canonical link: https://commits.webkit.org/316524@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications