Re: media attribute and nested media restrictions

On Fri, 24 Oct 2008, L. David Baron wrote:
> 
> http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-link-element says:
>   # The user agent must apply the external resource to views while
>   # their state match the listed media and the other relevant
>   # conditions apply, and must not apply them otherwise.
> and http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-style-element says:
>   # User agents must apply the styles to views while their state
>   # match the listed media, and must not apply them otherwise. 
> 
> This is somewhat unclear as to how nesting of media restrictions
> works, and how linking of the same style sheet multiple times works.
> In particular:
>  (1) If a style sheet is linked twice, once with a media attribute
>  that matches and once with one that does, this seems to require
>  that the user agent both apply and not apply the style sheet.  (In
>  applies it only through the link that does match.  The order is
>  relevant for the cascade, testably so if there are other sheets
>  between the links.)

If a style sheet is linked twice, it is two external resources for the 
purposes of HTML. I've tried to make this clearer in the spec with the 
addition of a note.


>  (2) This seems to imply that the media attribute overrides media
>  restrictions inside the style sheets (either linked or in style
>  elements).  It should be clear that media restrictions nest, and
>  that all of the media restrictions surrounding a path to a rule
>  must match the state of the view for that rule to be applied via
>  that path.

I've added a note to that effect as well.

Please let me know if you think this does not resolve the issue.

Thanks,
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Wednesday, 24 December 2008 06:59:50 UTC