On 26/03/2011 4:26 PM, Philippe Wittenbergh wrote:

Basically, in both cases you have an invalid  selector p
[background: blue} .test1 and everything is ignored until the 1st
instance of 'green}'

The 1st valid selector after p{} is .test2


For those following at home: Following a discussion on the WW-style
mailing list, the above is not correct. Based on latest revisions of
the CSS 2.1 spec,
the specification to require {[()]} matching when parsing
selectors

<http://lists.w3.org/Archives/Public/www-style/2011Mar/0579.html>

This means that given p [background: blue} /* mismatched opening '['
*/ .test1 { /*property:value*/ } .test2 { /*property:value*/ }

the whole of the stylesheet that follows the mismatched opening '['
will be thrown out. That is the behaviour of IE 8&  9 and will be the
behaviour of a future version of Firefox.

(and the CSS validator will need to be updated to match the spec
revision…)

Philippe -- Philippe Wittenbergh http://l-c-n.com/


Yes. This CSS,

   [
   p { background: orange }
   p { background: red }


should be treated the same as this,


   [
   p { background: orange }
   p { background: red }
   ]


or more precisely as an unrecognizable string.


   [ .... ]


So the rest of the stylesheet is thrown out. The premise is that the onus is on the author to have valid CSS instead of the current situation of browsers fixing invalid CSS by following the current rules of handling parsing errors in the specs.

IE8 and IE9 behavior of throwing the remainder of the stylesheet will assist CSS authors in hunting down CSS coding errors. The new behavior are in these two test cases.


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

<http://css-class.com/test/css21testsuite/blocks-036.xht>


The background should be green as is seen in IE8 and IE9.




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

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to