Navigations on the same host (but with different schemes and ports) should not trigge...
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Oct 2015 00:09:20 +0000 (00:09 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Oct 2015 00:09:20 +0000 (00:09 +0000)
commitbd09dfd6962dc8e05a2d6b2067c1739980b677be
treef3d11a2972d551f7ef329af048967178f8ff345e
parent5d0c37c6ce3ce48ebb149b75bd365b4ea929d6e8
Navigations on the same host (but with different schemes and ports) should not trigger universal links
<rdar://problem/22811325>
https://bugs.webkit.org/show_bug.cgi?id=150481

Reviewed by Dan Bernstein.

Source/WebCore:

Add new helper which efficiently compares the hosts of two URLs.

* platform/URL.cpp:
(WebCore::hostsAreEqual):
* platform/URL.h:

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.mm:
(shouldTryAppLink):
Update the policy for following universal links to only take host into consideration.

Source/WebKit2:

Update the policy for following universal links to only take host into consideration.

* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::createNewPage):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::createNewPage):
(WebKit::WebPageProxy::showPage):

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm:
Update test to test that navigations on the same host but with different schemes does not
trigger universal links, but that changes in the host do.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191487 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/URL.cpp
Source/WebCore/platform/URL.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm
Source/WebKit2/UIProcess/WebPageProxy.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm