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

Issue 746429 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Closed: Oct 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Emulation.setDeviceMetricsOverride showing white margin to the sides when fitWindow is true

Reported by rhour...@gmail.com, Jul 19 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0

Steps to reproduce the problem:
1. Using the chrome.debugger in an extension I use the following to emulate different screen resolutions
chrome.debugger.sendCommand(debuggeeId, "Emulation.setDeviceMetricsOverride", {
            width: 1024,
            height: 768,
            deviceScaleFactor: 1,
            mobile: false,
            fitWindow: true
        }, function (result) {});

What is the expected behavior?
The page loads using the specified width and height

What went wrong?
The page loads but shows white areas to the sides (in Chrome 59) and grey areas (in Chrome 54).
When I try mobile as true or fitWindow as false this margin is gone.
(please ignore the yellow background here)

Did this work before? No 

Does this work in other browsers? N/A

Chrome version: 59.0.3071.115 (Official Build) (64-bit) (cohort: Stable)  Channel: n/a
OS Version: 10.0
Flash Version: 24.0.0.189 internal-not-yet-present

* I'd like to understand if this is intended to be like this or I've misconfigured it or it's a bug.
* I also want to know if "Page.setDeviceMetricsOverride" is deprecated by "Emulation.setDeviceMetricsOverride"? They both have the same behavior.
 
screenshot-local-chrome54.png
374 KB View Download
screenshot-local-chrome59.png
318 KB View Download
fitwindow-false-chrome59.PNG
271 KB View Download
Labels: Needs-Feedback
@rhourieh: Could you please provide a sample test file or extension to check the issue from our end?

Thanks!!

Comment 2 by rhour...@gmail.com, Jul 25 2017

Thank you for your reply. I'll prepare a sample test as I can't post the extension I'm working with.
Project Member

Comment 3 by sheriffbot@chromium.org, Jul 25 2017

Cc: sandeepkumars@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "sandeepkumars@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: Needs-Milestone

Comment 5 by ajha@chromium.org, Jul 27 2017

Labels: Needs-Feedback
Waiting for reply as per C#2 to proceed.

Comment 6 by rhour...@gmail.com, Jul 27 2017

Here's a sample reproducer extension.

Steps to reproduce the problem:
0. Unpack and load the extension into Chrome (v. 54 shows the gray area and it's easier to see)
1. Open chrome with a non-fullscreen mode. I used the command `GoogleChromePortable.exe --window-size=1024,768`
2. Navigate to a url of the page you want.
3. Click on the camera icon to the top right
** This will first apply the "Page.setDeviceMetricsOverride" then take a screenshot of that tab afterwards
** The screenshot will open in a new tab (which makes it easier to see the gray areas) and this is similar to what my original extension was doing.
4. If you repeat 1-3 but after changing the extension code to have `fitWindow: false` you see that the gray areas are gone.

I've tried the same with Chrome 59 the only difference is that the margin is white.

I'm not sure if this means there's a difference between the window size and the emulation device. 
In my original extension changing the parameter to mobile to true also seemed to solve this but I couldn't reproduce it with the current reproducible now.

Please let me know if you need more info. Thanks in advance.
screenshot.zip
4.3 KB Download
Project Member

Comment 7 by sheriffbot@chromium.org, Jul 27 2017

Cc: ajha@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "ajha@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: Needs-Feedback OS-Linux OS-Mac
Able to reproduce the issue on Windows 10 with chrome #59.0.3071.115 but not on the latest stable #60.0.3112.78
Attaching the screenshot for reference.

rhourieh@ could you please update chrome to the latest stable version and let us know your observations.

Note: Issue is also observed on Mac 10.12.5 and Ubuntu 14.04 in present stable #60.0.3112.78 and also in earlier versions M45, M46 builds.

Thank You... 



746429-M59.PNG
391 KB View Download
746429-M60.PNG
529 KB View Download

Comment 9 by rhour...@gmail.com, Aug 2 2017

Thank you for your feedback. I've updated to chrome #60.0.3112.78 (Official Build) beta (64-bit) (cohort: Beta) and I still can reproduce the issue. 

The issue was first observed in Ubuntu 16.04.2 LTS with Chrome #54. I couldn't verify the behavior there with chrome #60 yet.
Project Member

Comment 10 by sheriffbot@chromium.org, Aug 2 2017

Cc: kkaluri@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "kkaluri@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: pnangunoori@chromium.org
Owner: pfeldman@chromium.org
Status: Assigned (was: Unconfirmed)
Tested on Chrome Stable #60.0.3112.90 on Mac 10.12.5, Windows7 and Ubuntu 14.04 and able to reproduce the issue. However issue is not reproduced on latest Beta #61.0.3163.39 & Canary #62.0.3181.0.

Using the reverse bisect providing the bisect results,

Good Build:62.0.3163.0 (Revision:488528).
Bad Build:61.0.3162.0  (Revision:488073).

You are probably looking for a change made after 488471 (known good), but no later than 488472 (first known bad).

CHANGELOG URL:
The script might not always return single CL as suspect as some perf builds might get missing due to failure.
https://chromium.googlesource.com/chromium/src/+log/e51107e73a6f93cfb447d6f5b432c100ef31d309..cc099f72c9fe6f67590e70b2956e27a7b5e7ac38

Review ON: https://chromium-review.googlesource.com/572222

@pfeldman --  Could you please look into the issue, pardon me if it has nothing to do with your changes and if possible please assign it to owner concerned.

Note: This issue seems to be similar to  issue 742990 

Thanks.

Attaching screenshot for reference for C#11.
746429.png
2.0 MB View Download
Owner: dgozman@chromium.org
Status: WontFix (was: Assigned)
We do not support fitWindow anymore.
Since which version is fitWindow not supported?
It was done in https://chromium-review.googlesource.com/c/chromium/src/+/572222, which went into version 61.

Comment 17 by sscha...@gmail.com, Oct 16 2017

Is there a replacement for fitToWindow? I can still see it in the devtools, but the API does not have something that would suggest there is a new way of doing this.
Do i need to calculate the scale myself and pass it in with the device metrics?

Unfortunately the API documentation is very generic and does not give any information on how the fitToWindow behavior can be achieved again. I have tried scale and devicescale, but did not manage to scale anything down.
"Emulation.setPageScaleFactor" didn't change anything either.
The "scale" parameter of Emulation.setDeviceMetricsOverride should work just fine in this case, but you'll have to calculate it yourself.

Comment 19 by sscha...@gmail.com, Oct 18 2017

I debugged the developertools and figured out that it is necessary to set the screenWidth and screenHeight parameter and the scale value and then it worked fine.
Thanks

Sign in to add a comment