[webkit-changes] [WebKit/WebKit] 445f89: [CSS] Fix the parsing of custom property as ambigu...

Matthieu Dubet noreply at github.com
Thu Jul 18 15:43:37 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 445f89c8ea16f77a134149f21e3aacb400704ade
      https://github.com/WebKit/WebKit/commit/445f89c8ea16f77a134149f21e3aacb400704ade
  Author: Matthieu Dubet <m_dubet at apple.com>
  Date:   2024-07-18 (Thu, 18 Jul 2024)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/custom-property-rule-ambiguity-expected.txt
    M Source/WebCore/css/parser/CSSParserImpl.cpp
    M Source/WebCore/css/parser/CSSTokenizer.cpp

  Log Message:
  -----------
  [CSS] Fix the parsing of custom property as ambiguous rule
https://bugs.webkit.org/show_bug.cgi?id=276302
rdar://131274469

Reviewed by Tim Nguyen.

This patch makes parsing of "something that look like a custom property"
fails with a more useful error recovery : until the end of the declaration
or until the end of the rule.

https://drafts.csswg.org/css-syntax/#consume-qualified-rule

If the first two non-<whitespace-token> values of rule’s prelude are an <ident-token> whose value starts with "--" followed by a <colon-token>, then:
    If nested is true, consume the remnants of a bad declaration from input, with nested set to true, and return nothing.
    If nested is false, consume a block from input, and return nothing.

* LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/custom-property-rule-ambiguity-expected.txt:
* Source/WebCore/css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeQualifiedRule):

Canonical link: https://commits.webkit.org/281108@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