WKWebView has old URL while displaying SafeBrowsing interstitial, for link-click...
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Dec 2018 18:26:33 +0000 (18:26 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Dec 2018 18:26:33 +0000 (18:26 +0000)
commit295302f0ac9e6e21e08e55d9a8d92dd914a215c1
treef059ea6f34d1b83d753ee02b4837f2315950cd36
parentf2fe652f5d01ce35426373bbb6562bff8a7e44a3
WKWebView has old URL while displaying SafeBrowsing interstitial, for link-click navigations
https://bugs.webkit.org/show_bug.cgi?id=192675

Reviewed by Geoffrey Garen.

Source/WebKit:

When a safe browsing warning is being shown, WKWebView.URL should be the unsafe website, not the safe website before it.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
(-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
(WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
* UIProcess/SafeBrowsingWarning.h:
(WebKit::SafeBrowsingWarning::create):
(WebKit::SafeBrowsingWarning::url const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
(goBack):
(TEST):
(visitUnsafeSite):
(-[SafeBrowsingHelper observeValueForKeyPath:ofObject:change:context:]):
(-[SafeBrowsingHelper webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239339 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
Source/WebKit/UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm
Source/WebKit/UIProcess/SafeBrowsingWarning.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm