Skip to content

Commit

Permalink
fix: revert changes related to layout metrics
Browse files Browse the repository at this point in the history
This PR partially reverts #7390
until crbug.com/1297087 is resolved. The pageX/pageY values returned
by Page.getLayoutMetrics don't look correct.

Fixes: #7999
  • Loading branch information
OrKoN committed Feb 14, 2022
1 parent d5deb92 commit d38b47a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/common/JSHandle.ts
Expand Up @@ -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;
Expand Down

0 comments on commit d38b47a

Please sign in to comment.