<!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>[170120] trunk</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/170120">170120</a></dd>
<dt>Author</dt> <dd>dbates@webkit.org</dd>
<dt>Date</dt> <dd>2014-06-18 14:52:45 -0700 (Wed, 18 Jun 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION (<a href="http://trac.webkit.org/projects/webkit/changeset/167856">r167856</a>): Unable to log into HSBC app
https://bugs.webkit.org/show_bug.cgi?id=133991
&lt;rdar://problem/17044839&gt;

Reviewed by David Kilzer.

Source/WebCore:
Following &lt;http://trac.webkit.org/changeset/167856&gt; we disallow &quot;navigation to any URL that is
invalid, except for JavaScript URLs, which need not be valid.&quot; A byproduct of this policy
decision is that we no longer notify the WebKit client to about a navigation if the destination
URL is invalid. And some apps, including the HSBC app for iOS, have logic to intercept URLs
as a means to pass data from their WebView-embedded web app to the WebView. We should expose a
setting called allowNavigationToInvalidURL (disabled by default on all ports and conditionally
enabled on iOS) to toggle whether WebCore allows navigation to any URL, even if its invalid,
so as to not break clients that intercept URLs and have custom logic to handle them.

Tests: fast/loader/allow-redirect-to-invalid-url-using-javascript.html
       fast/loader/allow-redirect-to-invalid-url-using-meta-refresh.html
       fast/loader/disallow-redirect-to-invalid-url-using-javascript.html
       fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh.html

* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::shouldScheduleNavigation): Modified to only validate
the URL when the setting allowNavigationToInvalidURL is disabled.
* page/Settings.in: Added setting allowNavigationToInvalidURL (disabled by default).

Source/WebKit/mac:
Only enable the setting allowNavigationToInvalidURL for iOS app linked against WebKit/UIKit before iOS 8.

* Misc/WebKitVersionChecks.h: Added macro constant WEBKIT_FIRST_VERSION_WITH_NAVIGATION_URL_VALIDATION.
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]): Enable or disable the setting allowNavigationToInvalidURL as appropriate.

LayoutTests:
Add tests to ensure that the WebKit client will be notified to service a redirect to an invalid
URL when the setting allowNavigationToInvalidURL is enabled and will not be notified when
the setting is disabled.

* fast/loader/allow-redirect-to-invalid-url-using-javascript-expected.txt: Added.
* fast/loader/allow-redirect-to-invalid-url-using-javascript.html: Added.
* fast/loader/allow-redirect-to-invalid-url-using-meta-refresh-expected.txt: Added.
* fast/loader/allow-redirect-to-invalid-url-using-meta-refresh.html: Added.
* fast/loader/disallow-redirect-to-invalid-url-using-javascript-expected.txt: Added.
* fast/loader/disallow-redirect-to-invalid-url-using-javascript.html: Added.
* fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh-expected.txt: Added.
* fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh.html: Added.
* fast/loader/resources/redirect-to-invalid-url-using-javascript.html: Added.
* fast/loader/resources/redirect-to-invalid-url-using-meta-refresh.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreloaderNavigationSchedulercpp">trunk/Source/WebCore/loader/NavigationScheduler.cpp</a></li>
<li><a href="#trunkSourceWebCorepageSettingsin">trunk/Source/WebCore/page/Settings.in</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacMiscWebKitVersionChecksh">trunk/Source/WebKit/mac/Misc/WebKitVersionChecks.h</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastloaderallowredirecttoinvalidurlusingjavascriptexpectedtxt">trunk/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-javascript-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastloaderallowredirecttoinvalidurlusingjavascripthtml">trunk/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-javascript.html</a></li>
<li><a href="#trunkLayoutTestsfastloaderallowredirecttoinvalidurlusingmetarefreshexpectedtxt">trunk/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-meta-refresh-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastloaderallowredirecttoinvalidurlusingmetarefreshhtml">trunk/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-meta-refresh.html</a></li>
<li><a href="#trunkLayoutTestsfastloaderdisallowredirecttoinvalidurlusingjavascriptexpectedtxt">trunk/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-javascript-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastloaderdisallowredirecttoinvalidurlusingjavascripthtml">trunk/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-javascript.html</a></li>
<li><a href="#trunkLayoutTestsfastloaderdisallowredirecttoinvalidurlusingmetarefreshexpectedtxt">trunk/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastloaderdisallowredirecttoinvalidurlusingmetarefreshhtml">trunk/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh.html</a></li>
<li><a href="#trunkLayoutTestsfastloaderresourcesredirecttoinvalidurlusingjavascripthtml">trunk/LayoutTests/fast/loader/resources/redirect-to-invalid-url-using-javascript.html</a></li>
<li><a href="#trunkLayoutTestsfastloaderresourcesredirecttoinvalidurlusingmetarefreshhtml">trunk/LayoutTests/fast/loader/resources/redirect-to-invalid-url-using-meta-refresh.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (170119 => 170120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-06-18 21:50:31 UTC (rev 170119)
+++ trunk/LayoutTests/ChangeLog        2014-06-18 21:52:45 UTC (rev 170120)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2014-06-18  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        REGRESSION (r167856): Unable to log into HSBC app
+        https://bugs.webkit.org/show_bug.cgi?id=133991
+        &lt;rdar://problem/17044839&gt;
+
+        Reviewed by David Kilzer.
+
+        Add tests to ensure that the WebKit client will be notified to service a redirect to an invalid
+        URL when the setting allowNavigationToInvalidURL is enabled and will not be notified when
+        the setting is disabled.
+
+        * fast/loader/allow-redirect-to-invalid-url-using-javascript-expected.txt: Added.
+        * fast/loader/allow-redirect-to-invalid-url-using-javascript.html: Added.
+        * fast/loader/allow-redirect-to-invalid-url-using-meta-refresh-expected.txt: Added.
+        * fast/loader/allow-redirect-to-invalid-url-using-meta-refresh.html: Added.
+        * fast/loader/disallow-redirect-to-invalid-url-using-javascript-expected.txt: Added.
+        * fast/loader/disallow-redirect-to-invalid-url-using-javascript.html: Added.
+        * fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh-expected.txt: Added.
+        * fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh.html: Added.
+        * fast/loader/resources/redirect-to-invalid-url-using-javascript.html: Added.
+        * fast/loader/resources/redirect-to-invalid-url-using-meta-refresh.html: Added.
+
</ins><span class="cx"> 2014-06-18  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r170099.
</span></span></pre></div>
<a id="trunkLayoutTestsfastloaderallowredirecttoinvalidurlusingjavascriptexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-javascript-expected.txt (0 => 170120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-javascript-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-javascript-expected.txt        2014-06-18 21:52:45 UTC (rev 170120)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+frame &quot;frame&quot; - didStartProvisionalLoadForFrame
+main frame - didFinishDocumentLoadForFrame
+frame &quot;frame&quot; - didCommitLoadForFrame
+frame &quot;frame&quot; - willPerformClientRedirectToURL: x-dummy://A=a&amp;B=b 
+frame &quot;frame&quot; - didFinishDocumentLoadForFrame
+main frame - didHandleOnloadEventsForFrame
+frame &quot;frame&quot; - didFinishLoadForFrame
+main frame - didFinishLoadForFrame
+Tests that we allow redirection to an invalid URL initiated by JavaScript when setting allowNavigationToInvalidURL is true. This test PASSED if you see an entry in the dumped frame load callbacks of the form: &quot;willPerformClientRedirectToURL: x-dummy://A=a&amp;B=b&quot;.
+
+Note, this test must be run in DumpRenderTree.
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastloaderallowredirecttoinvalidurlusingjavascripthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-javascript.html (0 => 170120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-javascript.html                                (rev 0)
+++ trunk/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-javascript.html        2014-06-18 21:52:45 UTC (rev 170120)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.dumpFrameLoadCallbacks();
+    testRunner.waitUntilDone();
+}
+
+if (window.internals)
+    window.internals.settings.setAllowNavigationToInvalidURL(true);
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;Tests that we allow redirection to an invalid URL initiated by JavaScript when setting allowNavigationToInvalidURL is true. This test PASSED if you see an entry in the dumped frame load callbacks of the form: &amp;quot;willPerformClientRedirectToURL: x-dummy://A=a&amp;amp;B=b&amp;quot;.&lt;/p&gt;
+&lt;p&gt;Note, this test must be run in DumpRenderTree.&lt;/p&gt;
+&lt;iframe id=&quot;frame&quot; src=&quot;resources/redirect-to-invalid-url-using-javascript.html&quot;&gt;&lt;/iframe&gt;
+&lt;script&gt;
+function done()
+{
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+window.setTimeout(done, 0);
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastloaderallowredirecttoinvalidurlusingmetarefreshexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-meta-refresh-expected.txt (0 => 170120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-meta-refresh-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-meta-refresh-expected.txt        2014-06-18 21:52:45 UTC (rev 170120)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+frame &quot;frame&quot; - didStartProvisionalLoadForFrame
+main frame - didFinishDocumentLoadForFrame
+frame &quot;frame&quot; - didCommitLoadForFrame
+frame &quot;frame&quot; - didFinishDocumentLoadForFrame
+frame &quot;frame&quot; - didHandleOnloadEventsForFrame
+main frame - didHandleOnloadEventsForFrame
+frame &quot;frame&quot; - willPerformClientRedirectToURL: x-dummy://A=a&amp;B=b 
+frame &quot;frame&quot; - didFinishLoadForFrame
+main frame - didFinishLoadForFrame
+Tests that we allow redirection to an invalid URL initiated by &lt;meta http-equiv=&quot;refresh&quot;&gt; when setting allowNavigationToInvalidURL is true. This test PASSED if you see an entry in the dumped frame load callbacks of the form: &quot;willPerformClientRedirectToURL: x-dummy://A=a&amp;B=b&quot;.
+
+Note, this test must be run in DumpRenderTree.
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastloaderallowredirecttoinvalidurlusingmetarefreshhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-meta-refresh.html (0 => 170120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-meta-refresh.html                                (rev 0)
+++ trunk/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-meta-refresh.html        2014-06-18 21:52:45 UTC (rev 170120)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.dumpFrameLoadCallbacks();
+    testRunner.waitUntilDone();
+}
+
+if (window.internals)
+    window.internals.settings.setAllowNavigationToInvalidURL(true);
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;Tests that we allow redirection to an invalid URL initiated by &amp;lt;meta http-equiv=&amp;quot;refresh&amp;quot;&amp;gt; when setting allowNavigationToInvalidURL is true. This test PASSED if you see an entry in the dumped frame load callbacks of the form: &amp;quot;willPerformClientRedirectToURL: x-dummy://A=a&amp;amp;B=b&amp;quot;.&lt;/p&gt;
+&lt;p&gt;Note, this test must be run in DumpRenderTree.&lt;/p&gt;
+&lt;iframe id=&quot;frame&quot; src=&quot;resources/redirect-to-invalid-url-using-meta-refresh.html&quot;&gt;&lt;/iframe&gt;
+&lt;script&gt;
+function done()
+{
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+window.setTimeout(done, 0);
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastloaderdisallowredirecttoinvalidurlusingjavascriptexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-javascript-expected.txt (0 => 170120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-javascript-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-javascript-expected.txt        2014-06-18 21:52:45 UTC (rev 170120)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+frame &quot;frame&quot; - didStartProvisionalLoadForFrame
+main frame - didFinishDocumentLoadForFrame
+frame &quot;frame&quot; - didCommitLoadForFrame
+frame &quot;frame&quot; - didFinishDocumentLoadForFrame
+frame &quot;frame&quot; - didHandleOnloadEventsForFrame
+main frame - didHandleOnloadEventsForFrame
+frame &quot;frame&quot; - didFinishLoadForFrame
+main frame - didFinishLoadForFrame
+Tests that we do not redirect to an invalid URL initiated by JavaScript when setting allowNavigationToInvalidURL is false. This test PASSED if you do not see an entry in the dumped frame load callbacks of the form: &quot;willPerformClientRedirectToURL: x-dummy://A=a&amp;B=b&quot;.
+
+Note, this test must be run in DumpRenderTree.
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastloaderdisallowredirecttoinvalidurlusingjavascripthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-javascript.html (0 => 170120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-javascript.html                                (rev 0)
+++ trunk/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-javascript.html        2014-06-18 21:52:45 UTC (rev 170120)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.dumpFrameLoadCallbacks();
+    testRunner.waitUntilDone();
+}
+
+if (window.internals)
+    window.internals.settings.setAllowNavigationToInvalidURL(false);
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;Tests that we do not redirect to an invalid URL initiated by JavaScript when setting allowNavigationToInvalidURL is false. This test PASSED if you do not see an entry in the dumped frame load callbacks of the form: &amp;quot;willPerformClientRedirectToURL: x-dummy://A=a&amp;amp;B=b&amp;quot;.&lt;/p&gt;
+&lt;p&gt;Note, this test must be run in DumpRenderTree.&lt;/p&gt;
+&lt;iframe id=&quot;frame&quot; src=&quot;resources/redirect-to-invalid-url-using-javascript.html&quot;&gt;&lt;/iframe&gt;
+&lt;script&gt;
+function done()
+{
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+window.setTimeout(done, 0);
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastloaderdisallowredirecttoinvalidurlusingmetarefreshexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh-expected.txt (0 => 170120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh-expected.txt        2014-06-18 21:52:45 UTC (rev 170120)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+frame &quot;frame&quot; - didStartProvisionalLoadForFrame
+main frame - didFinishDocumentLoadForFrame
+frame &quot;frame&quot; - didCommitLoadForFrame
+frame &quot;frame&quot; - didFinishDocumentLoadForFrame
+frame &quot;frame&quot; - didHandleOnloadEventsForFrame
+main frame - didHandleOnloadEventsForFrame
+frame &quot;frame&quot; - didFinishLoadForFrame
+main frame - didFinishLoadForFrame
+Tests that we do not redirect to an invalid URL initiated by &lt;meta http-equiv=&quot;refresh&quot;&gt; when setting allowNavigationToInvalidURL is false. This test PASSED if you do not see an entry in the dumped frame load callbacks of the form: &quot;willPerformClientRedirectToURL: x-dummy://A=a&amp;B=b&quot;.
+
+Note, this test must be run in DumpRenderTree.
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastloaderdisallowredirecttoinvalidurlusingmetarefreshhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh.html (0 => 170120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh.html                                (rev 0)
+++ trunk/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh.html        2014-06-18 21:52:45 UTC (rev 170120)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.dumpFrameLoadCallbacks();
+    testRunner.waitUntilDone();
+}
+
+if (window.internals)
+    window.internals.settings.setAllowNavigationToInvalidURL(false);
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;Tests that we do not redirect to an invalid URL initiated by &amp;lt;meta http-equiv=&amp;quot;refresh&amp;quot;&amp;gt; when setting allowNavigationToInvalidURL is false. This test PASSED if you do not see an entry in the dumped frame load callbacks of the form: &amp;quot;willPerformClientRedirectToURL: x-dummy://A=a&amp;amp;B=b&amp;quot;.&lt;/p&gt;
+&lt;p&gt;Note, this test must be run in DumpRenderTree.&lt;/p&gt;
+&lt;iframe id=&quot;frame&quot; src=&quot;resources/redirect-to-invalid-url-using-meta-refresh.html&quot;&gt;&lt;/iframe&gt;
+&lt;script&gt;
+function done()
+{
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+window.setTimeout(done, 0);
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastloaderresourcesredirecttoinvalidurlusingjavascripthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/loader/resources/redirect-to-invalid-url-using-javascript.html (0 => 170120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/loader/resources/redirect-to-invalid-url-using-javascript.html                                (rev 0)
+++ trunk/LayoutTests/fast/loader/resources/redirect-to-invalid-url-using-javascript.html        2014-06-18 21:52:45 UTC (rev 170120)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;script&gt;
+window.location.href = &quot;x-dummy://A=a&amp;B=b&quot;;
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastloaderresourcesredirecttoinvalidurlusingmetarefreshhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/loader/resources/redirect-to-invalid-url-using-meta-refresh.html (0 => 170120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/loader/resources/redirect-to-invalid-url-using-meta-refresh.html                                (rev 0)
+++ trunk/LayoutTests/fast/loader/resources/redirect-to-invalid-url-using-meta-refresh.html        2014-06-18 21:52:45 UTC (rev 170120)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;meta http-equiv=&quot;refresh&quot; content=&quot;0; url=x-dummy://A=a&amp;B=b&quot;&gt;
+&lt;/head&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (170119 => 170120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-06-18 21:50:31 UTC (rev 170119)
+++ trunk/Source/WebCore/ChangeLog        2014-06-18 21:52:45 UTC (rev 170120)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2014-06-18  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        REGRESSION (r167856): Unable to log into HSBC app
+        https://bugs.webkit.org/show_bug.cgi?id=133991
+        &lt;rdar://problem/17044839&gt;
+
+        Reviewed by David Kilzer.
+
+        Following &lt;http://trac.webkit.org/changeset/167856&gt; we disallow &quot;navigation to any URL that is
+        invalid, except for JavaScript URLs, which need not be valid.&quot; A byproduct of this policy
+        decision is that we no longer notify the WebKit client to about a navigation if the destination
+        URL is invalid. And some apps, including the HSBC app for iOS, have logic to intercept URLs
+        as a means to pass data from their WebView-embedded web app to the WebView. We should expose a
+        setting called allowNavigationToInvalidURL (disabled by default on all ports and conditionally
+        enabled on iOS) to toggle whether WebCore allows navigation to any URL, even if its invalid,
+        so as to not break clients that intercept URLs and have custom logic to handle them.
+
+        Tests: fast/loader/allow-redirect-to-invalid-url-using-javascript.html
+               fast/loader/allow-redirect-to-invalid-url-using-meta-refresh.html
+               fast/loader/disallow-redirect-to-invalid-url-using-javascript.html
+               fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh.html
+
+        * loader/NavigationScheduler.cpp:
+        (WebCore::NavigationScheduler::shouldScheduleNavigation): Modified to only validate
+        the URL when the setting allowNavigationToInvalidURL is disabled.
+        * page/Settings.in: Added setting allowNavigationToInvalidURL (disabled by default).
+
</ins><span class="cx"> 2014-06-18  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Make ScrollingStateNodes refcounted, and other minor cleanup
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderNavigationSchedulercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/NavigationScheduler.cpp (170119 => 170120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/NavigationScheduler.cpp        2014-06-18 21:50:31 UTC (rev 170119)
+++ trunk/Source/WebCore/loader/NavigationScheduler.cpp        2014-06-18 21:52:45 UTC (rev 170120)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> #include &quot;InspectorInstrumentation.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;ScriptController.h&quot;
</span><ins>+#include &quot;Settings.h&quot;
</ins><span class="cx"> #include &quot;UserGestureIndicator.h&quot;
</span><span class="cx"> #include &lt;wtf/CurrentTime.h&gt;
</span><span class="cx"> #include &lt;wtf/Ref.h&gt;
</span><span class="lines">@@ -310,7 +311,7 @@
</span><span class="cx">         return false;
</span><span class="cx">     if (protocolIsJavaScript(url))
</span><span class="cx">         return true;
</span><del>-    if (!url.isValid())
</del><ins>+    if (!url.isValid() &amp;&amp; !m_frame.settings().allowNavigationToInvalidURL())
</ins><span class="cx">         return false;
</span><span class="cx">     return NavigationDisablerForBeforeUnload::isNavigationAllowed();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.in (170119 => 170120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.in        2014-06-18 21:50:31 UTC (rev 170119)
+++ trunk/Source/WebCore/page/Settings.in        2014-06-18 21:52:45 UTC (rev 170120)
</span><span class="lines">@@ -223,3 +223,7 @@
</span><span class="cx"> temporaryTileCohortRetentionEnabled initial=true
</span><span class="cx"> 
</span><span class="cx"> useImageDocumentForSubframePDF initial=false
</span><ins>+
+# Allow clients to permit navigation to an invalid URL. Some apps may use invalid URLs
+# as a means to pass data from the web-portion of their app to the native portion.
+allowNavigationToInvalidURL initial=false
</ins></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (170119 => 170120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-06-18 21:50:31 UTC (rev 170119)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-06-18 21:52:45 UTC (rev 170120)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-06-18  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        REGRESSION (r167856): Unable to log into HSBC app
+        https://bugs.webkit.org/show_bug.cgi?id=133991
+        &lt;rdar://problem/17044839&gt;
+
+        Reviewed by David Kilzer.
+
+        Only enable the setting allowNavigationToInvalidURL for iOS app linked against WebKit/UIKit before iOS 8.
+
+        * Misc/WebKitVersionChecks.h: Added macro constant WEBKIT_FIRST_VERSION_WITH_NAVIGATION_URL_VALIDATION.
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]): Enable or disable the setting allowNavigationToInvalidURL as appropriate.
+
</ins><span class="cx"> 2014-06-18  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Adopt modern C++11 loops and fix WebArchive creation functions
</span></span></pre></div>
<a id="trunkSourceWebKitmacMiscWebKitVersionChecksh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Misc/WebKitVersionChecks.h (170119 => 170120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Misc/WebKitVersionChecks.h        2014-06-18 21:50:31 UTC (rev 170119)
+++ trunk/Source/WebKit/mac/Misc/WebKitVersionChecks.h        2014-06-18 21:52:45 UTC (rev 170120)
</span><span class="lines">@@ -73,6 +73,7 @@
</span><span class="cx"> #define WEBKIT_FIRST_VERSION_WITH_CSS_ATTRIBUTE_SETTERS_IGNORING_PRIORITY 2239 // iOS 6.0
</span><span class="cx"> #define WEBKIT_FIRST_VERSION_WITH_YOUTUBE_EMBED_IFRAME_TRANSFORM 2239 // iOS 6.0
</span><span class="cx"> #define WEBKIT_FIRST_VERSION_WITHOUT_LEGACY_BACKGROUNDSIZE_SHORTHAND_BEHAVIOR 2665 // iOS 7.0
</span><ins>+#define WEBKIT_FIRST_VERSION_WITH_NAVIGATION_URL_VALIDATION 3185 // iOS 8.0
</ins><span class="cx"> #endif // PLATFORM(IOS)
</span><span class="cx"> 
</span><span class="cx"> #ifdef __cplusplus
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (170119 => 170120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2014-06-18 21:50:31 UTC (rev 170119)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2014-06-18 21:52:45 UTC (rev 170120)
</span><span class="lines">@@ -2342,6 +2342,8 @@
</span><span class="cx"> #if ENABLE(IOS_TEXT_AUTOSIZING)
</span><span class="cx">     settings.setMinimumZoomFontSize([preferences _minimumZoomFontSize]);
</span><span class="cx"> #endif
</span><ins>+
+    settings.setAllowNavigationToInvalidURL(!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_NAVIGATION_URL_VALIDATION));
</ins><span class="cx"> #endif // PLATFORM(IOS)
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span></span></pre>
</div>
</div>

</body>
</html>