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

> Although this case is not explicitly mentioned in the spec (and again, it 
> could, for clarification) it seems pretty clear to me that rotation should 
> re-evaluate Media Queries.
>
> When the browser decides to change how content is displayed due to a 
> device rotation, I’m confident this changes what is called the 
> width/height of the viewport, and that eg. 'width' and 'device-width' 
> should correspond to the same direction.

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.

Also consider this from the point of view of a "desktop" browser on a 
rotatable monitor. Let's say your browser window and the monitor itself both 
start off in a landscape orientation. Then you rotate your monitor to 
portrait, but your browser window doesn't resize, so the viewport width and 
height don't change, and the orientation doesn't change. I'm 
assuming,though, that you would expect the device-width and device-height to 
change?

That's not an unreasonable expectation, but it wouldn't surprise me if 
others disagreed with you.

Regards
James

Received on Friday, 8 March 2013 12:34:22 UTC