[css3-syntax] non-preserved tokens

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 UTC