W3C home > Mailing lists > Public > www-style@w3.org > April 2010

RE: [css3-mediaqueries][cssom] Empty media queries in stylesheets and the DOM

From: Sylvain Galineau <sylvaing@microsoft.com>
Date: Thu, 22 Apr 2010 22:03:35 +0000
To: Anne van Kesteren <annevk@opera.com>, www-style list <www-style@w3.org>
CC: "Sharon Newman (COHEN)" <sharco@microsoft.com>, Daniel Libby <dlibby@microsoft.com>
Message-ID: <045A765940533D4CA4933A4A7E32597E211EE666@TK5EX14MBXC113.redmond.corp.microsoft.com>
> From: Anne van Kesteren [mailto:annevk@opera.com]

> I believe it is the plan to make that invalid yes, yes. Though
> ultimately
> it depends on what the module that defines @media will say about it.

Currently, the module refers to the CSS2.1 grammar for @media. Is that
intended to change before REC ? If not then @media requires at least
one media type.
> > If so we should clarify this part of the prose. I honestly don't see
> how
> > anyone could understand that these two opening statements have
> nothing
> > to do
> > with syntax, nor how it relates to what model.
> Why not? Media queries are a concept and as a concept if you omit the
> media type part it will be assumed to be all. 

Conceptual statements that are contradicted by the grammar and shipping 
implementations are unhelpful. (To me, at least). 

The grammar requires a media type. These opening 'concepts' *may* indicate that 
the media type is optional but it may also be saying 'this is what the default 
media type is when you only have expressions', which in turns implies it's 
optional at least in some cases. 

Let's just say I'll trust you with the concept but I'm trying to understand
what running code should do. Right now, it's unclear.

> The syntax says that if you input nothing it is treated like "not all" 

Does it ? It says that when all media queries that are specified are ignored, 
it is the same as not all. There is nothing explicit about what the media type 
is when no input at all is present. Hence, maybe, the lack of interop in
this case ?

> (unless a referencing specification says something different, e.g. 
> <style media=""> is the same as <style media="all"> per HTML5).

1. @media {} is invalid
2. If none of the specified queries match then that is equivalent to 'not all'
3. media="" is equivalent to media="all" 

I think web authors definitely expect #2. But #1 may surprise them in light of

> > Any other reasons ?
> We need some kind of fallback. I suppose it depends on what you expect
> removing all media queries to do what you consider to be most logical.
> If you prefer it to be 'all' we can do that too.

I think it'd be confusing if removing all media queries through the DOM resulted
in "not all" but setting the media attribute to "" meant "all".

Received on Thursday, 22 April 2010 22:04:10 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:45 UTC