Re: Behavior of device-pixel-ratio under zoom

I think it makes sense if the layout viewport is defines as something
smaller than the initial viewport (according to css-device-adapt).

Like on a "retina" phone you don't want to ever go below 2dppx, at least
for normal pages because the user will zoom in a lot, that will just result
in a worse user experience.

On the other hand if someone did

@viewport {
    width: calc(device-width / 2);

then it might make sense to set it to 4dppx. But then again I don't see a
big use case for doing this.


On Sun, Nov 11, 2012 at 2:12 AM, L. David Baron <> wrote:

> 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                  𝄂
> 𝄢   Mozilla                    𝄂

Intel Denmark Aps
Langelinie Alle 35, DK-2100 Copenhagen
CVR No. 76716919

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Received on Sunday, 11 November 2012 11:57:56 UTC