Re: [CSS21] is 'all' the 'initial' value of @media ?

On Tuesday 2007-05-08 12:41 -0400, Al Gilman wrote:
> I went to CSS 2.1 to confirm my understanding that
> 
> <rule
> class="toConfirmOrDeny">
> 
> If no @media rule is present in the context of a style rule, the
> effect of that style rule is the same as if there were an @media: all
> rule in the context.  The subject style rule applies to
> any media type.  (Properties assigned in this rule will apply or
> not apply per the applicability stated in their defining paragraphs.)
> 
> </rule>
> 
> Somehow, the section on the @media rule fails to say this.
> http://www.w3.org/TR/CSS21/media.html#at-media-rule
> 
> It is, however, stated with regard to the @import rule.
> http://www.w3.org/TR/CSS21/cascade.html#at-import
> 
> 1. Is my interpretation above the same as your reading of this 
> specification?

Yes.

(Although I wouldn't describe it as an "initial value"; that's a
technical term with other meaning.)

> 2. Is this a bug in the specification that this is not stated in the 
> @media section,
> or does it follow from general language on selectors or the cascade 
> somewhere
> else?

I agree that the specification is quite unclear in this case.  All
media specifiers (in @import, @media, and the media attribute of
<link> or <?xml-stylesheet?>) are handled by intersection.  In other
words, they say that the contents of the rule or sheet are not used
if the media specifier does not match.  It would probably be good if
the specification said it that way.  (It currently seems to describe
only authoring requirements and not implementation requirements.)

-David

-- 
L. David Baron                                <URL: http://dbaron.org/ >
           Technical Lead, Layout & CSS, Mozilla Corporation

Received on Tuesday, 8 May 2007 17:42:42 UTC