W3C home > Mailing lists > Public > www-style@w3.org > November 2007

Re: how should this invalid CSS be parsed?

From: Stewart Brodie <stewart.brodie@antplc.com>
Date: Mon, 5 Nov 2007 10:54:16 +0000
To: www-style@w3.org
Message-ID: <7c4bc82dbe55fc2250164d7ea68ba9d44250e109@localhost>

Christof Hoeke <csad7@t-online.de> wrote:

> 
> hi,
> I have the following CSS
> 
>      a {x:1}
>      }
>      b{y:2}
>      c{z:3}
> 
> The specification says (as I remember) that if an error is found it is 
> resolved with the next valid block.
> 
> So I thought the CSS above should be equivalent to:
> 
>      a {x:1}
>      c{z:3}
> 
> Browsers on the other hand seem to simple remove the "}" and the CSS 
> would be equivalent to
> 
>      a {x:1}
>      b{y:2}
>      c{z:3}
> 
> Which is right (according the specification intend)?

CSS 2.1 states that the behaviour here is undefined - presumably implying
that either interpretation is acceptable.

The old working draft document CSS 3 Syntax claims that the second
interpretation is required (on the basis of it not being parsable according
to the grammar, and therefore the fewest characters must be removed).

Presumably, this particular error can only occur with the '}' character?

-- 
Stewart Brodie
Software Engineer
ANT Software Limited
Received on Monday, 5 November 2007 10:54:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:56 GMT