W3C home > Mailing lists > Public > www-style@w3.org > September 2006

Re: [css3-mediaqueries] error handling in media queries?

From: Simon Pieters <zcorpan@hotmail.com>
Date: Thu, 21 Sep 2006 22:50:30 +0000
Message-ID: <BAY109-F4068FD83F79E8AE8AE4EC6B4200@phx.gbl>
To: howcome@opera.com, dbaron@dbaron.org
Cc: www-style@w3.org

Hi,

From: Håkon Wium Lie <howcome@opera.com>
>Also sprach L. David Baron:
>
>  > css3-mediaqueries doesn't seem to define the error handling behavior 
>for
>  > syntactically incorrect media queries.  This needs to be defined
>
>Yes.
>
>  > so that
>  > it is possible to know which of the following rules should make p
>  > elements green:
>  >
>  > @media all and (min-width: 1px), all and (min-width: more than 1px) {
>  >   p { color: green }
>  > }
>  >
>  > @media all and (min-width: 1px), all and (unknown-feature: 3px) {
>  >   p { color: green }
>  > }
>  >
>  > @media all and (min-width: 1px), all and (min-width: 1unknownunit) {
>  >   p { color: green }
>  > }
>  >
>  > @media all and (min-width: 1px), all and ((< min-width 200px)) {
>  >   p { color: green }
>  > }
>  >
>  > @media all and (min-width: 1px), all and (width at least 200px) {
>  >   p { color: green }
>  > }
>
>IMO, all of them should be green. And the second media query in the
>comma-separated list should be treated as false in all your examples.

Then it would be different to how error handling in selectors work. What if 
a future MQ defines special meaning to the comma, as in:

   @media screen, all and not(aural, print, speech) {...}

...then the above would in legacy UAs be treated as equivalent to:

   @media screen, print {...}

...while the intention of the new feature was to exclude print (for 
instance).

Unless I'm mistaken this is the reason why the entire ruleset is dropped if 
there's an error in a selector, instead of having the unsupported selector 
ignored and the others applied.

Regards,
Simon Pieters
Received on Thursday, 21 September 2006 22:50:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:47 GMT