W3C home > Mailing lists > Public > www-style@w3.org > August 2008

Re: [css3-mediaqueries] Is (width) ever false?

From: Anne van Kesteren <annevk@opera.com>
Date: Tue, 26 Aug 2008 12:12:28 +0200
To: "L. David Baron" <dbaron@dbaron.org>, www-style@w3.org
Message-ID: <op.ughny2pt64w2qv@annevk-t60.oslo.opera.com>

On Thu, 19 Jun 2008 00:04:28 +0200, L. David Baron <dbaron@dbaron.org>  
wrote:
> http://dev.w3.org/csswg/css3-mediaqueries/#media1 says:
>   # For a media feature feature, (feature) will evaluate to true if
>   # (feature:x) will evaluate to true for a value x other than zero.
>
> Does this mean:
>
>   (a) (width) is always true, even if the viewport width is zero,
>   because "0px" is a value other than zero, or:
>
>   (b) (width) is false when the viewport width is zero because "0px"
>   and "0" are both not "other than zero"?

It means (b). Should this be clarified somehow?


> I'd also note that because specified widths cannot be negative,
> (max-width) currently behaves the same as (width), whereas
> (min-width) is always true.  Is that really intended?

Actually, per that text (min-width) would also evaluate to false if the  
width of the viewport is zero.


In a subsequent e-mail David wrote:
> I'd also note that part of this is a change from the CR.  In
> particular, the requirement that (min-width) and (max-width) are
> different from (width) is new.  It introduces extra complexity
> because it requires propagating the knowledge of which media
> features allow zero values (currently all that accept min/max other
> than the <ratio> features) and which accept negative values into the
> matching code, rather than just enforcing that as a parse-time
> requirement.

The CR draft is not really clear on what should happen here. That's why it  
was clarified. We can change it to something else I suppose. Do you have  
suggestions?


> Should valueless media feature expressions with min- and max- even
> be allowed?  I'm not sure they make sense.  If they are allowed, the
> CR's wording where they are treated the same as without min-/max-
> seems easier to implement for something that I don't see a good use
> for.

I don't really feel strongly either way.


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>
Received on Tuesday, 26 August 2008 10:13:11 GMT

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