[webkit-changes] [WebKit/WebKit] aca859: [@property] Validate universal syntax initial valu...

Antti Koivisto noreply at github.com
Wed Dec 21 11:34:25 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: aca85912a52befcceed52e1055a2de75b303765e
      https://github.com/WebKit/WebKit/commit/aca85912a52befcceed52e1055a2de75b303765e
  Author: Antti Koivisto <antti at apple.com>
  Date:   2022-12-21 (Wed, 21 Dec 2022)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt
    M Source/WebCore/css/CSSCustomPropertyValue.cpp
    M Source/WebCore/css/CSSCustomPropertyValue.h
    M Source/WebCore/css/DOMCSSRegisterCustomProperty.cpp
    M Source/WebCore/css/StyleRule.h
    M Source/WebCore/css/parser/CSSParserImpl.cpp
    M Source/WebCore/css/parser/CSSPropertyParser.cpp
    M Source/WebCore/css/parser/CSSPropertyParser.h
    M Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
    M Source/WebCore/css/parser/CSSPropertyParserHelpers.h
    M Source/WebCore/css/parser/CSSVariableParser.cpp
    M Source/WebCore/css/parser/CSSVariableParser.h
    M Source/WebCore/style/CustomPropertyRegistry.cpp

  Log Message:
  -----------
  [@property] Validate universal syntax initial value as <declaration-value>
https://bugs.webkit.org/show_bug.cgi?id=249708
rdar://103595129

Reviewed by Dean Jackson.

Initial value for "*" syntax can't be quite any token sequence.

* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt:
* Source/WebCore/css/CSSCustomPropertyValue.h:
* Source/WebCore/css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::containsCSSWideKeyword const):

Simplify. Only the simple case is needed.

(WebCore::CSSCustomPropertyValue::asVariableData const):

Add a helper.

* Source/WebCore/css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
* Source/WebCore/css/StyleRule.h:
* Source/WebCore/css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumePropertyRule):
* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseTypedCustomPropertyInitialValue):

Add a separate function for initial value parsing.

* Source/WebCore/css/parser/CSSPropertyParser.h:
* Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumePropertyInitialValue):

Consume property as <declaration-value>.

* Source/WebCore/css/parser/CSSPropertyParserHelpers.h:
* Source/WebCore/css/parser/CSSVariableParser.cpp:
(WebCore::CSSVariableParser::parseInitialValueForUniversalSyntax):

Add a helper that also verifies no var() is being used.

* Source/WebCore/css/parser/CSSVariableParser.h:
* Source/WebCore/style/CustomPropertyRegistry.cpp:
(WebCore::Style::CustomPropertyRegistry::registerFromStylesheet):

Also return an explicit "guaranteed-invalid" value instead of a null. This doesn't change behavior.

Canonical link: https://commits.webkit.org/258204@main




More information about the webkit-changes mailing list