W3C home > Mailing lists > Public > www-style@w3.org > March 2011

[CSS2.1] escapes, characters and parsing

From: Alan Gresley <alan@css-class.com>
Date: Fri, 25 Mar 2011 02:36:15 +1100
Message-ID: <4D8B64EF.2000600@css-class.com>
To: CSS 3 W3C Group <www-style@w3.org>
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 

Here is one test case.


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.


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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:44 UTC