[webkit-changes] [WebKit/WebKit] 6dabb8: [@property] Fallback that does not match syntax sh...

Antti Koivisto noreply at github.com
Sun Jan 1 11:25:24 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6dabb8f934a3f64c639eb12d8c24ddea1c16101e
      https://github.com/WebKit/WebKit/commit/6dabb8f934a3f64c639eb12d8c24ddea1c16101e
  Author: Antti Koivisto <antti at apple.com>
  Date:   2023-01-01 (Sun, 01 Jan 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt
    M Source/WebCore/css/CSSVariableReferenceValue.cpp
    M Source/WebCore/css/CSSVariableReferenceValue.h
    M Source/WebCore/css/parser/CSSPropertyParser.cpp
    M Source/WebCore/css/parser/CSSPropertyParser.h

  Log Message:
  -----------
  [@property] Fallback that does not match syntax should make var() invalid
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




More information about the webkit-changes mailing list