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

[css3-syntax] non-preserved tokens

From: Cameron McCormack <cam@mcc.id.au>
Date: Mon, 26 Nov 2012 16:04:26 +1100
Message-ID: <50B2F85A.2030803@mcc.id.au>
To: "www-style@w3.org" <www-style@w3.org>
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.
Received on Monday, 26 November 2012 05:04:59 GMT

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