Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 579c1775de1beb3e120ecc9fec28aff79c1039d0
      
https://github.com/WebKit/WebKit/commit/579c1775de1beb3e120ecc9fec28aff79c1039d0
  Author: Alex Christensen <[email protected]>
  Date:   2025-10-03 (Fri, 03 Oct 2025)

  Changed paths:
    M Source/WebKit/UIProcess/WebPageProxy.cpp

  Log Message:
  -----------
  Send PolicyAction::LoadWillContinueInAnotherProcess before continuing 
navigation in new process
https://bugs.webkit.org/show_bug.cgi?id=300136
rdar://161919928

Reviewed by Brian Weinstein.

This is needed to fix the 
TestWebKitAPI.SiteIsolation.NavigateIframeToProvisionalNavigationFailure
after unrelated changes in https://github.com/WebKit/WebKit/pull/51676.  
Particularly, in
DocumentLoader::willSendRequest, we need to make this early return work when 
the parent frame is a RemoteFrame:

RefPtr parentFrame = dynamicDowncast<LocalFrame>(frame->tree().parent());
if (!parentFrame)
   return completionHandler(WTFMove(newRequest));

Removing that early return makes it so the test navigating the iframe to 
https://webkit.org/redirect_to_webkit_terminate
results in an _WKErrorCodeFrameLoadInterruptedByPolicyChange instead of the 
correct NSURLErrorNetworkConnectionLost
because the call to continueNavigationInNewProcess happens before telling the 
"old" process that the load will continue
in a new process, which results in the ProvisionalFrameProxy being destroyed, 
which sends
Messages::WebFrame::DestroyProvisionalFrame, which calls 
invalidatePolicyListeners with this stack trace:

WebKit::WebFrame::invalidatePolicyListeners()
WebKit::WebLocalFrameLoaderClient::cancelPolicyCheck()
WebCore::PolicyChecker::stopCheck()
WebCore::FrameLoader::stopLoading(WebCore::UnloadEventPolicy)
WebCore::FrameLoader::closeURL()
WebCore::FrameLoader::detachFromParent()
WebKit::WebFrame::destroyProvisionalFrame()

That policy listener invalidation uses PolicyAction::Ignore which sends a 
_WKErrorCodeFrameLoadInterruptedByPolicyChange
to the UI process.  With this change, the policy listener is correctly taken 
care of with
PolicyAction::LoadWillContinueInAnotherProcess before destroying the 
provisional frame.

* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationActionPolicyDecision):

Canonical link: https://commits.webkit.org/300979@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