Re: [csswg-drafts] [css-values] Spec does not reject duplicate `<request-url-modifier>`s, but WPT does (#12151)

Sorry I realize this late but `url(img.avif foo crossorigin(anonymous) bar())` would be entirely invalid with the proposed syntax.

So repeating unkown modifiers should be allowed for future additions to known modifiers, but known modifiers should (presumably) not be allowed to repeat... 

Hard-coding both requirements could be translated with `[ <ident> | <function-token> <any-value>? ) ]+ || <request-url-modifier> || [ <ident> | <function-token> <any-value>? ) ]+`. Obviously, if other CSS types of known modifiers should be added, this would become unreadable.

Now with some hindsight...

  > I don't think duplicate modifiers make sense

Many CSS values can repeat in a stylesheet, with the last occurrence taking precedence. The only other place I can think of where repeating a value is forbidden (in prose) is `@function` parameter list. If url modifiers cannot repeat, this seems simpler to specify in prose, imo.

I do not see how serializing modifiers in alphabetic order is useful but I have no strong opinion on whether it should not be enforced.

-- 
GitHub Notification of comment by cdoublev
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12151#issuecomment-2998903057 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 24 June 2025 05:47:36 UTC