From 52074e41c57f5224ffa1e2ce3397974eccd36cb9 Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Mon, 14 Feb 2022 13:41:57 +0100 Subject: [PATCH] fix: revert changes related to layout metrics This PR partially reverts https://github.com/puppeteer/puppeteer/pull/7390 until crbug.com/1297087 is resolved. The pageX/pageY values returned by Page.getLayoutMetrics don't look correct. Fixes: #7999 --- src/common/JSHandle.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/common/JSHandle.ts b/src/common/JSHandle.ts index 1d7024de889b4..66acda64d1a25 100644 --- a/src/common/JSHandle.ts +++ b/src/common/JSHandle.ts @@ -957,9 +957,7 @@ export class ElementHandle< assert(boundingBox.height !== 0, 'Node has 0 height.'); const layoutMetrics = await this._client.send('Page.getLayoutMetrics'); - // Fallback to `layoutViewport` in case of using Firefox. - const { pageX, pageY } = - layoutMetrics.cssLayoutViewport || layoutMetrics.layoutViewport; + const { pageX, pageY } = layoutMetrics.layoutViewport; const clip = Object.assign({}, boundingBox); clip.x += pageX;