W3C home > Mailing lists > Public > www-style@w3.org > November 2012

Re: Behavior of device-pixel-ratio under zoom

From: Rune Lillesveen <rune@opera.com>
Date: Mon, 12 Nov 2012 10:19:18 +0100
To: www-style@w3.org
Message-ID: <op.wnnligw18isf1p@id-c1005.oslo.osa>
On Mon, 12 Nov 2012 01:13:13 +0100, Simon Fraser <smfr@me.com> wrote:

> On Nov 10, 2012, at 5:12 pm, L. David Baron <dbaron@dbaron.org> 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.
> We (Apple) feel quite strongly that device-pixel-ratio, like  
> window.devicePixelRatio,
> should not change under zoom. It's answering a question about the device  
> hardware,
> not the current zoom state of the page.
> I think in general authors should not be able to directly affect the  
> layout of the page
> under different zoom levels. Zooming should shouldn't have unsurprising  
> side effects
> for the user.

I agree that device-pixel-ratio should not change for the magnifying glass  
type of zoom you have in mobile browser, but it should change for the type  
of zoom you have in the Opera Desktop browser, and IIRC the resolution  
preference you have in the Android browser, which both affect the ICB.

Rune Lillesveen
Received on Monday, 12 November 2012 09:19:39 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:23 UTC