Media Queries parsing

View: New views
4 Messages — Rating Filter:   Alert me  

Media Queries parsing

by Anne van Kesteren-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

http://tc.labs.opera.com/mediaqueries/parsing/ has some testcases that  
test parsing of media queries for visual user agents. I have assumed that  
the empty string is not a valid media query but is a valid list of media  
queries. This means that media="" and media="all," are applied, but that  
media="," and media="x," are not. If you find any other areas this  
testsuite should cover please let me know. Submitted tests can be in the  
following format:

   all and (min-width)
   false

   all,
   true

Kind regards,


--
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>


Re: Media Queries parsing

by Stewart Brodie :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


"Anne van Kesteren" <annevk@...> wrote:

>
> Hi,
>
> http://tc.labs.opera.com/mediaqueries/parsing/ has some testcases that  
> test parsing of media queries for visual user agents. I have assumed that

> the empty string is not a valid media query but is a valid list of media  
> queries. This means that media="" and media="all," are applied, but that  
> media="," and media="x," are not.

The empty string is not a valid media specifier according to the syntax
definition in the specification, so I agree with you there.  However, the
discrepancy between "" and "," does not feel right.  I don't think you can
have it both ways - you'd have to modify the syntax for media_query_list to
permit an empty string for the whole media query and define it as being an
alias for "all".


Did you ever resolve the "not foo" issue?  The issue being whether unknown
media types are always false, regardless of the 'not', or whether this case
it true because the not always negates the result of evaluating the rest of
the query.


--
Stewart Brodie
Software Engineer
ANT Software Limited


Re: Media Queries parsing

by Anne van Kesteren-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Mon, 10 Dec 2007 11:53:41 +0100, Stewart Brodie  
<stewart.brodie@...> wrote:
> The empty string is not a valid media specifier according to the syntax
> definition in the specification, so I agree with you there.  However, the
> discrepancy between "" and "," does not feel right.  I don't think you  
> can have it both ways - you'd have to modify the syntax for  
> media_query_list to permit an empty string for the whole media query and  
> define it as being an alias for "all".

Yes, that's the plan.


> Did you ever resolve the "not foo" issue?  The issue being whether  
> unknown media types are always false, regardless of the 'not', or  
> whether this case it true because the not always negates the result of  
> evaluating the rest of the query.

Good point. I should add tests for those too. The plan of the WG is that  
"not foo" would be an ignored media query (parse error basically). If you  
have

   media="not foo,all"

it would evaluate to true and if you have

   media="not foo"

it would evaluate to false.


--
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>


Re: Media Queries parsing

by Anne van Kesteren-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Mon, 10 Dec 2007 11:53:41 +0100, Stewart Brodie  
<stewart.brodie@...> wrote:
> The empty string is not a valid media specifier according to the syntax
> definition in the specification, so I agree with you there.  However, the
> discrepancy between "" and "," does not feel right.  I don't think you  
> can have it both ways - you'd have to modify the syntax for  
> media_query_list to permit an empty string for the whole media query and  
> define it as being an alias for "all".

The WG decided that @media { ... } was not acceptable and that therefore  
HTML and equivalent languages will have to special case media="".


> Did you ever resolve the "not foo" issue?  The issue being whether  
> unknown media types are always false, regardless of the 'not', or  
> whether this case it true because the not always negates the result of  
> evaluating the rest of the query.

"not foo" means the media query in question will be ignored.


--
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>

LightInTheBox - Buy quality products at wholesale price!