W3C home > Mailing lists > Public > www-style@w3.org > October 2004

Re: Possible CSS2/CSS2.1/CSS3 spec error in @media

From: Syntactic: Jim Wilkinson <syntactic@btinternet.com>
Date: Thu, 07 Oct 2004 23:01:49 +0100
To: "Bjoern Hoehrmann" <derhoermi@gmx.net>
Cc: "www-style@w3.org" <www-style@w3.org>
Message-ID: <opsfistbo0brj5zx@dial81-131-132-44.in-addr.btopenworld.com>

>> For the @media rule it's presumably obligatory to specify one or more
>> values for media type. Both the CSS2 Rec and the CSS2.1 CR (25 Feb 2004)
>> are silent on this point [Sections 7.2.1, 4.1.5 and 4.2].
> Appendix G.1 requires one medium, ...

Thanks, Bjoern, read and understood.

> ... if that is not provided the generic
> error handling rules for illegal at-rules would apply, i.e. the entire
> at-rule would be ignored.

I can't find this in CSS2 or 2.1. Do you have a reference? Section 4.2,  
for example, defines error handling for invalid at-keywords but not for  
invalid at-rules (i.e. a valid at-keyword without a mandated [and  
required] following parameter). @media is unique amongst the at-rules in  
requiring both a parameter and a following declaration block which may or  
may not be invoked if the parameter is missing.

CSS users (i.e. developers c.f. CSS implementers) who read the Recs are  
likely to read the general text but not the formal grammar in the  
Appendices. I think it would be desirable for the text (in 7.2.1) to  
repeat what the Appendix says: that at least one media type must be  
present. Sec 7.2.1 should also state that no specified media types will  
cause the entire @media rule (i.e. including the declaration block) to be  
ignored. This error behaviour is implied but appears *not* to be  
specified. At present it would be equally valid error behaviour to apply  
such an @media rule unconditionally, i.e. to all media.

It occurs to me that the same argument applies if one or more media types  
are specified and all are invalid or unrecognised. It may be obvious that  
the @media rule should not be applied to any media (certainly not all  
media) but the Rec doesn't actually say so. This issue will become more  
important when CSS3 Media Queries is implemented, where there is greater  
chance that a Media Query will be mis-specified. I know that Opera has  
experimental support but I haven't yet created any test cases.

I have read Hixie's views on the importance of specifying error handling.  
Perhaps he would care to comment.

Jim Wilkinson

Cardiff, Wales UK

Opera e-mail client: http://www.opera.com/m2/
Received on Thursday, 7 October 2004 22:02:46 UTC

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