W3C home > Mailing lists > Public > www-style@w3.org > November 2008

Re: [CSS21] minor issue: location of comment tokens

From: Jorrit Vermeiren <mercator+w3c@gmail.com>
Date: Thu, 27 Nov 2008 22:06:27 +0100
Message-ID: <bd6e15d00811271306n9765ea9y90412c04cf0731fb@mail.gmail.com>
To: "Bert Bos" <bert@w3.org>, fantasai <fantasai.lists@inkedblade.net>
Cc: "W3C style mailing list" <www-style@w3.org>

On Thu, Nov 27, 2008 at 17:00, Bert Bos <bert@w3.org> wrote:
> On Tuesday 25 November 2008 16:40, L. David Baron wrote:
>> We might still want to make it clear in the prose that a comment
>> can't appear in the middle of a token without causing it to be two
>> tokens.
(...)
> In that case we'll have to make the text longer instead of shorter :-(
> How about the following? In 4.1[1], after
>
>    COMMENT tokens do not occur in the grammar (to keep it readable),
>    but any number of these tokens may appear anywhere between other
>    tokens
>
> add this phrase and note:
>
>    or at the start or end of a style sheet. (Note, however, that
>    a comment before @charset[2] disables the @charset.)
>
> [1] http://www.w3.org/TR/2007/CR-CSS21-20070719/syndata.html#syntax
> [2] http://www.w3.org/TR/2007/CR-CSS21-20070719/syndata.html#charset


On Thu, Nov 27, 2008 at 20:54, fantasai <fantasai.lists@inkedblade.net> wrote:
> "disable" isn't quite the right word. The @charset is invalid (and therefore
> the stylesheet is invalid) if a comment appears either before or within the
> @charset statement. You need a normative exception
>
>  EXCEPT they may not appear before or within an @charset statement.

If I understand the specification ([2] as linked to by Bert, see quote
above) correctly, the @charset doesn't become invalid, but is simply
ignored. In 4.4:

    "Except as specified in these rules, all @charset rules are ignored."

The stylesheet would only become invalid if the @charset being ignored
means it can no longer be decoded. But that's already covered in 4.4
as well, and that's what the note would warn about:

    "User agents must ignore style sheets in unknown encodings."


How about changing the paragraph to this?

    COMMENT tokens do not occur in the grammar (to keep it readable),
    but any number of these tokens may appear anywhere outside other
    tokens. (Note, however, that a comment before or within the @charset
    rule disables the @charset.)


Jorrit
Received on Thursday, 27 November 2008 21:52:04 GMT

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