Behavior of device-pixel-ratio under zoom

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
41 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Behavior of device-pixel-ratio under zoom

Robert O'Callahan-3
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.

Perhaps it should be up to the browser?

Rob
--
Jesus called them together and said, “You know that the rulers of the Gentiles lord it over them, and their high officials exercise authority over them. Not so with you. Instead, whoever wants to become great among you must be your servant, and whoever wants to be first must be your slave — just as the Son of Man did not come to be served, but to serve, and to give his life as a ransom for many.” [Matthew 20:25-28]

Reply | Threaded
Open this post in threaded view
|

Re: Behavior of device-pixel-ratio under zoom

L. David Baron
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/   𝄂

Reply | Threaded
Open this post in threaded view
|

Re: Behavior of device-pixel-ratio under zoom

Kenneth Rohde Christiansen-2
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.

Kenneth

On Sun, Nov 11, 2012 at 2:12 AM, L. David Baron <[hidden email]> 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                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂




--
---------------------------------------------------------------------
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.
Reply | Threaded
Open this post in threaded view
|

Re: Behavior of device-pixel-ratio under zoom

Simon Fraser-4
In reply to this post by L. David Baron

On Nov 10, 2012, at 5:12 pm, L. David Baron <[hidden email]> 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.

In cases where it makes sense for the amount of detail of elements on the page
to increase on zooming (e.g. showing higher resolution image assets), features like
image-set() come into play, and allow the UA to make resource/resolution choices
without the author having to worry directly about things like devicePixelRatio and
zoom level.

Simon




Reply | Threaded
Open this post in threaded view
|

Re: Behavior of device-pixel-ratio under zoom

Jonathan Kew-3
On 11/11/12 16:13, Simon Fraser wrote:

> 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.

Could you clarify what question about the device hardware it is
answering, exactly? i.e., what are the two quantities or dimensions
whose ratio it reflects? I'm not clear exactly what the specification
(what specification?) expects...

JK


Reply | Threaded
Open this post in threaded view
|

Re: Behavior of device-pixel-ratio under zoom

Simon Fraser-4
On Nov 11, 2012, at 5:54 pm, Jonathan Kew <[hidden email]> wrote:

> On 11/11/12 16:13, Simon Fraser wrote:
>
>> 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.
>
> Could you clarify what question about the device hardware it is answering, exactly? i.e., what are the two quantities or dimensions whose ratio it reflects? I'm not clear exactly what the specification (what specification?) expects…

Device pixels per CSS pixel when the page is at unit scale.

Simon


Reply | Threaded
Open this post in threaded view
|

Re: Behavior of device-pixel-ratio under zoom

Boris Zbarsky
In reply to this post by Simon Fraser-4
On 11/11/12 4:13 PM, Simon Fraser wrote:
> 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

What question about device hardware is it answering, if I might ask?

> 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 think that depends on whether your zoom is part of zoom-and-pan or
whether it's a relayout-at-different-css-pixel-size operation (which
often gets confusingly called "zoom" but is quite different from
zoom-and-pan).

-Boris

Reply | Threaded
Open this post in threaded view
|

Re: Behavior of device-pixel-ratio under zoom

Boris Zbarsky
In reply to this post by Simon Fraser-4
On 11/11/12 6:46 PM, Simon Fraser wrote:
> Device pixels per CSS pixel when the page is at unit scale.

Define "unit scale"?

If a browser has a setting to always render web pages "zoomed" from the
point of view of the user, what does "unit scale" mean?

-Boris


Reply | Threaded
Open this post in threaded view
|

Re: Behavior of device-pixel-ratio under zoom

Rune Lillesveen
In reply to this post by L. David Baron
On Sun, 11 Nov 2012 02:12:57 +0100, L. David Baron <[hidden email]>  
wrote:

> 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.

Yes, I agree. I see zoom mechanisms that resize the viewport as a CSS  
pixel scaling, hence affects dppx resolution and device-pixel-ratio  
features, while a zoom mechanism that doesn't alter the layout (a  
magnifying glass type of zoom) doesn't change the CSS pixel scaling seen  
 from the author point of view.

--
Rune Lillesveen

Reply | Threaded
Open this post in threaded view
|

Re: Behavior of device-pixel-ratio under zoom

Robert O'Callahan-3
In reply to this post by Simon Fraser-4
I agree with David and Rune, if that wasn't already clear.

On Sun, Nov 11, 2012 at 7:13 PM, Simon Fraser <[hidden email]> wrote:
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.

For years Firefox has supported a zoom mode that does relayout the page (by changing the viewport size in CSS pixels). I believe Safari has supported something similar.

I'm asking whether *that* kind of zoom should affect devicePixelRatio and device-pixel-ratio.

Rob
--
Jesus called them together and said, “You know that the rulers of the Gentiles lord it over them, and their high officials exercise authority over them. Not so with you. Instead, whoever wants to become great among you must be your servant, and whoever wants to be first must be your slave — just as the Son of Man did not come to be served, but to serve, and to give his life as a ransom for many.” [Matthew 20:25-28]

Reply | Threaded
Open this post in threaded view
|

Re: Behavior of device-pixel-ratio under zoom

Rune Lillesveen
In reply to this post by Simon Fraser-4
On Mon, 12 Nov 2012 01:13:13 +0100, Simon Fraser <[hidden email]> wrote:

>
> On Nov 10, 2012, at 5:12 pm, L. David Baron <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: Behavior of device-pixel-ratio under zoom

Rune Lillesveen
In reply to this post by Robert O'Callahan-3
On Mon, 12 Nov 2012 10:15:40 +0100, Robert O'Callahan <[hidden email]> wrote:

I agree with David and Rune, if that wasn't already clear.

On Sun, Nov 11, 2012 at 7:13 PM, Simon Fraser <[hidden email]> wrote:
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.

For years Firefox has supported a zoom mode that does relayout the page (by changing the viewport size in CSS pixels). I believe Safari has supported something similar.

I'm asking whether *that* kind of zoom should affect devicePixelRatio and device-pixel-ratio.

Yes, I think so.

--
Rune Lillesveen
Reply | Threaded
Open this post in threaded view
|

Re: Behavior of device-pixel-ratio under zoom

Jonathan Kew-3
On 12/11/12 01:21, Rune Lillesveen wrote:
>     For years Firefox has supported a zoom mode that does relayout the
>     page (by changing the viewport size in CSS pixels). I believe Safari
>     has supported something similar.
>
>     I'm asking whether *that* kind of zoom should affect
>     devicePixelRatio and device-pixel-ratio.
>
>
> Yes, I think so.

AFAICT, it doesn't do so in Opera at the moment (12.10, Build 1652, Mac
OS X). I made a simple test page[1] to experiment with zooming, and
Opera resolutely insists it has a ratio of 2.0 (on a Retina display),
regardless of the zoom level.

However, an article[2] several months ago noted that "Turns out Opera's
value depends on the zoom level." I was unable to reproduce this, which
caused me to wonder whether there has been a change to the behavior,
whereby it used to depend on zoom, but no longer does so?

JK

[1] http://people.mozilla.org/~jkew/res/test.html
[2] http://www.quirksmode.org/blog/archives/2012/07/more_about_devi.html


Reply | Threaded
Open this post in threaded view
|

Re: Behavior of device-pixel-ratio under zoom

Rune Lillesveen
On Mon, 12 Nov 2012 15:28:00 +0100, Jonathan Kew <[hidden email]>  
wrote:

> On 12/11/12 01:21, Rune Lillesveen wrote:
>>     For years Firefox has supported a zoom mode that does relayout the
>>     page (by changing the viewport size in CSS pixels). I believe Safari
>>     has supported something similar.
>>
>>     I'm asking whether *that* kind of zoom should affect
>>     devicePixelRatio and device-pixel-ratio.
>>
>>
>> Yes, I think so.
>
> AFAICT, it doesn't do so in Opera at the moment (12.10, Build 1652, Mac  
> OS X). I made a simple test page[1] to experiment with zooming, and  
> Opera resolutely insists it has a ratio of 2.0 (on a Retina display),  
> regardless of the zoom level.

Which is a bug, I think. Looks like we only took Opera Mobile into  
consideration when implementing that property.

> However, an article[2] several months ago noted that "Turns out Opera's  
> value depends on the zoom level." I was unable to reproduce this, which  
> caused me to wonder whether there has been a change to the behavior,  
> whereby it used to depend on zoom, but no longer does so?

It doesn't say if this is Opera Desktop, Opera Mobile, or which version. I  
don't know.

> [1] http://people.mozilla.org/~jkew/res/test.html
> [2] http://www.quirksmode.org/blog/archives/2012/07/more_about_devi.html

--
Rune Lillesveen

Reply | Threaded
Open this post in threaded view
|

RE: Behavior of device-pixel-ratio under zoom

Sylvain Galineau
In reply to this post by Robert O'Callahan-3

[Robert O'Callahan:]
>I agree with David and Rune, if that wasn't already clear.

>>On Sun, Nov 11, 2012 at 7:13 PM, Simon Fraser <[hidden email]> wrote:
>>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.

>For years Firefox has supported a zoom mode that does relayout the page (by changing the viewport size in CSS pixels). I believe >Safari has supported something similar.

>I'm asking whether *that* kind of zoom should affect devicePixelRatio and device-pixel-ratio.

Fwiw this is what IE has done since IE8. Our default zoom resizes the viewport and affects the
screen.deviceXDPI property; thus a top-level width:50% computes to a different value at each zoom level.
In Windows 8 optical zoom - what Rune refers to as a magnifying glass, or the default zooming mode on
smartphones - has no effect on deviceXDPI or used length resolution i.e. it's treated as a display
transform.


Reply | Threaded
Open this post in threaded view
|

Re: Behavior of device-pixel-ratio under zoom

Tab Atkins Jr.
In reply to this post by Robert O'Callahan-3
On Mon, Nov 12, 2012 at 1:15 AM, Robert O'Callahan <[hidden email]> wrote:

> On Sun, Nov 11, 2012 at 7:13 PM, Simon Fraser <[hidden email]> wrote:
>> 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.
>
> For years Firefox has supported a zoom mode that does relayout the page (by
> changing the viewport size in CSS pixels). I believe Safari has supported
> something similar.
>
> I'm asking whether *that* kind of zoom should affect devicePixelRatio and
> device-pixel-ratio.

Like others, I feel strongly that *that* kind of zoom should affect
dPR and d-p-r.  (Perhaps we should call it "rescale", to separate it
from the related-only-thematically "zoom" operation that mobile
devices do?)

I suspect that Simon's statements are about "zoom", not "rescale", and
that he (and Apple in general) are fine with rescaling affecting dPR.

In any case, it appears that FF and IE both change dPR when you
"rescale", so that's the behavior we should go with.

~TJ

Reply | Threaded
Open this post in threaded view
|

Re: Behavior of device-pixel-ratio under zoom

Robert O'Callahan-3
On Tue, Nov 13, 2012 at 11:47 AM, Tab Atkins Jr. <[hidden email]> wrote:
Like others, I feel strongly that *that* kind of zoom should affect
dPR and d-p-r.  (Perhaps we should call it "rescale", to separate it
from the related-only-thematically "zoom" operation that mobile
devices do?)

I suspect that Simon's statements are about "zoom", not "rescale", and
that he (and Apple in general) are fine with rescaling affecting dPR.

In any case, it appears that FF and IE both change dPR when you
"rescale", so that's the behavior we should go with.

Great. Can you check that Chrome does the right thing? We don't want compat problems to arise here, and we've already seen some pages that are making some questionable assumptions.

Rob
--
Jesus called them together and said, “You know that the rulers of the Gentiles lord it over them, and their high officials exercise authority over them. Not so with you. Instead, whoever wants to become great among you must be your servant, and whoever wants to be first must be your slave — just as the Son of Man did not come to be served, but to serve, and to give his life as a ransom for many.” [Matthew 20:25-28]

Reply | Threaded
Open this post in threaded view
|

Re: Behavior of device-pixel-ratio under zoom

Tab Atkins Jr.
On Tue, Nov 13, 2012 at 2:40 PM, Robert O'Callahan <[hidden email]> wrote:

> On Tue, Nov 13, 2012 at 11:47 AM, Tab Atkins Jr. <[hidden email]>
> wrote:
>> Like others, I feel strongly that *that* kind of zoom should affect
>> dPR and d-p-r.  (Perhaps we should call it "rescale", to separate it
>> from the related-only-thematically "zoom" operation that mobile
>> devices do?)
>>
>> I suspect that Simon's statements are about "zoom", not "rescale", and
>> that he (and Apple in general) are fine with rescaling affecting dPR.
>>
>> In any case, it appears that FF and IE both change dPR when you
>> "rescale", so that's the behavior we should go with.
>
> Great. Can you check that Chrome does the right thing? We don't want compat
> problems to arise here, and we've already seen some pages that are making
> some questionable assumptions.

As far as I can tell, we do the wrong thing.  When I Ctrl-+ my way to
maximum "zoom" (really "rescale", I think) on my desktop (such that
<body> reports its width as being 272px wide instead of 1424px),
window.dPR still returns 1.

~TJ

Reply | Threaded
Open this post in threaded view
|

Re: Behavior of device-pixel-ratio under zoom

Robert O'Callahan-3
On Tue, Nov 13, 2012 at 5:21 PM, Tab Atkins Jr. <[hidden email]> wrote:
As far as I can tell, we do the wrong thing.  When I Ctrl-+ my way to
maximum "zoom" (really "rescale", I think) on my desktop (such that
<body> reports its width as being 272px wide instead of 1424px),
window.dPR still returns 1.

OK, can you please get someone to fix it? I'm worried about interop here.

Rob
--
Jesus called them together and said, “You know that the rulers of the Gentiles lord it over them, and their high officials exercise authority over them. Not so with you. Instead, whoever wants to become great among you must be your servant, and whoever wants to be first must be your slave — just as the Son of Man did not come to be served, but to serve, and to give his life as a ransom for many.” [Matthew 20:25-28]

Reply | Threaded
Open this post in threaded view
|

Re: Behavior of device-pixel-ratio under zoom

James Robinson-5
In reply to this post by Tab Atkins Jr.


On Tue, Nov 13, 2012 at 5:21 PM, Tab Atkins Jr. <[hidden email]> wrote:
On Tue, Nov 13, 2012 at 2:40 PM, Robert O'Callahan <[hidden email]> wrote:
> On Tue, Nov 13, 2012 at 11:47 AM, Tab Atkins Jr. <[hidden email]>
> wrote:
>> Like others, I feel strongly that *that* kind of zoom should affect
>> dPR and d-p-r.  (Perhaps we should call it "rescale", to separate it
>> from the related-only-thematically "zoom" operation that mobile
>> devices do?)
>>
>> I suspect that Simon's statements are about "zoom", not "rescale", and
>> that he (and Apple in general) are fine with rescaling affecting dPR.
>>
>> In any case, it appears that FF and IE both change dPR when you
>> "rescale", so that's the behavior we should go with.
>
> Great. Can you check that Chrome does the right thing? We don't want compat
> problems to arise here, and we've already seen some pages that are making
> some questionable assumptions.

As far as I can tell, we do the wrong thing.  When I Ctrl-+ my way to
maximum "zoom" (really "rescale", I think) on my desktop (such that
<body> reports its width as being 272px wide instead of 1424px),
window.dPR still returns 1.


That's a completely different type of 'zoom' from what happens on mobile.  Ctrl+ in Chrome is 'Page Zoom' using the terminology here: http://trac.webkit.org/wiki/ScalesAndZooms.  Pinch zooming on a mobile device in WebKit is 'Page Scale' using that terminology.  Neither change window.devicePixelRatio - that's an artifact of the display and cannot be changed by user interaction.

- James
 
~TJ


123