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

On Mar 8, 2008, at 7:09 PM, Justin Rogers wrote:

> An at-rule consists of everything up to and including the next  
> semicolon (;) or the next block, whichever comes first.
> <<<
> @media all { @ }
> div { color: green; }
> I think the sticky point for this test case is what takes priority  
> in error recovery. The open parenthesis starts a block which is  
> owned by the @media. The closing parenthesis should close the block  
> because it is currently the only open block and we found a matching  
> closing character. We may do this while we are in error recovery  
> for something else like a selector though. So, does error recovery  
> stop once your parent block is closed? I don't think we should  
> trump the higher level rules of matching blocks because we find a  
> syntactic issue with the internals of the block itself since at- 
> rule's hold blocks and blocks hold any. If it can hold any, then it  
> also means it could hold just an asterisk and nothing more. So when  
> we think we are in error recovery for a selector we should also be  
> aware that we may have to short circuit because the block  
> containing the selector is closed.

That seems sensible to me. When I look at "@media all { @ }" my  
common sense tells me that there is a closed @media block there, with  
nonsense inside the block that should be ignored. So it would be nice  
if the spec reflected my expectations.

Received on Monday, 10 March 2008 03:52:52 UTC