Re: [cssom-view][mediaqueries] vertical resolution when pixels are not square

On Thu, 11 Sep 2014 20:04:14 +0200, Simon Pieters <simonp@opera.com> wrote:

> [[
> RESOLVED: 'resolution' MQ uses the vertical resolution when pixels are  
> not square
> ]]
> http://krijnhoetmer.nl/irc-logs/css/20140908#l-863
>
> What should this do when the device is rotated? If it's supposed to  
> switch to the new vertical, we haven't solved the problem that both  
> aren't always available.

Although there was a bit of confusion initially during the discussion in  
the F2F, both are always available, as resolution is not the number of  
device pixels per physical length unit, but the number of device pixels  
per css pixels. This mapping is done by the user agent, so it is always  
known to the user agent.

So, if the UA either has no knowledge of the geometry of physical pixels  
in the first place, or knows about the geometry physical pixels and they  
are (close enough to) square, it would not map a different number of  
device pixels per css pixels along each axis in the first place, and there  
would therefore be nothing to do when rotating the device.

Otherwise, if the UA choses to map a different number along each axis,  
presumably this is to respond to physical pixels not being square either.  
How the UA comes to this knowledge is out of scope, but it does have  
enough information to do the adjustment when rotating.

So, I think the normative behavior is fine as-is. But given that this is  
subtle enough to trip up most of the CSSWG every time we talk about it,  
making the prose more obvious sounds desirable. I've added a note based on  
this email to the mediaqueries ED. Let me know if this is now clear enough.

  - Florian

Received on Friday, 12 September 2014 08:48:25 UTC