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

On Wednesday 2008-06-18 15:04 -0700, L. David Baron 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"?
> 
> 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?

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.

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.

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

Received on Wednesday, 18 June 2008 22:38:34 UTC