Re: @import -- allow at any place in stylesheet.

19.01.2012, 05:45, "Alan Gresley" <alan@css-class.com>:
> On 19/01/2012 8:26 AM, Marat Tanalin | tanalin.com wrote:
>
>> š18.01.2012, 21:58, "Sylvain Galineau"<sylvaing@microsoft.com>:
>>> šThen provide one or more real-world example demonstrating all this will happen
>>> šand explain why. General assertions are insufficient.
>> šSee http://lists.w3.org/Archives/Public/www-style/2012Jan/0760.html
>
> Tab gave an alternative method for this.
>
> <style>
> @import "main.css";
> @import "override.css";
> </style>
>
> This does make sense considering how error recovery is handled in CSS
> (the same even happens in IE6). Take for instance the below test case.
> Here are some questions.
>
> 1. Do you know why only some of the <p>s have a green background?
>
> 2. Even though something has gone wrong, do you expect that the
> "override.css" would still work?
>
> (this would not come into play with Tab's alternative method)
>
> <!DOCTYPE html>
>
> <style type="text/css">
> p { background: red; color: white }
> #t1 { background: green } #t2 { background: green } #t3 { background:
> green } #t4 { background: green } #t5 { background: green #t6 {
> background: green } #t7 { background: green } #t8 { background: green }
> #t9 { background: green }
>
> @import "override.css";
> </style>
>
> <p id="t1">Some text</p>
> <p id="t2">Some more text</p>
> <p id="t3">Some more text</p>
> <p id="t4">Some more text</p>
> <p id="t5">Some more text</p>
> <p id="t6">Some more text</p>
> <p id="t7">Some more text</p>
> <p id="t8">Some more text</p>
> <p id="t9">Some more text</p>
>
> --
> Alan Gresley
> http://css-3d.org/
> http://css-class.com/

CSS in your example is invalid, so it's quite logical to expect that all after "invalid point" (missing closing brace for #t5 rule) including invalid declaration (background: green #t6...) should be ignored.

Received on Thursday, 19 January 2012 12:45:33 UTC