<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[187065] branches/safari-601.1-branch</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/187065">187065</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2015-07-20 21:37:11 -0700 (Mon, 20 Jul 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/186964">r186964</a>. rdar://problem/21803781</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6011branchSourceWebCoreChangeLog">branches/safari-601.1-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6011branchSourceWebCoreloaderFrameLoadercpp">branches/safari-601.1-branch/Source/WebCore/loader/FrameLoader.cpp</a></li>
<li><a href="#branchessafari6011branchSourceWebKit2ChangeLog">branches/safari-601.1-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari6011branchSourceWebKit2UIProcessCocoaUIDelegatemm">branches/safari-601.1-branch/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm</a></li>
<li><a href="#branchessafari6011branchSourceWebKit2UIProcessWebPageProxycpp">branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#branchessafari6011branchSourceWebKit2UIProcessWebPageProxyh">branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#branchessafari6011branchSourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp">branches/safari-601.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#branchessafari6011branchSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp">branches/safari-601.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp</a></li>
<li><a href="#branchessafari6011branchToolsChangeLog">branches/safari-601.1-branch/Tools/ChangeLog</a></li>
<li><a href="#branchessafari6011branchToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">branches/safari-601.1-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari6011branchToolsTestWebKitAPITestsWebKit2CocoaShouldOpenExternalURLsInNewWindowActionsmm">branches/safari-601.1-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6011branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/ChangeLog (187064 => 187065)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/ChangeLog        2015-07-21 04:37:05 UTC (rev 187064)
+++ branches/safari-601.1-branch/Source/WebCore/ChangeLog        2015-07-21 04:37:11 UTC (rev 187065)
</span><span class="lines">@@ -1,5 +1,28 @@
</span><span class="cx"> 2015-07-20  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r186964. rdar://problem/21803781
+
+    2015-07-17  Dan Bernstein  &lt;mitz@apple.com&gt;
+
+            WebCore part of &lt;rdar://problem/21803781&gt; The external URL policy is not reported correctly in navigation actions that create new windows
+            https://bugs.webkit.org/show_bug.cgi?id=147040
+
+            Reviewed by Dean Jackson.
+
+            Test: TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm
+
+            * loader/FrameLoader.cpp:
+            (WebCore::shouldOpenExternalURLsPolicyToApply): Pulled the logic out of
+            applyShouldOpenExternalURLsPolicyToNewDocumentLoader into this new helper.
+            (WebCore::FrameLoader::loadURL): When targeting a new frame, apply the external URLs policy
+            to the action passed to checkNewWindowPolicy.
+            (WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader): Call the new
+            helper function.
+            (WebCore::createWindow): Include the external URL policy in the action passed to
+            createWindow.
+
+2015-07-20  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r186957. rdar://problem/21867831
</span><span class="cx"> 
</span><span class="cx">     2015-07-17  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCoreloaderFrameLoadercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/loader/FrameLoader.cpp (187064 => 187065)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/loader/FrameLoader.cpp        2015-07-21 04:37:05 UTC (rev 187064)
+++ branches/safari-601.1-branch/Source/WebCore/loader/FrameLoader.cpp        2015-07-21 04:37:11 UTC (rev 187065)
</span><span class="lines">@@ -1187,6 +1187,15 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicyToApply(Frame&amp; sourceFrame, ShouldOpenExternalURLsPolicy propagatedPolicy)
+{
+    if (!sourceFrame.isMainFrame())
+        return ShouldOpenExternalURLsPolicy::ShouldNotAllow;
+    if (ScriptController::processingUserGesture())
+        return ShouldOpenExternalURLsPolicy::ShouldAllow;
+    return propagatedPolicy;
+}
+
</ins><span class="cx"> void FrameLoader::loadURL(const FrameLoadRequest&amp; frameLoadRequest, const String&amp; referrer, FrameLoadType newLoadType, Event* event, PassRefPtr&lt;FormState&gt; prpFormState)
</span><span class="cx"> {
</span><span class="cx">     if (m_inStopAllLoaders)
</span><span class="lines">@@ -1233,6 +1242,7 @@
</span><span class="cx">     NavigationAction action(request, newLoadType, isFormSubmission, event, frameLoadRequest.shouldOpenExternalURLsPolicy());
</span><span class="cx"> 
</span><span class="cx">     if (!targetFrame &amp;&amp; !frameName.isEmpty()) {
</span><ins>+        action = action.copyWithShouldOpenExternalURLsPolicy(shouldOpenExternalURLsPolicyToApply(m_frame, frameLoadRequest.shouldOpenExternalURLsPolicy()));
</ins><span class="cx">         policyChecker().checkNewWindowPolicy(action, request, formState.release(), frameName, [this, allowNavigationToInvalidURL, openerPolicy](const ResourceRequest&amp; request, PassRefPtr&lt;FormState&gt; formState, const String&amp; frameName, const NavigationAction&amp; action, bool shouldContinue) {
</span><span class="cx">             continueLoadAfterNewWindowPolicy(request, formState, frameName, action, shouldContinue, allowNavigationToInvalidURL, openerPolicy);
</span><span class="cx">         });
</span><span class="lines">@@ -3457,12 +3467,7 @@
</span><span class="cx"> 
</span><span class="cx"> void FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader(DocumentLoader&amp; documentLoader, ShouldOpenExternalURLsPolicy propagatedPolicy)
</span><span class="cx"> {
</span><del>-    if (!m_frame.isMainFrame())
-        documentLoader.setShouldOpenExternalURLsPolicy(ShouldOpenExternalURLsPolicy::ShouldNotAllow);
-    else if (ScriptController::processingUserGesture())
-        documentLoader.setShouldOpenExternalURLsPolicy(ShouldOpenExternalURLsPolicy::ShouldAllow);
-    else
-        documentLoader.setShouldOpenExternalURLsPolicy(propagatedPolicy);
</del><ins>+    documentLoader.setShouldOpenExternalURLsPolicy(shouldOpenExternalURLsPolicyToApply(m_frame, propagatedPolicy));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool FrameLoaderClient::hasHTMLView() const
</span><span class="lines">@@ -3504,7 +3509,8 @@
</span><span class="cx">     if (!oldPage)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    Page* page = oldPage-&gt;chrome().createWindow(&amp;openerFrame, requestWithReferrer, features, NavigationAction(requestWithReferrer.resourceRequest()));
</del><ins>+    ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy = shouldOpenExternalURLsPolicyToApply(openerFrame, request.shouldOpenExternalURLsPolicy());
+    Page* page = oldPage-&gt;chrome().createWindow(&amp;openerFrame, requestWithReferrer, features, NavigationAction(requestWithReferrer.resourceRequest(), shouldOpenExternalURLsPolicy));
</ins><span class="cx">     if (!page)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebKit2/ChangeLog (187064 => 187065)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebKit2/ChangeLog        2015-07-21 04:37:05 UTC (rev 187064)
+++ branches/safari-601.1-branch/Source/WebKit2/ChangeLog        2015-07-21 04:37:11 UTC (rev 187065)
</span><span class="lines">@@ -1,5 +1,38 @@
</span><span class="cx"> 2015-07-20  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r186964. rdar://problem/21803781
+
+    2015-07-17  Dan Bernstein  &lt;mitz@apple.com&gt;
+
+            WebKit2 part of &lt;rdar://problem/21803781&gt; The external URL policy is not reported correctly in navigation actions that create new windows
+            https://bugs.webkit.org/show_bug.cgi?id=147040
+
+            Reviewed by Dean Jackson.
+
+            * UIProcess/Cocoa/UIDelegate.mm:
+            (WebKit::UIDelegate::UIClient::createNewPage): Disallow App Links if the new page is for the
+            same protocol, host and port as the main frame of this page.
+
+            * UIProcess/WebPageProxy.cpp:
+            (WebKit::WebPageProxy::decidePolicyForNavigationAction): Disallow App Links if
+            m_shouldSuppressAppLinksInNextNavigationPolicyDecision is set, and reset it. See below for
+            when we set it.
+            (WebKit::WebPageProxy::decidePolicyForNewWindowAction): Disallow App Links if the new window
+            is for the same protocol, host and port as the main frame of this page.
+            (WebKit::WebPageProxy::createNewPage): Make the new page disallow App Links in the first
+            policy decision if it is for the same protocol, host and port as the main frame of this
+            page.
+            * UIProcess/WebPageProxy.h: Added m_shouldSuppressAppLinksInNextNavigationPolicyDecision
+            member variable.
+
+            * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+            (WebKit::WebChromeClient::createWindow): Pass the shouldOpenExternalURLsPolicy.
+
+            * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+            (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Ditto.
+
+2015-07-20  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r186956. rdar://problem/21643094
</span><span class="cx"> 
</span><span class="cx">     2015-07-17  Tim Horton  &lt;timothy_horton@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebKit2UIProcessCocoaUIDelegatemm"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm (187064 => 187065)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm        2015-07-21 04:37:05 UTC (rev 187064)
+++ branches/safari-601.1-branch/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm        2015-07-21 04:37:11 UTC (rev 187065)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> #import &quot;WKWindowFeaturesInternal.h&quot;
</span><span class="cx"> #import &quot;WKUIDelegatePrivate.h&quot;
</span><span class="cx"> #import &quot;_WKFrameHandleInternal.h&quot;
</span><ins>+#import &lt;WebCore/URL.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="lines">@@ -108,8 +109,10 @@
</span><span class="cx">     [configuration _setRelatedWebView:m_uiDelegate.m_webView];
</span><span class="cx"> 
</span><span class="cx">     auto sourceFrameInfo = API::FrameInfo::create(*initiatingFrame, securityOriginData.securityOrigin());
</span><del>-    auto navigationAction = API::NavigationAction::create(navigationActionData, sourceFrameInfo.ptr(), nullptr, request, WebCore::URL(), true);
</del><span class="cx"> 
</span><ins>+    bool shouldOpenAppLinks = !protocolHostAndPortAreEqual(WebCore::URL(WebCore::ParsedURLString, initiatingFrame-&gt;url()), request.url());
+    auto navigationAction = API::NavigationAction::create(navigationActionData, sourceFrameInfo.ptr(), nullptr, request, WebCore::URL(), shouldOpenAppLinks);
+
</ins><span class="cx">     RetainPtr&lt;WKWebView&gt; webView = [delegate.get() webView:m_uiDelegate.m_webView createWebViewWithConfiguration:configuration.get() forNavigationAction:wrapper(navigationAction) windowFeatures:adoptNS([[WKWindowFeatures alloc] _initWithWindowFeatures:windowFeatures]).get()];
</span><span class="cx"> 
</span><span class="cx">     if (!webView)
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp (187064 => 187065)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-07-21 04:37:05 UTC (rev 187064)
+++ branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-07-21 04:37:11 UTC (rev 187065)
</span><span class="lines">@@ -3333,7 +3333,7 @@
</span><span class="cx">         else if (originatingFrame)
</span><span class="cx">             sourceFrameInfo = API::FrameInfo::create(*originatingFrame, originatingFrameSecurityOrigin.securityOrigin());
</span><span class="cx"> 
</span><del>-        bool shouldOpenAppLinks = (!destinationFrameInfo || destinationFrameInfo-&gt;isMainFrame()) &amp;&amp; !protocolHostAndPortAreEqual(URL(ParsedURLString, m_mainFrame-&gt;url()), request.url());
</del><ins>+        bool shouldOpenAppLinks = !m_shouldSuppressAppLinksInNextNavigationPolicyDecision &amp;&amp; (!destinationFrameInfo || destinationFrameInfo-&gt;isMainFrame()) &amp;&amp; !protocolHostAndPortAreEqual(URL(ParsedURLString, m_mainFrame-&gt;url()), request.url());
</ins><span class="cx"> 
</span><span class="cx">         auto navigationAction = API::NavigationAction::create(navigationActionData, sourceFrameInfo.get(), destinationFrameInfo.get(), request, originalRequest.url(), shouldOpenAppLinks);
</span><span class="cx"> 
</span><span class="lines">@@ -3341,6 +3341,7 @@
</span><span class="cx">     } else
</span><span class="cx">         m_policyClient-&gt;decidePolicyForNavigationAction(*this, frame, navigationActionData, originatingFrame, originalRequest, request, WTF::move(listener), m_process-&gt;transformHandlesToObjects(userData.object()).get());
</span><span class="cx"> 
</span><ins>+    m_shouldSuppressAppLinksInNextNavigationPolicyDecision = false;
</ins><span class="cx">     m_inDecidePolicyForNavigationAction = false;
</span><span class="cx"> 
</span><span class="cx">     // Check if we received a policy decision already. If we did, we can just pass it back.
</span><span class="lines">@@ -3366,7 +3367,8 @@
</span><span class="cx">         if (frame)
</span><span class="cx">             sourceFrameInfo = API::FrameInfo::create(*frame, frameSecurityOrigin.securityOrigin());
</span><span class="cx"> 
</span><del>-        auto navigationAction = API::NavigationAction::create(navigationActionData, sourceFrameInfo.get(), nullptr, request, request.url(), true);
</del><ins>+        bool shouldOpenAppLinks = !protocolHostAndPortAreEqual(URL(ParsedURLString, m_mainFrame-&gt;url()), request.url());
+        auto navigationAction = API::NavigationAction::create(navigationActionData, sourceFrameInfo.get(), nullptr, request, request.url(), shouldOpenAppLinks);
</ins><span class="cx"> 
</span><span class="cx">         m_navigationClient-&gt;decidePolicyForNavigationAction(*this, navigationAction.get(), WTF::move(listener), m_process-&gt;transformHandlesToObjects(userData.object()).get());
</span><span class="cx"> 
</span><span class="lines">@@ -3534,6 +3536,7 @@
</span><span class="cx">     newPageParameters = newPage-&gt;creationParameters();
</span><span class="cx"> 
</span><span class="cx">     WebsiteDataStore::cloneSessionData(*this, *newPage);
</span><ins>+    newPage-&gt;m_shouldSuppressAppLinksInNextNavigationPolicyDecision = protocolHostAndPortAreEqual(URL(ParsedURLString, m_mainFrame-&gt;url()), request.url());
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void WebPageProxy::showPage()
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.h (187064 => 187065)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.h        2015-07-21 04:37:05 UTC (rev 187064)
+++ branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.h        2015-07-21 04:37:11 UTC (rev 187065)
</span><span class="lines">@@ -1639,6 +1639,7 @@
</span><span class="cx">     bool m_syncNavigationActionPolicyActionIsValid;
</span><span class="cx">     WebCore::PolicyAction m_syncNavigationActionPolicyAction;
</span><span class="cx">     uint64_t m_syncNavigationActionPolicyDownloadID;
</span><ins>+    bool m_shouldSuppressAppLinksInNextNavigationPolicyDecision { false };
</ins><span class="cx"> 
</span><span class="cx">     Deque&lt;NativeWebKeyboardEvent&gt; m_keyEventQueue;
</span><span class="cx">     Deque&lt;NativeWebWheelEvent&gt; m_wheelEventQueue;
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (187064 => 187065)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2015-07-21 04:37:05 UTC (rev 187064)
+++ branches/safari-601.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2015-07-21 04:37:11 UTC (rev 187065)
</span><span class="lines">@@ -218,6 +218,7 @@
</span><span class="cx">     navigationActionData.mouseButton = InjectedBundleNavigationAction::mouseButtonForNavigationAction(navigationAction);
</span><span class="cx">     navigationActionData.isProcessingUserGesture = navigationAction.processingUserGesture();
</span><span class="cx">     navigationActionData.canHandleRequest = m_page-&gt;canHandleRequest(request.resourceRequest());
</span><ins>+    navigationActionData.shouldOpenExternalURLsPolicy = navigationAction.shouldOpenExternalURLsPolicy();
</ins><span class="cx"> 
</span><span class="cx">     uint64_t newPageID = 0;
</span><span class="cx">     WebPageCreationParameters parameters;
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (187064 => 187065)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2015-07-21 04:37:05 UTC (rev 187064)
+++ branches/safari-601.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2015-07-21 04:37:11 UTC (rev 187065)
</span><span class="lines">@@ -738,6 +738,7 @@
</span><span class="cx">     navigationActionData.mouseButton = action-&gt;mouseButton();
</span><span class="cx">     navigationActionData.isProcessingUserGesture = navigationAction.processingUserGesture();
</span><span class="cx">     navigationActionData.canHandleRequest = webPage-&gt;canHandleRequest(request);
</span><ins>+    navigationActionData.shouldOpenExternalURLsPolicy = navigationAction.shouldOpenExternalURLsPolicy();
</ins><span class="cx"> 
</span><span class="cx">     webPage-&gt;send(Messages::WebPageProxy::DecidePolicyForNewWindowAction(m_frame-&gt;frameID(), SecurityOriginData::fromFrame(m_frame), navigationActionData, request, frameName, listenerID, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari6011branchToolsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Tools/ChangeLog (187064 => 187065)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Tools/ChangeLog        2015-07-21 04:37:05 UTC (rev 187064)
+++ branches/safari-601.1-branch/Tools/ChangeLog        2015-07-21 04:37:11 UTC (rev 187065)
</span><span class="lines">@@ -1,5 +1,23 @@
</span><span class="cx"> 2015-07-20  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r186964. rdar://problem/21803781
+
+    2015-07-17  Dan Bernstein  &lt;mitz@apple.com&gt;
+
+            Tests for &lt;rdar://problem/21803781&gt; The external URL policy is not reported correctly in navigation actions that create new windows
+            https://bugs.webkit.org/show_bug.cgi?id=147040
+
+            Reviewed by Dean Jackson.
+
+            * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+            * TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm: Added.
+            (-[ShouldOpenExternalURLsInNewWindowActionsController webView:decidePolicyForNavigationAction:decisionHandler:]):
+            (-[ShouldOpenExternalURLsInNewWindowActionsController webView:didFinishNavigation:]):
+            (-[ShouldOpenExternalURLsInNewWindowActionsController webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:]):
+            (TEST):
+
+2015-07-20  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r186912. rdar://problem/21866271
</span><span class="cx"> 
</span><span class="cx">     2015-07-16  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span></span></pre></div>
<a id="branchessafari6011branchToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (187064 => 187065)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2015-07-21 04:37:05 UTC (rev 187064)
+++ branches/safari-601.1-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2015-07-21 04:37:11 UTC (rev 187065)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx">                 378E64771632655E00B6C676 /* InjectedBundleFrameHitTest_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 378E64751632655D00B6C676 /* InjectedBundleFrameHitTest_Bundle.cpp */; };
</span><span class="cx">                 378E64791632707400B6C676 /* link-with-title.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 378E647816326FDF00B6C676 /* link-with-title.html */; };
</span><span class="cx">                 379028B914FAC24C007E6B43 /* acceptsFirstMouse.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 379028B814FABE49007E6B43 /* acceptsFirstMouse.html */; };
</span><ins>+                37BCA61C1B596BA9002012CA /* ShouldOpenExternalURLsInNewWindowActions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37BCA61B1B596BA9002012CA /* ShouldOpenExternalURLsInNewWindowActions.mm */; };
</ins><span class="cx">                 37D36ED71AF42ECD00BAF5D9 /* LoadAlternateHTMLString.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37D36ED61AF42ECD00BAF5D9 /* LoadAlternateHTMLString.mm */; };
</span><span class="cx">                 37D36F321B004DD400BAF5D9 /* ProvisionalURLChange.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37D36F311B004DD400BAF5D9 /* ProvisionalURLChange.mm */; };
</span><span class="cx">                 37DC6791140D7D7600ABCCDB /* DOMRangeOfString.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 37DC678F140D7D3A00ABCCDB /* DOMRangeOfString.html */; };
</span><span class="lines">@@ -498,6 +499,7 @@
</span><span class="cx">                 379028B814FABE49007E6B43 /* acceptsFirstMouse.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = acceptsFirstMouse.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 3799AD3914120A43005EB0C6 /* StringByEvaluatingJavaScriptFromString.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringByEvaluatingJavaScriptFromString.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 37A6895D148A9B50005100FA /* SubresourceErrorCrash.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SubresourceErrorCrash.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                37BCA61B1B596BA9002012CA /* ShouldOpenExternalURLsInNewWindowActions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ShouldOpenExternalURLsInNewWindowActions.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 37C784DE197C8F2E0010A496 /* RenderedImageFromDOMNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RenderedImageFromDOMNode.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 37D36ED61AF42ECD00BAF5D9 /* LoadAlternateHTMLString.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LoadAlternateHTMLString.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 37D36F311B004DD400BAF5D9 /* ProvisionalURLChange.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ProvisionalURLChange.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -858,6 +860,7 @@
</span><span class="cx">                                 CEA6CF2219CCF5BD0064F5A7 /* OpenAndCloseWindow.mm */,
</span><span class="cx">                                 C95501BE19AD2FAF0049BE3E /* Preferences.mm */,
</span><span class="cx">                                 37D36F311B004DD400BAF5D9 /* ProvisionalURLChange.mm */,
</span><ins>+                                37BCA61B1B596BA9002012CA /* ShouldOpenExternalURLsInNewWindowActions.mm */,
</ins><span class="cx">                                 2D9A53AE1B31FA8D0074D5AA /* ShrinkToFit.mm */,
</span><span class="cx">                                 7CC3E1FA197E234100BE6252 /* UserContentController.mm */,
</span><span class="cx">                                 0F3B94A51A77266C00DE3272 /* WKWebViewEvaluateJavaScript.mm */,
</span><span class="lines">@@ -1472,6 +1475,7 @@
</span><span class="cx">                                 7CCE7F231A411AF600447C4C /* Download.mm in Sources */,
</span><span class="cx">                                 7CCE7EEE1A411AE600447C4C /* DownloadDecideDestinationCrash.cpp in Sources */,
</span><span class="cx">                                 7CCE7EBE1A411A7E00447C4C /* DynamicDeviceScaleFactor.mm in Sources */,
</span><ins>+                                37BCA61C1B596BA9002012CA /* ShouldOpenExternalURLsInNewWindowActions.mm in Sources */,
</ins><span class="cx">                                 7CEFA9661AC0B9E200B910FD /* _WKUserContentExtensionStore.mm in Sources */,
</span><span class="cx">                                 7CCE7EE01A411A9A00447C4C /* EditorCommands.mm in Sources */,
</span><span class="cx">                                 7CCE7EBF1A411A7E00447C4C /* ElementAtPointInWebFrame.mm in Sources */,
</span></span></pre></div>
<a id="branchessafari6011branchToolsTestWebKitAPITestsWebKit2CocoaShouldOpenExternalURLsInNewWindowActionsmm"></a>
<div class="addfile"><h4>Added: branches/safari-601.1-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm (0 => 187065)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm                                (rev 0)
+++ branches/safari-601.1-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm        2015-07-21 04:37:11 UTC (rev 187065)
</span><span class="lines">@@ -0,0 +1,211 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+
+#if PLATFORM(MAC)
+
+#import &quot;PlatformUtilities.h&quot;
+#import &lt;WebKit/WKNavigationActionPrivate.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+#if WK_API_ENABLED
+
+static bool createdWebView;
+static bool decidedPolicy;
+static bool finishedNavigation;
+static RetainPtr&lt;WKNavigationAction&gt; action;
+static RetainPtr&lt;WKWebView&gt; newWebView;
+
+@interface ShouldOpenExternalURLsInNewWindowActionsController : NSObject &lt;WKNavigationDelegate, WKUIDelegate&gt;
+@end
+
+@implementation ShouldOpenExternalURLsInNewWindowActionsController
+
+- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
+{
+    decisionHandler(webView == newWebView.get() ? WKNavigationActionPolicyCancel : WKNavigationActionPolicyAllow);
+
+    action = navigationAction;
+    decidedPolicy = true;
+}
+
+- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
+{
+    finishedNavigation = true;
+}
+
+- (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures
+{
+    action = navigationAction;
+    newWebView = adoptNS([[WKWebView alloc] initWithFrame:CGRectMake(0, 0, 800, 600) configuration:configuration]);
+
+    createdWebView = true;
+    return newWebView.get();
+}
+
+@end
+
+TEST(WebKit2, ShouldOpenExternalURLsInWindowOpen)
+{
+    auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
+
+    auto window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
+    [[window contentView] addSubview:webView.get()];
+
+    auto controller = adoptNS([[ShouldOpenExternalURLsInNewWindowActionsController alloc] init]);
+    [webView setNavigationDelegate:controller.get()];
+    [webView setUIDelegate:controller.get()];
+
+    [webView loadHTMLString:@&quot;&lt;body onclick=\&quot;window.open('http://webkit.org/destination')\&quot;&gt;&quot; baseURL:[NSURL URLWithString:@&quot;http://webkit.org&quot;]];
+    TestWebKitAPI::Util::run(&amp;finishedNavigation);
+    finishedNavigation = false;
+
+    NSPoint clickPoint = NSMakePoint(100, 100);
+
+    [[webView hitTest:clickPoint] mouseDown:[NSEvent mouseEventWithType:NSLeftMouseDown location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
+    [[webView hitTest:clickPoint] mouseUp:[NSEvent mouseEventWithType:NSLeftMouseUp location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
+    TestWebKitAPI::Util::run(&amp;createdWebView);
+    createdWebView = false;
+
+    // User-initiated window.open to the same scheme, host and port should allow external schemes but not App Links.
+    ASSERT_TRUE([action _shouldOpenExternalSchemes]);
+    ASSERT_FALSE([action _shouldOpenAppLinks]);
+
+    decidedPolicy = false;
+    [newWebView setNavigationDelegate:controller.get()];
+    TestWebKitAPI::Util::run(&amp;decidedPolicy);
+    decidedPolicy = false;
+
+    // User-initiated window.open to the same scheme, host and port should allow external schemes but not App Links.
+    ASSERT_TRUE([action _shouldOpenExternalSchemes]);
+    ASSERT_FALSE([action _shouldOpenAppLinks]);
+
+    [webView loadHTMLString:@&quot;&lt;body onclick=\&quot;window.open('https://webkit.org/destination')\&quot;&gt;&quot; baseURL:[NSURL URLWithString:@&quot;http://webkit.org&quot;]];
+    TestWebKitAPI::Util::run(&amp;finishedNavigation);
+    finishedNavigation = false;
+
+    [[webView hitTest:clickPoint] mouseDown:[NSEvent mouseEventWithType:NSLeftMouseDown location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
+    [[webView hitTest:clickPoint] mouseUp:[NSEvent mouseEventWithType:NSLeftMouseUp location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
+    TestWebKitAPI::Util::run(&amp;createdWebView);
+    createdWebView = false;
+
+    // User-initiated window.open to different scheme, host or port should allow external schemes and App Links.
+    ASSERT_TRUE([action _shouldOpenExternalSchemes]);
+    ASSERT_TRUE([action _shouldOpenAppLinks]);
+
+    decidedPolicy = false;
+    [newWebView setNavigationDelegate:controller.get()];
+    TestWebKitAPI::Util::run(&amp;decidedPolicy);
+    decidedPolicy = false;
+
+    // User-initiated window.open to different scheme, host or port should allow external schemes and App Links.
+    ASSERT_TRUE([action _shouldOpenExternalSchemes]);
+    ASSERT_TRUE([action _shouldOpenAppLinks]);
+
+    newWebView = nullptr;
+    action = nullptr;
+}
+
+TEST(WebKit2, ShouldOpenExternalURLsInTargetedLink)
+{
+    auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
+
+    auto window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
+    [[window contentView] addSubview:webView.get()];
+
+    auto controller = adoptNS([[ShouldOpenExternalURLsInNewWindowActionsController alloc] init]);
+    [webView setNavigationDelegate:controller.get()];
+    [webView setUIDelegate:controller.get()];
+
+    [webView loadHTMLString:@&quot;&lt;a style=\&quot;display: block; height: 100%\&quot; href=\&quot;destination.html\&quot; target=\&quot;_blank\&quot;&gt;&quot; baseURL:[NSURL URLWithString:@&quot;http://webkit.org&quot;]];
+    TestWebKitAPI::Util::run(&amp;finishedNavigation);
+    finishedNavigation = false;
+
+    NSPoint clickPoint = NSMakePoint(100, 100);
+
+    decidedPolicy = false;
+    [[webView hitTest:clickPoint] mouseDown:[NSEvent mouseEventWithType:NSLeftMouseDown location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
+    [[webView hitTest:clickPoint] mouseUp:[NSEvent mouseEventWithType:NSLeftMouseUp location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
+    TestWebKitAPI::Util::run(&amp;decidedPolicy);
+    decidedPolicy = false;
+
+    // User-initiated targeted navigation to the same scheme, host and port should allow external schemes but not App Links.
+    ASSERT_TRUE([action _shouldOpenExternalSchemes]);
+    ASSERT_FALSE([action _shouldOpenAppLinks]);
+
+    TestWebKitAPI::Util::run(&amp;createdWebView);
+    createdWebView = false;
+
+    // User-initiated targeted navigation to the same scheme, host and port should allow external schemes but not App Links.
+    ASSERT_TRUE([action _shouldOpenExternalSchemes]);
+    ASSERT_FALSE([action _shouldOpenAppLinks]);
+
+    decidedPolicy = false;
+    [newWebView setNavigationDelegate:controller.get()];
+    TestWebKitAPI::Util::run(&amp;decidedPolicy);
+    decidedPolicy = false;
+
+    // User-initiated targeted navigation to the same scheme, host and port should allow external schemes but not App Links.
+    ASSERT_TRUE([action _shouldOpenExternalSchemes]);
+    ASSERT_FALSE([action _shouldOpenAppLinks]);
+
+    [webView loadHTMLString:@&quot;&lt;a style=\&quot;display: block; height: 100%\&quot; href=\&quot;https://webkit.org/destination.html\&quot; target=\&quot;_blank\&quot;&gt;&quot; baseURL:[NSURL URLWithString:@&quot;http://webkit.org&quot;]];
+    TestWebKitAPI::Util::run(&amp;finishedNavigation);
+    finishedNavigation = false;
+
+    decidedPolicy = false;
+    [[webView hitTest:clickPoint] mouseDown:[NSEvent mouseEventWithType:NSLeftMouseDown location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
+    [[webView hitTest:clickPoint] mouseUp:[NSEvent mouseEventWithType:NSLeftMouseUp location:clickPoint modifierFlags:0 timestamp:0 windowNumber:[window windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1]];
+    TestWebKitAPI::Util::run(&amp;decidedPolicy);
+    decidedPolicy = false;
+
+    // User-initiated targeted navigation to different scheme, host or port should allow external schemes and App Links.
+    ASSERT_TRUE([action _shouldOpenExternalSchemes]);
+    ASSERT_TRUE([action _shouldOpenAppLinks]);
+
+    TestWebKitAPI::Util::run(&amp;createdWebView);
+    createdWebView = false;
+
+    // User-initiated targeted navigation to different scheme, host or port should allow external schemes and App Links.
+    ASSERT_TRUE([action _shouldOpenExternalSchemes]);
+    ASSERT_TRUE([action _shouldOpenAppLinks]);
+
+    decidedPolicy = false;
+    [newWebView setNavigationDelegate:controller.get()];
+    TestWebKitAPI::Util::run(&amp;decidedPolicy);
+    decidedPolicy = false;
+
+    // User-initiated targeted navigation to different scheme, host or port should allow external schemes and App Links.
+    ASSERT_TRUE([action _shouldOpenExternalSchemes]);
+    ASSERT_TRUE([action _shouldOpenAppLinks]);
+
+    newWebView = nullptr;
+    action = nullptr;
+}
+
+#endif
+
+#endif
</ins></span></pre>
</div>
</div>

</body>
</html>