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

Re: [CSS21] WD 4.1.6, 4.2: parsing of blocks

From: Alan Gresley <alan@css-class.com>
Date: Wed, 19 Jan 2011 18:00:28 +1100
Message-ID: <4D368C0C.40706@css-class.com>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
CC: www-style@w3.org
On 15/01/2011 6:56 AM, Boris Zbarsky wrote:
> On 1/8/11 8:03 AM, Alan Gresley wrote:

>> but in this malformed statement shows the color as red.
>>
>> p {color: red; font-weight: bold }
>> p {background:yellow
>> }{ p {color: red }
>> { p {color: green }
>> }{} p {color: blue; font-weight: bold }
>>
>>
>> { { } { { } } { }
>>
>>
>> I can't see why this later one should not be blue.
>
> There's no problem with parsing the first two lines. Then we hit a '{'
> in a context where we didn't expect it, so we start looking for the end
> of the statement, while matching braces/brackets/parens. So the end of
> the statement can't happen before the corresponding '}'. In this case
> that never gets found, actually; we hit end of stylesheet first. So
> everything after that first '{' in line 3 is ignored.
>
> -Boris


Thank you for you reply Boriz. I believe that the below examples should 
be also given in the section on "Unexpected end of style sheet" in 4.2. 
Atm there are just examples for @rule.


Example 1.

   p {
     color: green;
   }
   {
   p {
     color: red;
   }


Example 2.

   p {
     color: green;
   }
   }
   p {
     color: red;
   }



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

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
Received on Wednesday, 19 January 2011 07:02:02 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:36 GMT