New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[@property] Fallback that does not match syntax should make var() invalid #8116
Conversation
EWS run on current version of this PR (hash 9edf1da) |
return nullptr; | ||
|
||
return CSSVariableData::create(resolvedTokens); | ||
return CSSVariableData::create(*resolvedTokens); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems unfortunate we have to copy here. Can we add a CSSVariableData::create() overload that takes an r-value and move the resolved tokens in? Or does the processing done in CSSVariableData's constructor make this a meaning less optimization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something to do separately. I did notice it and wondered about the same things you did.
β¦alid https://bugs.webkit.org/show_bug.cgi?id=249981 rdar://103799338 Reviewed by Sam Weinig. The fallback value must match the syntax definition of the custom property being referenced, otherwise the declaration is invalid at computed-value time. https://drafts.css-houdini.org/css-properties-values-api/#fallbacks-in-var-references * LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: * Source/WebCore/css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::resolveVariableFallback const): Check the syntax of the fallback. (WebCore::CSSVariableReferenceValue::resolveVariableReference const): (WebCore::CSSVariableReferenceValue::resolveTokenRange const): (WebCore::CSSVariableReferenceValue::resolveVariableReferences const): (WebCore::CSSVariableReferenceValue::resolveVariableFallback): Deleted. (WebCore::CSSVariableReferenceValue::resolveVariableReference): Deleted. (WebCore::CSSVariableReferenceValue::resolveTokenRange): Deleted. Make these non-static (so parser context is available) and did some return value cleanup. * Source/WebCore/css/CSSVariableReferenceValue.h: * Source/WebCore/css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::isValidCustomPropertyValueForSyntax): * Source/WebCore/css/parser/CSSPropertyParser.h: Canonical link: https://commits.webkit.org/258373@main
9edf1da
to
6dabb8f
Compare
Committed 258373@main (6dabb8f): https://commits.webkit.org/258373@main Reviewed commits have been landed. Closing PR #8116 and removing active labels. |
6dabb8f
9edf1da
π§ͺ api-macπ§ͺ gtk-wk2π§ͺ mac-wk1π§ͺ mac-wk2π§ͺ mac-wk2-stress