Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e9ef495209f921d30fddb6656e29d3b5b27678bd
      
https://github.com/WebKit/WebKit/commit/e9ef495209f921d30fddb6656e29d3b5b27678bd
  Author: Charlie Wolfe <[email protected]>
  Date:   2026-02-05 (Thu, 05 Feb 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/WebKitCocoa/SafeBrowsing.mm

  Log Message:
  -----------
  Delay showing modal alerts until Safe Browsing response
rdar://163939987
https://bugs.webkit.org/show_bug.cgi?id=302772

Reviewed by Pascoe.

In the case where a Safe Browsing check takes long enough that we load
the page, we should delay showing modal dialogs until we get a response
back. This patch does it for alerts, but it can be expanded.

The absolute max time this could take is 5 seconds.

Initially from PR #54171

Test: Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm
* Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::beginSafeBrowsingCheck):
(WebKit::WebPageProxy::deferModalUntilSafeBrowsingCompletes):
(WebKit::WebPageProxy::completeSafeBrowsingCheckForModals):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForResponseShared):
(WebKit::WebPageProxy::showBrowsingWarning):
(WebKit::WebPageProxy::runJavaScriptAlert):
(WebKit::WebPageProxy::runJavaScriptConfirm):
(WebKit::WebPageProxy::runJavaScriptPrompt):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
(-[ModalDeferralDelegate webView:didCommitNavigation:]):
(-[ModalDeferralDelegate _webViewDidShowSafeBrowsingWarning:]):
(-[ModalDeferralDelegate 
webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):
(-[ModalDeferralDelegate 
webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:completionHandler:]):
(-[ModalDeferralDelegate 
webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:completionHandler:]):
(TEST(SafeBrowsing, ModalShownImmediatelyWhenNoCheck)):
(TEST(SafeBrowsing, ModalDeferredDuringCheck)):
(TEST(SafeBrowsing, DeferredModalShownWhenProceedingThroughWarning)):
(TEST(SafeBrowsing, DeferredModalSuppressedWhenGoingBack)):
(TEST(SafeBrowsing, MultipleDeferredModalsShownInOrder)):
(TEST(SafeBrowsing, DeferredModalsClearedOnNavigation)):
(TEST(SafeBrowsing, ModalShownWhenCheckCompletesClean)):
(TEST(SafeBrowsing, AllModalTypesProperlyDeferred)):

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



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

Reply via email to