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

Le 09/03/2013 15:36, James Holderness a écrit :
> I understand that, but you'll notice that there's no corresponding
> device-orientation feature,

(orientation: portrait) is the same as (max-aspect-ratio: 1/1). You 
could use min/max-device-aspect-ratio if that’s really what you want.


> which is a bit odd considering that's probably
> what most people think of when you talk about orientation.

I’m not sure. What’s important is which direction gives you more space 
to display stuff. That’s the viewport’s aspect ratio, not the device’s.


> 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.

Note the "not required" in the related spec text:

# User agents are expected, but not required, to re-evaluate and
# re-layout the page in response to changes in the user environment,
# for example if the device is tilted from landscape to portrait mode.

IMO this is an issue on mobile and should be fixed (Do the respective 
browser have bugs reported?) because rotating is part of "normal use", 
but not as much of an issue on non-mobile where rotating a monitor or 
changing its resolution is more part of "set up" (which I don’t have a 
good definition for.)

-- 
Simon Sapin

Received on Saturday, 9 March 2013 20:14:26 UTC