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

Re: [CSS 2.1] General at-blocks and error recovery

From: Brad Kemper <brkemper@comcast.net>
Date: Sun, 27 Jan 2008 14:11:31 -0800
Message-Id: <E4DA0E07-BAD2-48F7-A554-5AF5CA4D2A9C@comcast.net>
Cc: "www-style@w3.org Style" <www-style@w3.org>
To: Justin Rogers <justrog@microsoft.com>

On Jan 27, 2008, at 1:40 PM, Justin Rogers wrote:

> @1 starts error recovery for selectors
> { opens a block of type brace
> [ opens a block of type bracket
> } invalid token
> div { color: green; } /* all still in error recovery. Our top of  
> the token stack is a bracket which we havenít matched */
> Adding a bracket after the closing brace closes the bracket scope,  
> but still does not satisfy the brace scope. The final } in the file  
> after color: green; is where we finally close the scope and error  
> recovery is complete. This means the following file should work:
>    @1 { [ } ]
>             div { color:green;}
>                 div  { color: green; } /* The last rule eaten was  
> the first div selector above, while Iím safe */

That makes sense, except that FireFox never recovers from that either  
in my tests. As near as I could tell, no number, combination, or  
placement of closing braces and/or brackets after the first closing  
brace would help FireFox recover (although I didn't spend the time to  
test exhaustively). Perhaps it is a bug then, and maybe just in 3.0b2.

> For Brad in regards to IEÖ I would ask that IE be left out of  
> syntax discussions for now, since the legacy behavior would likely  
> be an impediment to moving forwards. Further, the error recovery is  
> designed around common mistakes people made and not so much around  
> the error recovery as detailed by the spec. Most of which comes  
> from shipping the parser before the spec was complete in most cases  
> and then having to continue to support the bad syntax moving forward.

OK, that's reasonable. I was just curious if IE was able to recover,  
since both IE6 and IE7 seemed to be able to successfully skip past @- 
rules that I've written in the past (including @-rules that were not  
part of its vocabulary).

Not closing a left bracket seems like an easy fumble for an author to  
Received on Sunday, 27 January 2008 22:11:46 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:33 UTC