Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use content box for OOPIF offset calculations #7911

Merged
merged 1 commit into from Jan 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/common/JSHandle.ts
Expand Up @@ -489,14 +489,14 @@ export class ElementHandle<
const { backendNodeId } = await parent._client.send('DOM.getFrameOwner', {
frameId: frame._id,
});
const { quads } = await parent._client.send('DOM.getContentQuads', {
const result = await parent._client.send('DOM.getBoxModel', {
backendNodeId: backendNodeId,
});
if (!quads || !quads.length) {
if (!result) {
break;
}
const protocolQuads = quads.map((quad) => this._fromProtocolQuad(quad));
const topLeftCorner = protocolQuads[0][0];
const contentBoxQuad = result.model.content;
const topLeftCorner = this._fromProtocolQuad(contentBoxQuad)[0];
offsetX += topLeftCorner.x;
offsetY += topLeftCorner.y;
frame = parent;
Expand Down