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

Issue 619590 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 357443
Owner:
Closed: May 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Incorrect devicePixelRatio when opening pages in a new tab on high DPI screens

Reported by g...@gesteves.com, Jun 13 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36

Example URL:
http://www.gesteves.com/dpr-test.html

Steps to reproduce the problem:
1. Open this page on a Mac with a retina screen (DPR 2): http://www.gesteves.com/dpr-test.html
2. Note that the page correctly reports the devicePixelRatio as 2
3. Right-click the link on that page (which points to the same page), and open it in a new tab in the background
4. Switch to that new tab

What is the expected behavior?
After switching to the new tab, the page should continue to report a DPR of 2. This is the behavior that both Safari and Firefox exhibit.

What went wrong?
After switching to the new tab, the page reports an incorrect DPR of 1.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? N/A 

Did this work before? N/A 

Does this work in other browsers? Yes 

Chrome version: 51.0.2704.84  Channel: stable
OS Version: OS X 10.11.5
Flash Version: Shockwave Flash 21.0 r0

This also affects images, although it's harder to reproduce (only seems to happen if the image is not in the cache). If the image is served responsively using srcset (with either sizes or 1x/2x variants), when opening the page in a new tab in the background, Chrome will load the image that corresponds to a DPR of 1, so when you switch to that tab on a high DPI screen all the images are blurry.

I've only been able to test this on OS X, so I don't know if this is present in other operating systems.
 
dpr-test.html
464 bytes View Download
Cannot reproduce on:
 - Chrome Version 51.0.2704.84 OSX 10.11.5
 - Chrome Version 53.0.2766.0 canary OSX 10.11.5
I have tried with the link provided and also https://bjango.com/articles/min-device-pixel-ratio/, and cannot reproduce. 

Comment 2 by g...@gesteves.com, Jun 14 2016

After a coworker pointed out that he couldn't repro either, I did some more digging around to try to nail down why it happens, and then realized it only happens when I have a non-retina external display plugged into my Mac. Without the external display plugged in, opening the link in a new tab reports the correct DPR, 2. When I plug in the external display, opening the link in a new tab (in the retina display) returns the incorrect DPR 1.
Components: -Blink
Labels: Needs-Feedback
Yeah, this is a known issue -- when we create the tab, we don't know which screen it will appear on, and we guess "Main Monitor", sometimes incorrectly.

This should be fix-able, let me see if we can do some plumbing to get it there.
Labels: Hotlist-Fixit-PE2016
Owner: ccameron@chromium.org
Status: Assigned (was: Unconfirmed)
ccameron@Could you please provide an update on this issue?
Cc: krajshree@chromium.org
ccameron@- Gentle Ping.
Please provide an update on this issue. If this issue has been fixed then, feel free to close this issue.
Issue still exists, still haven't thought of how to fix it.
Mergedinto: 357443
Status: Duplicate (was: Assigned)
Merging with older instance -- we should find a way to be more right about this more often.

Sign in to add a comment