Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f0d922f81710f89bc41c9fc196b5326689574d8b
      
https://github.com/WebKit/WebKit/commit/f0d922f81710f89bc41c9fc196b5326689574d8b
  Author: Razvan Caliman <[email protected]>
  Date:   2026-07-29 (Wed, 29 Jul 2026)

  Changed paths:
    M Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h

  Log Message:
  -----------
  [Site Isolation] WebDriver commands fail with "no such window" in 
out-of-process iframes
https://bugs.webkit.org/show_bug.cgi?id=320563
rdar://183529776

Reviewed by BJ Burg.

Automation commands that operate on a specific frame route their IPC to the
process hosting that frame via `sendWithAsyncReplyToProcessContainingFrame...`,
but pass `webPageIDInMainFrameProcess()` as the destination page identifier.

That identifier is only valid in the main frame's process. With
site isolation,
a cross-origin (out-of-process) frame lives in a different `WebProcess`, where 
the
`RemotePage`'s `WebPage` is registered under a freshly generated 
`PageIdentifier`.

The `WebProcess`-side handler resolves the page with 
`WebProcess::webPage(pageID)`,
which returns null for the main frame id, so the command fails with a
`WindowNotFound ("no such window")` error.

Add `WebPageProxy::webPageIDInProcessForFrame()`, which return the page 
identifier valid
in the process that actually hosts the frame. For the main frame this resolves 
to the
main frame process and returns m_webPageID, so the non-isolated path is 
unchanged.
Use it at every frame-scoped automation call site.

*
Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::switchToBrowsingContext):
(WebKit::WebAutomationSession::evaluateJavaScriptFunction):
(WebKit::WebAutomationSession::resolveChildFrameHandle):
(WebKit::WebAutomationSession::resolveParentFrameHandle):
(WebKit::WebAutomationSession::computeElementLayout):
(WebKit::WebAutomationSession::getComputedRole):
(WebKit::WebAutomationSession::consumeUserActivation):
(WebKit::WebAutomationSession::getComputedLabel):
(WebKit::WebAutomationSession::selectOptionElement):
(WebKit::WebAutomationSession::setFilesForInputFileUpload):
(WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
(WebKit::WebAutomationSession::evaluateBidiScript):
(WebKit::WebAutomationSession::takeScreenshot):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::webPageIDInProcessForFrame):
* Source/WebKit/UIProcess/WebPageProxy.h:

Canonical link:
https://flagged.apple.com:443/proxy?t2=Da1V8J7cn3&o=aHR0cHM6Ly9jb21taXRzLndlYmtpdC5vcmcvMzE4MTg3QG1haW4=&emid=bbb2dcce-b00b-4783-b398-ac9d7cb046aa&c=11



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to