Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: adb057839de955260036324af1343aa8dbb4875d
https://github.com/WebKit/WebKit/commit/adb057839de955260036324af1343aa8dbb4875d
Author: Brady Eidson <[email protected]>
Date: 2026-07-28 (Tue, 28 Jul 2026)
Changed paths:
M Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.h
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm
Log Message:
-----------
Queue multiple JS dialog requests in the UI process (possible with site
isolation enabled)
rdar://156027399
https://bugs.webkit.org/show_bug.cgi?id=320429
Reviewed by Alex Christensen.
With site isolation, a single WKWebView can have multiple web content processes
at once.
Each of those processes might be making a request to show a modal JS dialog,
meaning the UI process can receive multiple requests at once.
Before site isolation, a WebKit API client would only ever receive a single JS
dialog
request at once for a given WKWebView, but now they might receive more than one
at once.
This is a surprising and probably breaking change, and was unintentional. So
this patch
teaches the UI process to queue API dialog requests and send them to the client
serially.
There was already an instance where we queued "modal dialog requests" - which
was while the
web page was waiting on a safe browsing check - and this PR rolls these two
queues into one.
Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm
* Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::completeSafeBrowsingCheckForModals):
(WebKit::WebPageProxy::drainDeferredModalsForNewNavigation):
(WebKit::WebPageProxy::deferModalUntilSafeBrowsingCompletes): Deleted.
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::runModalJavaScriptDialog):
(WebKit::WebPageProxy::runNextModalJavaScriptDialogIfNeeded):
(WebKit::WebPageProxy::purgeQueuedModalDialogs):
(WebKit::WebPageProxy::runJavaScriptAlert):
(WebKit::WebPageProxy::runJavaScriptConfirm):
(WebKit::WebPageProxy::runJavaScriptPrompt):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm:
(TestWebKitAPI::TEST(SiteIsolation,
SimultaneousDialogsFromMultipleCrossOriginFrames)):
(TestWebKitAPI::TEST(SiteIsolation, QueuedDialogPurgedByMainFrameNavigation)):
Canonical link: https://commits.webkit.org/318134@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications