[CSS2.1] escapes, characters and parsing

Hello list,

I have be reading CSS2.1 4 'Syntax and basic data types' over and over 
and especially the parts of characters [1] and parsing errors [2]. I 
have searched the list archives and didn't find much discussion. This 
message arises due to many test I have carried out with escapes. These 
include escapes preceding identifiers and trialing escapes in 
delectation strings and anywhere else in CSS statement. The current CSS 
testsuite does not have test with escapes that are like the test I have 
done.

Here is one test case.

<http://css-class.com/test/css21testsuite/escapes-031.xht>


I have not broken it down to it's basic parts since I do not know quite 
what should be happening as it stands. The pertinent CSS is here.


    \p { background: green; }

    \* { background: gray; }

    body \2a { background: red; }


I presume that IE9, Opera 11, FF 3.6, FF 4b all parse this correctly. 
WebKit thought does something very different and remarkably the last 
rule-set (starting with 'body') is applied twice to one <p> and one 
<div> and the second  rule-set (starting with '\*') is applied to <body>.


Another test case.

<http://css-class.com/test/css21testsuite/escapes-032.xht>


I not sure if I have it all wrong but FF 3.6 and FF 4b parse this as a 
valid token strings.


    p, div { background:green; color: white }
    \ and "line feed" (U+000A)
    div { background:red }


Note also that FF 3.6 and FF 4b has the text for the <div> black. I'm 
aware that if there is no line feed following the escape such as this,


    \div { background:red }


all browsers that I have checked see this as a valid rule-set.



1. <http://www.w3.org/TR/CSS21/syndata.html#characters>
2. <http://www.w3.org/TR/CSS21/syndata.html#parsing-errors>



-- 
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo

Received on Thursday, 24 March 2011 15:36:50 UTC