Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0a6b5cd60b4f57cd24ce6131b0a40a0201d67a47
      
https://github.com/WebKit/WebKit/commit/0a6b5cd60b4f57cd24ce6131b0a40a0201d67a47
  Author: Zak Ridouh <[email protected]>
  Date:   2026-05-18 (Mon, 18 May 2026)

  Changed paths:
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm

  Log Message:
  -----------
  [Site Isolation] Route popup menu value-changed IPC to the originating frame
https://bugs.webkit.org/show_bug.cgi?id=312527
rdar://174886701

Reviewed by Lily Spiniolas.

When a <select> popup menu is open, focus can move to a remote frame during
the popup's nested run loop. WebPageProxy::Internals::valueChangedForPopupMenu()
previously called focusedOrMainFrame() to find the destination process for the
DidChangeSelectedIndexForActivePopupMenu IPC.

With site isolation, that may resolve to a different process than the one that 
hosts the <select>, so the
selection change is delivered to the wrong process. The originating WebProcess
never receives the close signal, leaving its m_popupIsVisible state stuck and
making the <select> appear broken, the next click is interpreted as a dismiss
rather than an open, and the chosen option never reaches the DOM.

Capture the originating frame's identifier in m_activePopupMenuFrameID at
showPopupMenu() time and use it to route both 
DidChangeSelectedIndexForActivePopupMenu
and (on non-Cocoa platforms) SetTextForActivePopupMenu. Clear the identifier in
hidePopupMenu() and resetState().

Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm

* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::Internals::valueChangedForPopupMenu):
(WebKit::WebPageProxy::Internals::setTextFromItemForPopupMenu):
(WebKit::WebPageProxy::showPopupMenuFromFrame):
(WebKit::WebPageProxy::showPopupMenu):
(WebKit::WebPageProxy::hidePopupMenu):
(WebKit::WebPageProxy::resetState):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm:
(TestWebKitAPI::(SiteIsolation, 
SelectElementPopupAfterFocusChangesDuringTracking)):

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



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

Reply via email to