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

Re: [css3-syntax] non-preserved tokens

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 26 Nov 2012 10:16:02 -0800
Message-ID: <CAAWBYDBovf0LsFxKNSDGWr0b08x75No1CPHLweXez2QNHdbPKw@mail.gmail.com>
To: Cameron McCormack <cam@mcc.id.au>
Cc: "www-style@w3.org" <www-style@w3.org>
On Sun, Nov 25, 2012 at 9:04 PM, Cameron McCormack <cam@mcc.id.au> wrote:
> css3-syntax says that a primitive is a preserved token, a function or a
> simple block, and that a preserved token is any except for:
>
>   function, bad-string, bad-url, [, (, {
>
> In the tree construction algorithm, often the "consume a primitive"
> definition is invoked, and that doesn't say what to do with a token that
> isn't a primitive.
>
> For example if my style sheet is:
>
> <style>@supports (font-family:'Helvetica
> ){}</style>
>
> this would generate the following sequence of tokens:
>
>   at-keyword
>   whitespace
>   (
>   ident
>   colon
>   bad-string
>   whitespace
>   )
>   {
>   }
>   end-of-file
>
> which will result in the tree construction algorithm being in the "at-rule
> prelude" mode when it encounters the bad-string.  In that mode, the
> "anything else" branch is chosen, which says to "consume a primitive", and
> in those steps the last branch is chosen, which is just "return the current
> input token", even though the token is not a preserved token (or a
> primitive).  This contradicts the note earlier in section 3.5 that says only
> preserved tokens will be in the output tree.

You're right!  Bad me.  I already need to do a review and fix up the
places where EOF isn't properly handled in tree-construction; I'll
make sure to handle non-preserved tokens as well.

~TJ
Received on Monday, 26 November 2012 18:16:53 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:03 GMT