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

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

From: Anne van Kesteren <annevk@opera.com>
Date: Mon, 26 Apr 2010 11:59:24 +0900
To: "www-style list" <www-style@w3.org>, "Sylvain Galineau" <sylvaing@microsoft.com>
Cc: "Sharon Newman (COHEN)" <sharco@microsoft.com>, "Daniel Libby" <dlibby@microsoft.com>
Message-ID: <op.vbq084xw64w2qv@annevk-t60>
On Fri, 23 Apr 2010 07:03:35 +0900, Sylvain Galineau  
<sylvaing@microsoft.com> wrote:
>> 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.

Right. I'm saying that a CSS3 draft for @media could change it.


>> 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).

They are not contradicted by the grammar. There are scenarios where you  
can omit the media type. It just happens to be that in such cases you need  
to have at least one media feature specified. The grammar makes the  
conditions clear.


> 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.

If you have suggestions for how to clarify it that would help. To me it's  
perfectly clear.


>> 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?

I would like to get full interoperability here, but I think that would  
require moving the MediaList API in the Media Queries specification and  
make it into one model. Or alternatively provide more hooks or something  
in the Media Query specification for the API, but I believe neither is  
really desired by the WG as we want to move Media Queries forward.


>> (unless a referencing specification says something different, e.g.
>> <style media=""> is the same as <style media="all"> per HTML5).
>
> So:
> 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 #3.

#3 is also invalid, but needs to be done this way for backwards  
compatibility.


>> 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".

I suppose. I'm open to suggestions and some help in getting it changed in  
all implementations.


-- 
Anne van Kesteren
http://annevankesteren.nl/
Received on Monday, 26 April 2010 03:00:08 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:26 GMT