W3C home > Mailing lists > Public > www-style@w3.org > February 2003

Comments in selectors: CSS1 versus later

From: Etan Wexler <ewexler@stickdog.com>
Date: 14 Dec 2003 21:00 +0700
To: www-style@w3.org
Message-ID: <comments-in-selectors@d20030214.etan.wexler>

In CSS1, comments in selectors act like spaces because they
reset the tokenizing context to 0
(<http://www.w3.org/TR/1999/REC-CSS1-19990111#appendix-b>). Thus
the selector

{type/* */#ID}

yields the tokens (IDENT, HASH) and parses as two instances of
simple_selector. Contrast this with the selector

{type#ID}

which yields the tokens (IDENT, HASH_AFTER_IDENT) and parses as
one instance of simple_selector.

According to the prose in Section 1.7, "Comments"
(<http://www.w3.org/TR/REC-CSS1#comments>), this behavior is not
an error:

    "For a CSS1 parser, a comment is equivalent to whitespace."

However, this behavior differs from that of CSS2 and later, in
which a comment may appear inside a simple selector ("sequence
of simple selectors" in CSS3) without changing the meaning.

The Working Group should add to CSS2.1 to mention this
difference.

Is this issue worth flagging for change in some possible later
revision of CSS1?

-- 
Etan Wexler.
Dead Kennedys meet Destiny's Child? Let's party!
Received on Friday, 14 February 2003 22:52:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:19 GMT