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

Re: [css3-mediaqueries] feedback on device-aspect-ratio, aspect-ratio and orientation

From: Dean Jackson <dino@apple.com>
Date: Tue, 25 Nov 2008 07:38:22 +1100
Cc: www-style@w3.org
Message-Id: <7F55B148-1CAA-4376-BB79-85E0B96C75C7@apple.com>
To: Cameron McCormack <cam@mcc.id.au>

Hey Cam,

On 31/10/2008, at 6:15 PM, Cameron McCormack wrote:

> Dean Jackson:
>> We are interested in these features, but request changes.
>>
>> aspect-ratio and device-aspect-ratio
>> ------------
>>
>> We think these should take a number (float) rather than a ratio  
>> (defined
>> as a string). While ratio gives the same result it doesn't seem worth
>> introducing a new type just for these queries.
>
> Wouldn’t that make it difficult (or impossible, since css3-values says
> numbers are reals rather than particular precision floats) to match  
> some
> aspect ratios like 4:3?  Wouldn’t the author then be forced to write
> something like:
>
>  (min-aspect-ratio: 1.333) and (max-aspect-ratio: 1.334)

[I've read the followup messages, but since they resolved to the same
question Cameron asks, I'll answer here]

This is a good point. I'm not sure what the cost of introducing a new
type for these queries is compared to defining the precision to be
used.

The way I see it is that authors probably will always use the min/max
style over the aspect-ratio queries anyway. For example, a consumer
"16:9" device can refer to both 1280x720 and 1366x768, but the second
does not equal 16:9 (it's very close, but by the spec's definition
would fail the query). What the author will probably want is a layout
that works for viewports around that ratio.

In your example, IMO the author would more likely write something like:

   (min-aspect-ratio: [something below 4:3]) and
   (max-aspect-ratio: [something above 4:3 but not above the 16:9  
switch])

I feel this would be easier to write with floats.

So, answering your question, it seems it will be impossible to work
with some aspect ratios as floats, but even the suggested syntax has the
same problem.

Dean
Received on Monday, 24 November 2008 20:39:07 GMT

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