Re: Behavior of device-pixel-ratio under zoom

On Saturday 2012-11-10 19:48 -0500, Robert O'Callahan wrote:
> Should devicePixelRatio and device-pixel-ratio be affected by browser zoom?
> 
> It seems to me that if the user zooms in a persistent way, it would make
> sense to adjust device-pixel-ratio to match. For example, if the user
> always views the page with a zoom of 2x on a 96dpi desktop screen, then
> there are two device pixels per CSS pixel and device-pixel-ratio should be
> 2.
> 
> OTOH I can see that if the user zooms in and out a lot just to navigate (as
> is often the case on mobile browsers), we might not want device-pixel-ratio
> to vary.

For mobile browsers that allow the user to pan and zoom around a
viewport, media queries in general should not change as the user
pans and zooms.  In general, those media queries should reflect the
outer viewport that you'd get with a <meta viewport> or @viewport
that prevents panning and zooming.

On the other hand, for a browser zoom mechanism that effectively
resizes the viewport, some media queries definitely should change in
response to zoom (e.g., at a 2x zoom, height and width should be
half what they are with a 1x zoom, so that the page layout correctly
reflects the area available to it).  I don't have a strong use case
for device-pixel-ratio here, but I tend to think it should probably
match the other media queries absent strong reasons for the
contrary.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂

Received on Sunday, 11 November 2012 01:13:22 UTC