Re: [css3-mediaqueries] device-width/device-height on rotatable devices

>> It's worth pointing out that the viewport width and height don't 
>> necessarily
>> have any relation to the physical orientation of the device (nor does the
>> orientation media query for that matter). It's not unthinkable to have a
>> webview in a mobile application with a viewport that has a different 
>> aspect
>> ratio (and thus potentially a different orientation) to the device 
>> itself.
>
> Yes, this is what makes 'aspect-ratio' different from 
> 'device-aspect-ratio'. In this context, 'orientation' means which of width 
> or height is bigger. It is not about which axis is called width or height.

I understand that, but you'll notice that there's no corresponding 
device-orientation feature, which is a bit odd considering that's probably 
what most people think of when you talk about orientation. If there had been 
one, and it always matched 'portrait' on an iPad, I think it would have been 
a lot more obvious that what Apple was doing was wrong.

> I think that the 'width' properties on elements, the 'width' media feature 
> and the 'device-width' media feature should all always be about the same 
> axis. Everything else should derive from this principle.

To add a few more data points to this discussion, I tested a couple of 
desktop browsers on a rotatable graphics card.

Firefox, Chrome and IE9 all reported the rotated device dimensions (i.e. the 
width and device-width are on the same axis, as you expect). However, they 
don't re-evaluate on rotate - only after a refresh (or a window resize in 
the case of Firefox and IE).

Opera determined the device dimensions at startup and stuck with that 
regardless of the orientation (i.e. the width and device-width are not 
necessarily on the same axis, much like iOS). No amount of refreshing or 
resizing made any difference.

FWIW, I agree with your interpretation of the spec, but I haven't heard any 
of the browser vendors chiming in to say they're going to fix their 
implementations. There's clearly an interoperability issue here, and I'm 
surprised nobody seems particularly concerned by that.

Regards
James

Received on Saturday, 9 March 2013 14:36:53 UTC