RE: [CSS2.1] Grammar for @media versus general block parsing

The grammar needs at least at-rule added but I agree that making it stylesheet would be really bad. As an implementer it makes no sense for me to go into at-rule error recovery or at-rule parsing inside of the media block if the grammar doesn't even allow the construct to exist. Of course, this is why this discussion started because IE/Opera read the grammar to disallow at-rule altogether and so go into rule-set error recovery whenever something is seen that isn't understood.

Grammar wise adding at-rule will force me to put in code to process at-rule's within the media block. Spec wise saying that at-rules are to be ignored if present (and consequently that at-rule error recovery should be used on a syntax error and not rule-set error recovery) will make the forward compatible stuff work as expected.

Justin Rogers [MSFT]

-----Original Message-----
From: www-style-request@w3.org [mailto:www-style-request@w3.org] On Behalf Of fantasai
Sent: Thursday, July 03, 2008 4:09 PM
To: Bjoern Hoehrmann
Cc: www-style@w3.org
Subject: Re: [CSS2.1] Grammar for @media versus general block parsing


Bjoern Hoehrmann wrote:
> * fantasai wrote:
>> Proposal:
>>   Change 'ruleset' to 'stylesheet' in the @media grammar.
>>   State in 7.2.1 that "At-rules inside @media are invalid in CSS2.1
>>   and must be ignored per 4.2 Rules for handling parsing errors."
>
> That would allow CDO and CDC in @media which is probably not intended. I
> tested this when the issue came up, I think only IE6 had interesting be-
> havior for this case.

So would only making the change in 7.2.1 and not changing
the grammar be adequate?

~fantasai

Received on Friday, 4 July 2008 19:12:16 UTC