Skip to content

fix(webview): page.getContentQuads should work for elements inside <iframe>#41437

Open
dcrousso wants to merge 1 commit into
microsoft:mainfrom
dcrousso:fix-WKWebView-iframe-quads
Open

fix(webview): page.getContentQuads should work for elements inside <iframe>#41437
dcrousso wants to merge 1 commit into
microsoft:mainfrom
dcrousso:fix-WKWebView-iframe-quads

Conversation

@dcrousso

@dcrousso dcrousso commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

leverage elementFromPoint, getBoundingClientRect, and getComputedStyle to manually compute the offsets of each ancestor <iframe>

also use existing infrastructure of error:notconnected to tell the caller to re-resolve the element in the parent context

@dcrousso dcrousso requested review from pavelfeldman and yury-s June 23, 2026 22:33
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

let frameDoc: Document | null = null;
let frameView: (Window & typeof globalThis) | null = null;
try {
frameDoc = frame.contentDocument;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch is unlikely to work as iframes are typically cross-origin.

target.value = target.value.slice(0, start) + text + target.value.slice(end);
if (!target)
return;
const view = target.ownerDocument.defaultView;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a part of a separate change.

…`<iframe>`

leverage `elementFromPoint`, `getBoundingClientRect`, and `getComputedStyle` to manually compute the offsets of each ancestor `<iframe>`

also use existing infrastructure of `error:notconnected` to tell the caller to re-resolve the element in the parent context
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

3 failed
❌ [chromium] › mcp/http.spec.ts:349 › client should receive list roots request @mcp-windows-latest-chromium
❌ [chromium] › mcp/http.spec.ts:349 › client should receive list roots request @mcp-ubuntu-latest-chromium
❌ [firefox] › mcp/http.spec.ts:349 › client should receive list roots request @mcp-macos-latest-firefox

7377 passed, 1122 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

2 failed
❌ [chromium-library] › library/browsercontext-add-init-script.spec.ts:28 › should work without navigation, after all bindings @chromium-ubuntu-22.04-arm-node20
❌ [chromium-library] › library/browsercontext-expose-function.spec.ts:77 › should be callable from-inside addInitScript @chromium-ubuntu-22.04-arm-node20

2 flaky ⚠️ [chromium-library] › library/chromium/chromium.spec.ts:211 › should intercept service worker requests (main and within) `@chromium-ubuntu-22.04-node20`
⚠️ [chromium-library] › library/video.spec.ts:717 › screencast › should work with video+trace `@chromium-ubuntu-22.04-node20`

49072 passed, 1142 skipped


Merge workflow run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants