Re: [CSS2.1] Clarification on section 4.1.3 and the application of escaped newlines to identifiers.

fantasai.lists@inkedblade.net wrote:
> The newline is a special character. It normally ends an identifier.
> If it is escaped, then it forms part of the identifier.

I don't think this is actually the case as the spec stands...  Here are 
the relevant parts of CSS2.1 section 4.1.1 (all the parts that mention \\):

   unicode  \\[0-9a-f]{1,6}(\r\n|[ \n\r\t\f])?
   escape   {unicode}|\\[^\n\r\f0-9a-f]
   string1  \"([^\n\r\f\\"]|\\{nl}|{escape})*\"
   string2  \'([^\n\r\f\\']|\\{nl}|{escape})*\'

So backslash followed by a newline doesn't actually match any of these 
productions.  In particular it most certainly doesn't match the 'escape' 
production, which it would need to do for the above to be true.

So as far as I can tell, a character stream in which newline follows 
backslash cannot be tokenized as a stylesheet at all, with the usual 
"behavior is undefined" thing that seems to trigger.

I do agree that having \\\n be treated as \00000A would make more sense, 
and if we awnt that we probably need to allow \\{nl} in nmchar and 
nmstart explicitly.

-Boris

Received on Thursday, 6 November 2008 01:43:25 UTC