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

fantasai wrote:
> Bert Bos wrote:
>>
>>> Revised proposal:
>>>     State in 7.2.1 that "At-rules inside @media are invalid in
>>>     CSS2.1. Invalid at-rules inside @media blocks must be ignored
>>>     per 4.2 Rules for handling parsing errors."
>>
>> The "must ignore" part makes CSS3 UAs non-conformant with CSS 2.1. If 
>> all UAs implement Paged Media tomorrow (as we want them to do...) then 
>> we can never make a Rec for CSS 2.1 anymore, because there will be no 
>> UA that ignores @page inside @media, as required by this proposal.
> 
> Actually, that's not the case. The "must ignore" part requires ignoring
> invalid at-rules inside @media blocks. It doesn't require ignoring @page
> inside @media specifically. That's indirectly required because *in CSS2.1*
> such rules are invalid. If a later specification says they are valid, then
> the "must ignore" sentence no longer applies.

That's a very subtle interpretation :-) The juxtaposition of "invalid in 
CSS 2.1" and "invalid at-rules [...] must be ignored" very strongly 
suggests that rules that are invalid in CSS 2.1 must be ignored. I want 
it to be clearer that rules that are invalid in 2.1 but valid in level 3 
need not be ignored.

> 
>> So here is my cleaned-up version of Fantasai's proposal. Change in 7.2.1:
>>
>>     a set of rules (delimited by curly braces).
>> to
>>     a set of statements (delimited by curly braces). CSS 2.1 UAs may
>>     ignore at-rules inside @media blocks. Invalid at-rules must be
>>     ignored per 4.2 Rules for handling parsing errors.
>>
>> "Statements" may be hyperlinked to section 4.1.1, for extra clarity.
> 
> I like the change from "rules" to "statements". But I'm not as
> happy with the "may ignore". What does it mean to not ignore? Are
> @page inside @media and nested @media valid CSS2.1 then?

True, I didn't define validity of style sheets, only conformance of UAs.
In principle, validity of CSS 2.1 style sheets is already defined, 
because chapter 3 refers to appendix G, and appendix G does not allow 
nested at-rules.

But it's better to put that in words. Another try:

1) Change in 7.2.1

     a set of rules (delimited by curly braces).
to
     a set of statements (delimited by curly braces). Invalid statements
     must be ignored per 4.1.7 "Rule sets, declaration blocks, and
     selectors" and 4.2 "Rules for handling parsing errors."

with the first "statements" hyperlinked to section 4.1.1.

2) Add at the end of 7.2.1:

     Nested @media rules are invalid in CSS 2.1.

3) Add in 13.2, just before 13.2.1:

     @page rules inside @media rules are invalid in CSS 2.1.



Bert
-- 
   Bert Bos                                ( W 3 C ) http://www.w3.org/
   http://www.w3.org/people/bos                               W3C/ERCIM
   bert@w3.org                             2004 Rt des Lucioles / BP 93
   +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France

Received on Wednesday, 30 July 2008 23:31:56 UTC