New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 786885 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Windows 10 scale changes devicePixelRatio

Reported by m...@craig-mitchell.com, Nov 20 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36

Steps to reproduce the problem:
1. Change Windows "Scale and Layout" to be something other than 100%.
2. Visit https://quirksmode.org/m/tests/widthtest.html
3. devicePixelRatio is set to what you set in Windows.

What is the expected behavior?
devicePixelRatio should be 1.  devicePixelRatio should only change when the user zooms.

What went wrong?
I am forced to take into account devicePixelRatio to get the actual value for window.innerWidth, so my page renders correctly.

However, when I do this, it stops the user from being able to zoom my page, as I am taking into account devicePixelRatio, and that then offsets the zoom.

Did this work before? N/A 

Chrome version: 62.0.3202.94  Channel: stable
OS Version: 10.0
Flash Version: 

We need a devicePixelRatio and a zoomedValue, so we can tell what is really happening.
 
Apologies, I just realized, because all the values are scaled, I can actually layout my page correctly by ignoring the devicePixelRatio value.

Eg:  If you set Windows to be 125%.  Then everything (img, div, ...) that you set to be 100px, will actually get set to 125px.  And the window will be reported as 25% larger than it actually is, so, in effect, it will layout the same as if it wasn't scaling.

IMHO, it's still odd.  I would have thought, changing the Windows scale, wouldn't affect what was reported with the pixel size in Chrome.  Ie: If I ask a div to be 100px wide, I'd expect it to be 100px wide, and not 125px wide.  However, it works, so I'm happy if you would like to close this bug.

Comment 2 by junov@chromium.org, Nov 20 2017

Cc: junov@chromium.org
Status: WontFix (was: Unconfirmed)
The behavior you are observing seems to be consistent with the specification, found here: https://drafts.csswg.org/cssom-view/#dom-window-devicepixelratio

I am closing this bug since the browser seems to be working as intended.  However, if you do find discrepancies with the specification, please let us know, and we can re-open the issue.  Also, if you find that the behavior is inconsistent between browsers and are not sure which browser is doing the right or wrong thing, let us know and we'll gladly take a deeper look.

Finally, if you have ideas to improve the design of this API, you can participate in improving the standard.  This particular feature is developed by the W3C CSS working group (I know, it's not really a CSS feature, but it is style-related).  To engage, you don't have to be a member of the W3C, anyone can file issues against the specification's GitHub repository, found here: https://github.com/w3c/csswg-drafts/issues

Alternately, you can start a discussion on the working group's public-facing mailing list: https://lists.w3.org/Archives/Public/www-style/

Sign in to add a comment