-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inform client if intercepted navigation failed
https://bugs.webkit.org/show_bug.cgi?id=260638 rdar://105809792 Reviewed by Brent Fulgham and J Pascoe. A client may allow a navigation, but that navigation is ignored anyway. In this situation, the client may never learn that the navigation was canceled. In the specific case for SOAuthentication, the client may allow the navigation but then that decision is overridden by SOAuthentication and the request is cancelled. When this happens, WebKit doesn't dispatch a failure because we never reach the provisional load stage. This change addresses this issue by identifying when a policy decision was intercepted and the resulting decision is PolicyAction::Ignore. In this case, we dispatch didFailProvisionalNavigation. We make this call in WebPageProxy::receivedNavigationPolicyDecision because if we call it earlier then WKWebView::isLoading returns true and this is wrong and confuses clients. Most of this patch is just plumbing. This change extends the existing test and resolves the FIXME. * Source/WebKit/UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): * Source/WebKit/UIProcess/WebFramePolicyListenerProxy.cpp: (WebKit::WebFramePolicyListenerProxy::didReceiveAppBoundDomainResult): (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults): (WebKit::WebFramePolicyListenerProxy::didReceiveInitialLinkDecorationFilteringData): (WebKit::WebFramePolicyListenerProxy::use): (WebKit::WebFramePolicyListenerProxy::download): (WebKit::WebFramePolicyListenerProxy::ignore): * Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h: * Source/WebKit/UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::setUpPolicyListenerProxy): * Source/WebKit/UIProcess/WebFrameProxy.h: * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedNavigationPolicyDecision): (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::decidePolicyForNewWindowAction): (WebKit::WebPageProxy::decidePolicyForResponseShared): * Source/WebKit/UIProcess/WebPageProxy.h: * Tools/TestWebKitAPI/Tests/WebKitCocoa/SOAuthorizationTests.mm: (-[TestSOAuthorizationDelegate webView:didFailProvisionalNavigation:withError:]): (resetState): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/267360@main
- Loading branch information
Showing
8 changed files
with
52 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.