Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 189bef0d1cc76b0a8505b9f765f1666fc7cf2f1a
      
https://github.com/WebKit/WebKit/commit/189bef0d1cc76b0a8505b9f765f1666fc7cf2f1a
  Author: BJ Burg <[email protected]>
  Date:   2025-06-12 (Thu, 12 Jun 2025)

  Changed paths:
    M Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp
    M Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.h
    M Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.messages.in

  Log Message:
  -----------
  Web Automation: Switch to Frame should actually focus the frame
https://bugs.webkit.org/show_bug.cgi?id=293445
<rdar://151870530>

Reviewed by Devin Rousso.

Focusing the frame upon switching is required by the WebDriver specification.

This is a partial fix for several existing test_no_browsing_context failures.
With this fix, the driver-side implementation may infer that a frame is no 
longer
valid if Automation.switchToBrowsingContext with a frame argument fails. This 
is used
to implement spec steps such as

"if the current browsing context is no longer open, return no such window".

Prior to this change, switching to a detached frame as in the wpt fixture 
`closed_frame`
would *not* fail as expected, causing the driver to think that the frame 
reference is still
valid, even when it is not.

* Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::switchToBrowsingContext):
If the command is targeted at a frame, perform the IPC to focus the frame in 
the frame's web process.

* Source/WebKit/UIProcess/WebPageProxy.cpp: Add new template instantation.

* Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::focusFrame): Added. Make sure to check that
the page, frame, and the frame's page reference are all valid before trying to 
focus the frame.
* Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.h:
* Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.messages.in: 
Add new IPC message.

Canonical link: https://commits.webkit.org/296164@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to