Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js |
| index 8f3b0599ccc04f8fbacac2070d9b68372254b95f..061f5ca982dd61013556f590cdf1f6e51c72a074 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js |
| @@ -636,6 +636,9 @@ Emulation.DeviceModeModel = class { |
| if (!metrics) |
| return null; |
| + if (!this._emulatedPageSize) |
| + this._calculateAndEmulate(false); |
| + |
| var pageSize = fullSize ? new UI.Size(metrics.contentWidth, metrics.contentHeight) : this._emulatedPageSize; |
| var promises = []; |
| promises.push( |
| @@ -657,11 +660,11 @@ Emulation.DeviceModeModel = class { |
| await Promise.all(promises); |
| var screenshot = await screenCaptureModel.captureScreenshot('png', 100); |
| + this._calculateAndEmulate(false); |
|
dgozman
2017/04/21 20:40:54
You can move this back now.
pfeldman
2017/04/21 20:51:35
Done.
|
| this._target.emulationAgent().setVisibleSize( |
| Math.floor(this._emulatedPageSize.width * this._scale), |
| Math.floor(this._emulatedPageSize.height * this._scale)); |
| this._target.emulationAgent().resetViewport(); |
| - this._calculateAndEmulate(false); |
| return screenshot; |
| } |