fix(screenshots): throw on 0x0 screenshots (#3756)

Fix #2672
This commit is contained in:
Joel Einbinder
2019-01-11 15:24:43 -08:00
committed by Andrey Lushnikov
parent 29a2438534
commit 96adedf54f
3 changed files with 8 additions and 3 deletions

View File

@@ -504,6 +504,8 @@ class ElementHandle extends JSHandle {
boundingBox = await this.boundingBox();
assert(boundingBox, 'Node is either not visible or not an HTMLElement');
assert(boundingBox.width !== 0, 'Node has 0 width.');
assert(boundingBox.height !== 0, 'Node has 0 height.');
const { layoutViewport: { pageX, pageY } } = await this._client.send('Page.getLayoutMetrics');