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

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

From: Håkon Wium Lie <howcome@opera.com>
Date: Thu, 21 Sep 2006 11:55:30 +0200
Message-ID: <17682.24978.564354.528436@gargle.gargle.HOWL>
To: "L. David Baron" <dbaron@dbaron.org>
Cc: www-style@w3.org

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.

 > Section 5 does say this:
 > # Since "max-weight" is an unknown media feature, the Media Query is
 > # false and the associated style sheet will not be applied.
 > But it doesn't say how unknown media features are parsed.  Is anything
 > unknown within matched parentheses accepted, but considered always
 > false?

I propose this text:

  Media queries involving unknown media types are always false.

  Expressions involving unknown media features or unknown/illegal
  values are always false.

Cheers,

-h&kon
              Håkon Wium Lie                          CTO °þe®ª
howcome@opera.com                  http://people.opera.com/howcome
Received on Thursday, 21 September 2006 09:56:09 GMT

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