Skip to content

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

@cdoublev

Description

@cdoublev

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 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closed as Question AnsweredUsed when the issue is more of a question than a problem, and it's been answered.css-syntax-3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions