Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9208303fc946c2789e84139920e390bdacc31901
      
https://github.com/WebKit/WebKit/commit/9208303fc946c2789e84139920e390bdacc31901
  Author: Antti Koivisto <[email protected]>
  Date:   2026-03-26 (Thu, 26 Mar 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    M LayoutTests/fast/css/attr-parsing-expected.txt
    M LayoutTests/fast/css/attr-parsing.html
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-all-types-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-argument-grammar-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-argument-grammar.html
    M 
LayoutTests/imported/w3c/web-platform-tests/css/cssom/serialize-values-expected.txt
    M Source/WebCore/css/parser/CSSSubstitutionParser.cpp
    M Source/WebCore/style/StyleSubstitutionResolver.cpp
    M Source/WebCore/style/StyleSubstitutionResolver.h

  Log Message:
  -----------
  [css-values-5 attr()] Implement in terms of argument grammar
https://bugs.webkit.org/show_bug.cgi?id=310794
rdar://173390268

Reviewed by Alan Baradlay (OOPS\!).

Some substitution functions including attr() are specified in terms argument 
grammar which allows arguments to
be substituted before the real grammar is applied.

https://drafts.csswg.org/css-values-5/#early-resolution

For attr() the grammar is

<attr-args> = attr( <declaration-value>, <declaration-value>? )

* LayoutTests/TestExpectations:

This was a spurious pass, namespaces are not implemented yet.

* LayoutTests/fast/css/attr-parsing-expected.txt:
* LayoutTests/fast/css/attr-parsing.html:

Update the expectation. We don't validate attr() arguments during parsing 
anymore.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-all-types-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-argument-grammar-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/attr-argument-grammar.html:
* 
LayoutTests/imported/w3c/web-platform-tests/css/cssom/serialize-values-expected.txt:
* Source/WebCore/css/parser/CSSSubstitutionParser.cpp:
(WebCore::isValidAttrReference):

Implement validation in terms of argument grammar. This is much simpler than 
the full grammar.

* Source/WebCore/style/StyleSubstitutionResolver.cpp:
(WebCore::Style::SubstitutionResolver::substituteAttrArgumentGrammar):

Split the arguments on comma and run generic substitution for the first.

(WebCore::Style::SubstitutionResolver::substituteAttrFunction):

Invoke the argument grammar parsing first.

* Source/WebCore/style/StyleSubstitutionResolver.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to