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

Re: [CSS2.1] blocks with missing start bracket and parsing error

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Sun, 27 Mar 2011 01:51:52 +0100
To: Alan Gresley <alan@css-class.com>
Cc: CSS 3 W3C Group <www-style@w3.org>
Message-ID: <us1to6hcq515cki93bi3kipskuh9hc6qul@hive.bjoern.hoehrmann.de>
* Alan Gresley wrote:
>This time the pertinent CSS is this.
>     p { background: blue }
>     ]
>    .test1 { background: green }
>Currently all browser will show one blue line and one green line. Unlike 
>the 'missing end bracket' situation, we have a 'missing start bracket'. 
>My question is, what should happen?

If you can't cite a reason why this is unclear from the specification
and all the major implementation exhibit the same behavior then there
does not seem much reason to ask that question (you might request some
clarification why some behavior is correct or suggest an addition to
the test suite if you think the case merits that).

Anyway, there is nothing special about `]` here. In the context above
you are essentially parsing a selector which does not allow `]` as the
leading token, which invokes the rule for "Malformed statements", that
is, you read until the end of the statement, which is at the white
space after the second `}` and drop the whole thing (and continue with
the next statement that follows, giving you the behavior you mention).
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Sunday, 27 March 2011 00:52:21 UTC

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