New issue
Advanced search Search tips

Issue 652938 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 1
Type: Bug



Sign in to add a comment

[REGRESSION] DevTools: Screenshots functionality in DevTools is broken in many ways

Project Member Reported by pbakaus@chromium.org, Oct 5 2016

Issue description

The "Capture Screenshot" functionality in Device Mode produces a variety of bugs.

In the attached screenshots, you can observe the following:

1) Nexus 6P: Device Art is horizontally stretched, viewport is not correctly positioned at all


2) Nexus 5X: Same issue, but slightly more subtle – viewport is too small to fit.
 
m.ebay.com-sch-amp-16GB-iPhone-5s-Smartphones-9355-bn_341667-i.html-isRefine=true&_mwBanner=1(Nexus 6P).png
167 KB View Download
m.ebay.com-sch-amp-16GB-iPhone-5s-Smartphones-9355-bn_341667-i.html-isRefine=true&_mwBanner=1(Nexus 5X).png
160 KB View Download

Comment 1 by l...@chromium.org, Oct 5 2016

Labels: -Pri-3 Pri-2
Owner: l...@chromium.org
Status: Assigned (was: Unconfirmed)
Confirmed on stable Linux, 53.0.2785.143
:(

Comment 2 by l...@chromium.org, Oct 5 2016

Cc: dgozman@chromium.org
Labels: -Pri-2 M-54 ReleaseBlock-Stable Pri-1
Summary: [REGRESSION] DevTools: Screenshots functionality in DevTools is broken in many ways (was: DevTools: Screenshots functionality in DevTools is broken in many ways)
Let's try to fix and merge into M54.
Labels: Needs-Bisect
Cc: kkaluri@chromium.org
Labels: -Needs-Bisect OS-Linux OS-Windows
Able to reproduce this issue in Win10, MAC10.12 and ubuntu14.04 with latest stable  version 53.0.2785.143. Observed that "show device frame " is implemented from 52.0.2737.0 version.
From this version itself, the screenshot functionality is not working correctly.
Attached the screenshot with their file names as version for reference and removing bisect label for now. Please feel free to add back if it is required.
52.0.2737.0.png
223 KB View Download
52.0.2738.0.png
226 KB View Download
52.0.2740.0.png
264 KB View Download
53.0.2750.0.png
220 KB View Download
53.0.2785.116.png
211 KB View Download

Comment 6 by l...@chromium.org, Oct 6 2016

Thank you for the bisect.

It turns out that our current Nexus 5X/6P device outline images had a different aspect ratio from our calculated outlineRect.  DeviceModeView tried to rectify the former by setting the element's width, height in CSS using applyRect().  However, the SVG image's intrinsic size isn't overridden by this.

In order for screenshots to appear correctly, all SVGs need to have the same aspect ratio as (inset.top + screen.height + inset.bottom) / (inset.left + screen.width + inset.right), where inset comes from values in the emulated_devices/module.json.

Ideally, we would be able to either hard code correct insets and not worry about the SVG dimensions, or hard code a correct SVG and compute insets at runtime.
A friendly reminder that M53 Stable is launching VERY soon! Your bug is labelled as Stable Release Block Stable, please make sure to land the fix and get it merged into the release branch ASAP (before 5:00 PM PT, Monday) so we can take it for next weeks LAST Beta release for Desktop. Thank you!

Comment 8 by l...@chromium.org, Oct 7 2016

Status: Started (was: Assigned)
Thanks for letting us know the deadline.  The CL is in CQ, and I'll be sure to request merge once it's on Canary.

https://codereview.chromium.org/2387353005/
Project Member

Comment 9 by bugdroid1@chromium.org, Oct 7 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ecbadddd6fdc69baeca94183e6805ba10eb587e2

commit ecbadddd6fdc69baeca94183e6805ba10eb587e2
Author: luoe <luoe@chromium.org>
Date: Fri Oct 07 23:00:32 2016

DevTools: disable smoothing and correct nexus device frame dimensions for screenshots

For Nexus5X and Nexus6P presets, the existing SVGs were not well sized. That is:
height of device outline !== insets.top + screenSize.height + insets.bottom
This produced a noticeable gap in device mode screenshots. This CL corrects the
SVGs and insets to match measured dimensions.

Additionally, canvas drawn images look blurry in a device mode screenshots since
canvas contexts' imageSmoothingEnabled property is true by default. This CL
disables unnecessary smoothing.

BUG= 652938 

Review-Url: https://codereview.chromium.org/2387353005
Cr-Commit-Position: refs/heads/master@{#424001}

[modify] https://crrev.com/ecbadddd6fdc69baeca94183e6805ba10eb587e2/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus5X-landscape.svg
[modify] https://crrev.com/ecbadddd6fdc69baeca94183e6805ba10eb587e2/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus5X-portrait.svg
[modify] https://crrev.com/ecbadddd6fdc69baeca94183e6805ba10eb587e2/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus6P-landscape.svg
[modify] https://crrev.com/ecbadddd6fdc69baeca94183e6805ba10eb587e2/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus6P-portrait.svg
[modify] https://crrev.com/ecbadddd6fdc69baeca94183e6805ba10eb587e2/third_party/WebKit/Source/devtools/front_end/emulated_devices/module.json
[modify] https://crrev.com/ecbadddd6fdc69baeca94183e6805ba10eb587e2/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js

Comment 10 by l...@chromium.org, Oct 8 2016

Labels: Merge-Request-54
I tested that screenshots look correct on compiled Chromium on Linux, Windows 10/Canary 56.0.2884.0, and Mac/56.0.2884.0.

Comment 11 by dimu@chromium.org, Oct 8 2016

Labels: -Merge-Request-54 Merge-Approved-54 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M54 (branch: 2840)
Project Member

Comment 12 by bugdroid1@chromium.org, Oct 10 2016

Labels: -merge-approved-54 merge-merged-2840
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/451e4a3e46ba8c942386fec3901d2196e33dad25

commit 451e4a3e46ba8c942386fec3901d2196e33dad25
Author: luoe <luoe@chromium.org>
Date: Mon Oct 10 17:38:59 2016

DevTools: disable smoothing and correct nexus device frame dimensions for screenshots

For Nexus5X and Nexus6P presets, the existing SVGs were not well sized. That is:
height of device outline !== insets.top + screenSize.height + insets.bottom
This produced a noticeable gap in device mode screenshots. This CL corrects the
SVGs and insets to match measured dimensions.

Additionally, canvas drawn images look blurry in a device mode screenshots since
canvas contexts' imageSmoothingEnabled property is true by default. This CL
disables unnecessary smoothing.

BUG= 652938 

Review-Url: https://codereview.chromium.org/2387353005
Cr-Commit-Position: refs/heads/master@{#424001}
(cherry picked from commit ecbadddd6fdc69baeca94183e6805ba10eb587e2)
NOTRY=true
NOPRESUBMIT=true

Review-Url: https://codereview.chromium.org/2408603002
Cr-Commit-Position: refs/branch-heads/2840@{#699}
Cr-Branched-From: 1ae106dbab4bddd85132d5b75c670794311f4c57-refs/heads/master@{#414607}

[modify] https://crrev.com/451e4a3e46ba8c942386fec3901d2196e33dad25/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus5X-landscape.svg
[modify] https://crrev.com/451e4a3e46ba8c942386fec3901d2196e33dad25/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus5X-portrait.svg
[modify] https://crrev.com/451e4a3e46ba8c942386fec3901d2196e33dad25/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus6P-landscape.svg
[modify] https://crrev.com/451e4a3e46ba8c942386fec3901d2196e33dad25/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus6P-portrait.svg
[modify] https://crrev.com/451e4a3e46ba8c942386fec3901d2196e33dad25/third_party/WebKit/Source/devtools/front_end/emulated_devices/module.json
[modify] https://crrev.com/451e4a3e46ba8c942386fec3901d2196e33dad25/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js

Comment 13 by l...@chromium.org, Oct 10 2016

Status: Fixed (was: Started)
Labels: TE-Verified-54.0.2840.59 TE-Verified-M54
Tested in Chrome beta version 54.0.2840.59 in Windows 10, ubuntu 14.04 and mac 10.12.

In all these OS platforms, the issue is fixed.

Please check the attached screenshots. 
UB-Nexus6p.png
174 KB View Download
UB-Nexus5X.png
154 KB View Download
UB-iphone6plus.png
179 KB View Download
UB-iphone6.png
155 KB View Download

Comment 15 by l...@chromium.org, Oct 13 2016

Status: Verified (was: Fixed)
Thank you, those screenshots look good to me!
Project Member

Comment 16 by bugdroid1@chromium.org, Oct 27 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/451e4a3e46ba8c942386fec3901d2196e33dad25

commit 451e4a3e46ba8c942386fec3901d2196e33dad25
Author: luoe <luoe@chromium.org>
Date: Mon Oct 10 17:38:59 2016

DevTools: disable smoothing and correct nexus device frame dimensions for screenshots

For Nexus5X and Nexus6P presets, the existing SVGs were not well sized. That is:
height of device outline !== insets.top + screenSize.height + insets.bottom
This produced a noticeable gap in device mode screenshots. This CL corrects the
SVGs and insets to match measured dimensions.

Additionally, canvas drawn images look blurry in a device mode screenshots since
canvas contexts' imageSmoothingEnabled property is true by default. This CL
disables unnecessary smoothing.

BUG= 652938 

Review-Url: https://codereview.chromium.org/2387353005
Cr-Commit-Position: refs/heads/master@{#424001}
(cherry picked from commit ecbadddd6fdc69baeca94183e6805ba10eb587e2)
NOTRY=true
NOPRESUBMIT=true

Review-Url: https://codereview.chromium.org/2408603002
Cr-Commit-Position: refs/branch-heads/2840@{#699}
Cr-Branched-From: 1ae106dbab4bddd85132d5b75c670794311f4c57-refs/heads/master@{#414607}

[modify] https://crrev.com/451e4a3e46ba8c942386fec3901d2196e33dad25/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus5X-landscape.svg
[modify] https://crrev.com/451e4a3e46ba8c942386fec3901d2196e33dad25/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus5X-portrait.svg
[modify] https://crrev.com/451e4a3e46ba8c942386fec3901d2196e33dad25/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus6P-landscape.svg
[modify] https://crrev.com/451e4a3e46ba8c942386fec3901d2196e33dad25/third_party/WebKit/Source/devtools/front_end/emulated_devices/Nexus6P-portrait.svg
[modify] https://crrev.com/451e4a3e46ba8c942386fec3901d2196e33dad25/third_party/WebKit/Source/devtools/front_end/emulated_devices/module.json
[modify] https://crrev.com/451e4a3e46ba8c942386fec3901d2196e33dad25/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js

Sign in to add a comment