[csswg-drafts] [css-syntax-3] `url(` followed by comment(s) (#10125)

cdoublev has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-syntax-3] `url(` followed by comment(s) ==
In Chrome and FF (at least), `url(/**/"bg.jpg")` is invalid, and `url(/**/bg.jpg)` serializes as `url("/**/bg.jpg")`.

I could not find something equivalent to the following note from [CSS2](https://drafts.csswg.org/css2/#uri) in CSS Syntax 3:

  > COMMENT tokens do not occur in the grammar (to keep it readable), but any number of these tokens may appear anywhere outside other tokens.

Based on this note, I would expect `url(/**/"bg.jpg")` to be valid. However, according to this note (which may be usefull to reproduce in CSS Syntax 3, imo), also from CSS2, `/**/bg.jpg` must be seen as an invalid URL `<ident>`:

  > Note that COMMENT tokens cannot occur within other tokens: thus, "url(/*x*/pic.png)" denotes the URI "/*x*/pic.png", not "pic.png".

So I guess the first note does not apply anymore, ie. comment tokens can *usually* appear anywhere except in some places that you do not want to explicitly list.

And I cannot find any corresponding case on WPT.

If everything I said above is true and you think there is no need to clarify anything in CSS Syntax, this issue can be closed.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10125 using your GitHub account


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

Received on Saturday, 23 March 2024 12:53:43 UTC