Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3d5f53ae29749019158dd9c055f16c73547f3a36
      
https://github.com/WebKit/WebKit/commit/3d5f53ae29749019158dd9c055f16c73547f3a36
  Author: Ryosuke Niwa <[email protected]>
  Date:   2026-09-24 (Thu, 24 Sep 2026)

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

  Log Message:
  -----------
  [Site Isolation] Mouse events should not be affected by a unresponsive iframe 
process
https://bugs.webkit.org/show_bug.cgi?id=324938
rdar://129038359

Reviewed by Charlie Wolfe.

WebPageProxy has a single mouse event queue for the page and only sends the 
next event once the
current one has been replied to. When the main frame forwards an event to an 
iframe in another
process, the queue could get stuck forever, blocking mouse events for every 
frame in the page:

1. The iframe process hangs and never replies. Mouse moves don't even start the 
responsiveness timer.
2. The iframe process goes away (e.g. it was terminated for being 
unresponsive). The reply is
   cancelled with a null connection, and we returned without retiring the 
event. The queue was
   only cleared when the main frame's process exited.
3. The target frame no longer exists when the event is forwarded, so nothing 
was sent and the
   event was never retired.

Fix these by retiring the event as unhandled when the reply is cancelled or the 
target frame is
gone, and by adding a timeout for events forwarded to a subframe process. Also 
make the reply
handler ignore replies for events that are no longer at the front of the queue 
so that a late or
cancelled reply can't retire a newer event.

Tests: 
TestWebKitAPI.SiteIsolation.MouseEventsAfterHoveringOverUnresponsiveSubframe
       
TestWebKitAPI.SiteIsolation.MouseEventsAfterUnresponsiveSubframeProcessIsTerminated

* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::Internals::Internals):
(WebKit::WebPageProxy::sendMouseEvent):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
(WebKit::WebPageProxy::mouseEventHandlingCompleted):
(WebKit::WebPageProxy::remoteFrameMouseEventTimedOut):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxyInternals.h:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm:
(TestWebKitAPI::waitForMainFrameMouseDown):
(TestWebKitAPI::TEST(SiteIsolation, 
MouseEventsAfterHoveringOverUnresponsiveSubframe)):
(TestWebKitAPI::TEST(SiteIsolation, 
MouseEventsAfterUnresponsiveSubframeProcessIsTerminated)):

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



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

Reply via email to