Revert r172697.
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Aug 2014 07:35:18 +0000 (07:35 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Aug 2014 07:35:18 +0000 (07:35 +0000)
It made several webarchive layout tests flaky and didn't have the correct behavior for non-quick redirects.

Source/WebCore:

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::shouldScheduleNavigation):
* page/Settings.in:

Source/WebKit/mac:

* Misc/WebKitVersionChecks.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

LayoutTests:

* 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/redirect-to-invalid-url-using-javascript-calls-policy-delegate-expected.txt: Removed.
* fast/loader/redirect-to-invalid-url-using-javascript-calls-policy-delegate.html: Removed.
* fast/loader/redirect-to-invalid-url-using-javascript-disallowed-expected.txt: Removed.
* fast/loader/redirect-to-invalid-url-using-javascript-disallowed.html: Removed.
* fast/loader/redirect-to-invalid-url-using-meta-refresh-calls-policy-delegate-expected.txt: Removed.
* fast/loader/redirect-to-invalid-url-using-meta-refresh-calls-policy-delegate.html: Removed.
* fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed-expected.txt: Removed.
* fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed.html: Removed.
* fast/loader/resources/redirect-to-invalid-url-using-javascript.html: Added.
* fast/loader/resources/redirect-to-invalid-url-using-meta-refresh.html: Added.
* fast/loader/window-open-to-invalid-url-calls-policy-delegate-expected.txt: Removed.
* fast/loader/window-open-to-invalid-url-calls-policy-delegate.html: Removed.
* fast/loader/window-open-to-invalid-url-disallowed-expected.txt: Removed.
* fast/loader/window-open-to-invalid-url-disallowed.html: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172699 268f45cc-cd09-0410-ab3c-d52691b4dbfc

30 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-javascript-expected.txt [new file with mode: 0644]
LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-javascript.html [new file with mode: 0644]
LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-meta-refresh-expected.txt [new file with mode: 0644]
LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-meta-refresh.html [new file with mode: 0644]
LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-javascript-expected.txt [new file with mode: 0644]
LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-javascript.html [new file with mode: 0644]
LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh-expected.txt [new file with mode: 0644]
LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh.html [new file with mode: 0644]
LayoutTests/fast/loader/redirect-to-invalid-url-using-javascript-calls-policy-delegate-expected.txt [deleted file]
LayoutTests/fast/loader/redirect-to-invalid-url-using-javascript-calls-policy-delegate.html [deleted file]
LayoutTests/fast/loader/redirect-to-invalid-url-using-javascript-disallowed-after-load.html [moved from LayoutTests/fast/loader/redirect-to-invalid-url-using-javascript-disallowed.html with 74% similarity]
LayoutTests/fast/loader/redirect-to-invalid-url-using-javascript-disallowed-expected.txt [deleted file]
LayoutTests/fast/loader/redirect-to-invalid-url-using-meta-refresh-calls-policy-delegate-expected.txt [deleted file]
LayoutTests/fast/loader/redirect-to-invalid-url-using-meta-refresh-calls-policy-delegate.html [deleted file]
LayoutTests/fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed-expected.txt [deleted file]
LayoutTests/fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed.html [deleted file]
LayoutTests/fast/loader/resources/redirect-to-invalid-url-using-javascript.html [new file with mode: 0644]
LayoutTests/fast/loader/resources/redirect-to-invalid-url-using-meta-refresh.html [new file with mode: 0644]
LayoutTests/fast/loader/window-open-to-invalid-url-calls-policy-delegate-expected.txt [deleted file]
LayoutTests/fast/loader/window-open-to-invalid-url-calls-policy-delegate.html [deleted file]
LayoutTests/fast/loader/window-open-to-invalid-url-disallowed-expected.txt [deleted file]
LayoutTests/fast/loader/window-open-to-invalid-url-disallowed.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/NavigationScheduler.cpp
Source/WebCore/page/Settings.in
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Misc/WebKitVersionChecks.h
Source/WebKit/mac/WebView/WebView.mm

index 38cf61a..57d6feb 100644 (file)
@@ -1,3 +1,32 @@
+2014-08-18  Andy Estes  <aestes@apple.com>
+
+        Revert r172697.
+
+        It made several webarchive layout tests flaky and didn't have the correct behavior for non-quick redirects.
+
+        * 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/redirect-to-invalid-url-using-javascript-calls-policy-delegate-expected.txt: Removed.
+        * fast/loader/redirect-to-invalid-url-using-javascript-calls-policy-delegate.html: Removed.
+        * fast/loader/redirect-to-invalid-url-using-javascript-disallowed-expected.txt: Removed.
+        * fast/loader/redirect-to-invalid-url-using-javascript-disallowed.html: Removed.
+        * fast/loader/redirect-to-invalid-url-using-meta-refresh-calls-policy-delegate-expected.txt: Removed.
+        * fast/loader/redirect-to-invalid-url-using-meta-refresh-calls-policy-delegate.html: Removed.
+        * fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed-expected.txt: Removed.
+        * fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed.html: Removed.
+        * fast/loader/resources/redirect-to-invalid-url-using-javascript.html: Added.
+        * fast/loader/resources/redirect-to-invalid-url-using-meta-refresh.html: Added.
+        * fast/loader/window-open-to-invalid-url-calls-policy-delegate-expected.txt: Removed.
+        * fast/loader/window-open-to-invalid-url-calls-policy-delegate.html: Removed.
+        * fast/loader/window-open-to-invalid-url-disallowed-expected.txt: Removed.
+        * fast/loader/window-open-to-invalid-url-disallowed.html: Removed.
+
 2014-08-15  Andy Estes  <aestes@apple.com>
 
         REGRESSION (r167856): adobe.com no longer able to launch Create Cloud app using a URL with a custom scheme
diff --git a/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-javascript-expected.txt b/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-javascript-expected.txt
new file mode 100644 (file)
index 0000000..31f1942
--- /dev/null
@@ -0,0 +1,13 @@
+frame "frame" - didStartProvisionalLoadForFrame
+main frame - didFinishDocumentLoadForFrame
+frame "frame" - didCommitLoadForFrame
+frame "frame" - willPerformClientRedirectToURL: x-dummy://A=a&B=b 
+frame "frame" - didFinishDocumentLoadForFrame
+main frame - didHandleOnloadEventsForFrame
+frame "frame" - 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: "willPerformClientRedirectToURL: x-dummy://A=a&B=b".
+
+Note, this test must be run in DumpRenderTree.
+
+
diff --git a/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-javascript.html b/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-javascript.html
new file mode 100644 (file)
index 0000000..5d5e04b
--- /dev/null
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.dumpFrameLoadCallbacks();
+    testRunner.waitUntilDone();
+}
+
+if (window.internals)
+    window.internals.settings.setAllowNavigationToInvalidURL(true);
+</script>
+</head>
+<body>
+<p>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;.</p>
+<p>Note, this test must be run in DumpRenderTree.</p>
+<iframe id="frame" src="resources/redirect-to-invalid-url-using-javascript.html"></iframe>
+<script>
+function done()
+{
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+window.setTimeout(done, 0);
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-meta-refresh-expected.txt b/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-meta-refresh-expected.txt
new file mode 100644 (file)
index 0000000..b5ff850
--- /dev/null
@@ -0,0 +1,14 @@
+frame "frame" - didStartProvisionalLoadForFrame
+main frame - didFinishDocumentLoadForFrame
+frame "frame" - didCommitLoadForFrame
+frame "frame" - didFinishDocumentLoadForFrame
+frame "frame" - didHandleOnloadEventsForFrame
+main frame - didHandleOnloadEventsForFrame
+frame "frame" - willPerformClientRedirectToURL: x-dummy://A=a&B=b 
+frame "frame" - didFinishLoadForFrame
+main frame - didFinishLoadForFrame
+Tests that we allow redirection to an invalid URL initiated by <meta http-equiv="refresh"> when setting allowNavigationToInvalidURL is true. This test PASSED if you see an entry in the dumped frame load callbacks of the form: "willPerformClientRedirectToURL: x-dummy://A=a&B=b".
+
+Note, this test must be run in DumpRenderTree.
+
+
diff --git a/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-meta-refresh.html b/LayoutTests/fast/loader/allow-redirect-to-invalid-url-using-meta-refresh.html
new file mode 100644 (file)
index 0000000..df88a9d
--- /dev/null
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.dumpFrameLoadCallbacks();
+    testRunner.waitUntilDone();
+}
+
+if (window.internals)
+    window.internals.settings.setAllowNavigationToInvalidURL(true);
+</script>
+</head>
+<body>
+<p>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;.</p>
+<p>Note, this test must be run in DumpRenderTree.</p>
+<iframe id="frame" src="resources/redirect-to-invalid-url-using-meta-refresh.html"></iframe>
+<script>
+function done()
+{
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+window.setTimeout(done, 0);
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-javascript-expected.txt b/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-javascript-expected.txt
new file mode 100644 (file)
index 0000000..dba9f22
--- /dev/null
@@ -0,0 +1,13 @@
+frame "frame" - didStartProvisionalLoadForFrame
+main frame - didFinishDocumentLoadForFrame
+frame "frame" - didCommitLoadForFrame
+frame "frame" - didFinishDocumentLoadForFrame
+frame "frame" - didHandleOnloadEventsForFrame
+main frame - didHandleOnloadEventsForFrame
+frame "frame" - 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: "willPerformClientRedirectToURL: x-dummy://A=a&B=b".
+
+Note, this test must be run in DumpRenderTree.
+
+
diff --git a/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-javascript.html b/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-javascript.html
new file mode 100644 (file)
index 0000000..fef4056
--- /dev/null
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.dumpFrameLoadCallbacks();
+    testRunner.waitUntilDone();
+}
+
+if (window.internals)
+    window.internals.settings.setAllowNavigationToInvalidURL(false);
+</script>
+</head>
+<body>
+<p>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;.</p>
+<p>Note, this test must be run in DumpRenderTree.</p>
+<iframe id="frame" src="resources/redirect-to-invalid-url-using-javascript.html"></iframe>
+<script>
+function done()
+{
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+window.setTimeout(done, 0);
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh-expected.txt b/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh-expected.txt
new file mode 100644 (file)
index 0000000..5a4901e
--- /dev/null
@@ -0,0 +1,13 @@
+frame "frame" - didStartProvisionalLoadForFrame
+main frame - didFinishDocumentLoadForFrame
+frame "frame" - didCommitLoadForFrame
+frame "frame" - didFinishDocumentLoadForFrame
+frame "frame" - didHandleOnloadEventsForFrame
+main frame - didHandleOnloadEventsForFrame
+frame "frame" - didFinishLoadForFrame
+main frame - didFinishLoadForFrame
+Tests that we do not redirect to an invalid URL initiated by <meta http-equiv="refresh"> when setting allowNavigationToInvalidURL is false. This test PASSED if you do not see an entry in the dumped frame load callbacks of the form: "willPerformClientRedirectToURL: x-dummy://A=a&B=b".
+
+Note, this test must be run in DumpRenderTree.
+
+
diff --git a/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh.html b/LayoutTests/fast/loader/disallow-redirect-to-invalid-url-using-meta-refresh.html
new file mode 100644 (file)
index 0000000..108b4a5
--- /dev/null
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.dumpFrameLoadCallbacks();
+    testRunner.waitUntilDone();
+}
+
+if (window.internals)
+    window.internals.settings.setAllowNavigationToInvalidURL(false);
+</script>
+</head>
+<body>
+<p>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;.</p>
+<p>Note, this test must be run in DumpRenderTree.</p>
+<iframe id="frame" src="resources/redirect-to-invalid-url-using-meta-refresh.html"></iframe>
+<script>
+function done()
+{
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+window.setTimeout(done, 0);
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/loader/redirect-to-invalid-url-using-javascript-calls-policy-delegate-expected.txt b/LayoutTests/fast/loader/redirect-to-invalid-url-using-javascript-calls-policy-delegate-expected.txt
deleted file mode 100644 (file)
index 09bd1e5..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-Policy delegate: attempt to load http://A=a&B=b with navigation type 'other'
-Tests that we do not redirect to an invalid URL initiated by JavaScript. This test PASSED if you see an entry in the dumped frame load callbacks of the form: "willPerformClientRedirectToURL: http://A=a&B=b" followed by "didCancelClientRedirectForFrame".
-
-Note, this test must be run in DumpRenderTree.
diff --git a/LayoutTests/fast/loader/redirect-to-invalid-url-using-javascript-calls-policy-delegate.html b/LayoutTests/fast/loader/redirect-to-invalid-url-using-javascript-calls-policy-delegate.html
deleted file mode 100644 (file)
index e9c97f7..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script>
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.setCustomPolicyDelegate(true, false);
-    testRunner.waitUntilDone();
-}
-</script>
-</head>
-<body>
-<p>Tests that we do not redirect to an invalid URL initiated by JavaScript. This test PASSED if you see an entry in the dumped frame load callbacks of the form: &quot;willPerformClientRedirectToURL: http://A=a&amp;B=b&quot; followed by &quot;didCancelClientRedirectForFrame&quot;.</p>
-<p>Note, this test must be run in DumpRenderTree.</p>
-<script>
-window.location.href = "http://A=a&B=b";
-window.setTimeout(function() {
-    if (window.testRunner)
-        testRunner.notifyDone();
-}, 0);
-</script>
-</body>
-</html>
@@ -13,11 +13,13 @@ if (window.testRunner) {
 <p>Tests that we do not redirect to an invalid URL initiated by JavaScript. This test PASSED if you see an entry in the dumped frame load callbacks of the form: &quot;willPerformClientRedirectToURL: http://A=a&amp;B=b&quot; followed by &quot;didCancelClientRedirectForFrame&quot;.</p>
 <p>Note, this test must be run in DumpRenderTree.</p>
 <script>
-window.location.href = "http://A=a&B=b";
-window.setTimeout(function() {
-    if (window.testRunner)
-        testRunner.notifyDone();
-}, 0);
+document.body.onload = function() {
+    window.location.href = "http://A=a&B=b";
+    window.setTimeout(function() {
+        if (window.testRunner)
+            testRunner.notifyDone();
+    }, 0);
+}
 </script>
 </body>
 </html>
diff --git a/LayoutTests/fast/loader/redirect-to-invalid-url-using-javascript-disallowed-expected.txt b/LayoutTests/fast/loader/redirect-to-invalid-url-using-javascript-disallowed-expected.txt
deleted file mode 100644 (file)
index 2b9239b..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-main frame - willPerformClientRedirectToURL: http://A=a&B=b 
-main frame - didFinishDocumentLoadForFrame
-main frame - didFinishLoadForFrame
-main frame - didCancelClientRedirectForFrame
-Tests that we do not redirect to an invalid URL initiated by JavaScript. This test PASSED if you see an entry in the dumped frame load callbacks of the form: "willPerformClientRedirectToURL: http://A=a&B=b" followed by "didCancelClientRedirectForFrame".
-
-Note, this test must be run in DumpRenderTree.
diff --git a/LayoutTests/fast/loader/redirect-to-invalid-url-using-meta-refresh-calls-policy-delegate-expected.txt b/LayoutTests/fast/loader/redirect-to-invalid-url-using-meta-refresh-calls-policy-delegate-expected.txt
deleted file mode 100644 (file)
index eaa5a0f..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-Policy delegate: attempt to load http://A=a&B=b with navigation type 'other'
-Tests that we do not redirect to an invalid URL initiated by <meta http-equiv="refresh">. This test PASSED if you see an entry in the dumped frame load callbacks of the form: "willPerformClientRedirectToURL: http://A=a&B=b" followed by "didCancelClientRedirectForFrame".
-
-Note, this test must be run in DumpRenderTree.
diff --git a/LayoutTests/fast/loader/redirect-to-invalid-url-using-meta-refresh-calls-policy-delegate.html b/LayoutTests/fast/loader/redirect-to-invalid-url-using-meta-refresh-calls-policy-delegate.html
deleted file mode 100644 (file)
index d12dd32..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta http-equiv="refresh" content="0; url=http://A=a&B=b">
-<script>
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.setCustomPolicyDelegate(true, false);
-    testRunner.waitUntilDone();
-}
-</script>
-</head>
-<body>
-<p>Tests that we do not redirect to an invalid URL initiated by &lt;meta http-equiv=&quot;refresh&quot;&gt;. This test PASSED if you see an entry in the dumped frame load callbacks of the form: &quot;willPerformClientRedirectToURL: http://A=a&amp;B=b&quot; followed by &quot;didCancelClientRedirectForFrame&quot;.</p>
-<p>Note, this test must be run in DumpRenderTree.</p>
-<script>
-// This ugly double-timeout ensures that the scheduled meta-refresh, whose timer isn't even started until the frame finishes loading,
-// fires before notifyDone() is called, ensuring that didCancelClientRedirectForFrame is logged by DumpRenderTree.
-window.setTimeout(function() {
-    window.setTimeout(function() {
-        if (window.testRunner)
-            testRunner.notifyDone();
-    }, 0);
-}, 0);
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed-expected.txt b/LayoutTests/fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed-expected.txt
deleted file mode 100644 (file)
index f4936fe..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-main frame - didFinishDocumentLoadForFrame
-main frame - didHandleOnloadEventsForFrame
-main frame - willPerformClientRedirectToURL: http://A=a&B=b 
-main frame - didFinishLoadForFrame
-main frame - didCancelClientRedirectForFrame
-Tests that we do not redirect to an invalid URL initiated by <meta http-equiv="refresh">. This test PASSED if you see an entry in the dumped frame load callbacks of the form: "willPerformClientRedirectToURL: http://A=a&B=b" followed by "didCancelClientRedirectForFrame".
-
-Note, this test must be run in DumpRenderTree.
diff --git a/LayoutTests/fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed.html b/LayoutTests/fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed.html
deleted file mode 100644 (file)
index c0cee83..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta http-equiv="refresh" content="0; url=http://A=a&B=b">
-<script>
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.dumpFrameLoadCallbacks();
-    testRunner.waitUntilDone();
-}
-</script>
-</head>
-<body>
-<p>Tests that we do not redirect to an invalid URL initiated by &lt;meta http-equiv=&quot;refresh&quot;&gt;. This test PASSED if you see an entry in the dumped frame load callbacks of the form: &quot;willPerformClientRedirectToURL: http://A=a&amp;B=b&quot; followed by &quot;didCancelClientRedirectForFrame&quot;.</p>
-<p>Note, this test must be run in DumpRenderTree.</p>
-<script>
-// This ugly double-timeout ensures that the scheduled meta-refresh, whose timer isn't even started until the frame finishes loading,
-// fires before notifyDone() is called, ensuring that didCancelClientRedirectForFrame is logged by DumpRenderTree.
-window.setTimeout(function() {
-    window.setTimeout(function() {
-        if (window.testRunner)
-            testRunner.notifyDone();
-    }, 0);
-}, 0);
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/loader/resources/redirect-to-invalid-url-using-javascript.html b/LayoutTests/fast/loader/resources/redirect-to-invalid-url-using-javascript.html
new file mode 100644 (file)
index 0000000..c07f21d
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<script>
+window.location.href = "x-dummy://A=a&B=b";
+</script>
diff --git a/LayoutTests/fast/loader/resources/redirect-to-invalid-url-using-meta-refresh.html b/LayoutTests/fast/loader/resources/redirect-to-invalid-url-using-meta-refresh.html
new file mode 100644 (file)
index 0000000..55b65da
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta http-equiv="refresh" content="0; url=x-dummy://A=a&B=b">
+</head>
+</html>
diff --git a/LayoutTests/fast/loader/window-open-to-invalid-url-calls-policy-delegate-expected.txt b/LayoutTests/fast/loader/window-open-to-invalid-url-calls-policy-delegate-expected.txt
deleted file mode 100644 (file)
index 0c82278..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-Policy delegate: attempt to load http://A=a&B=b with navigation type 'other'
-Tests that we call the navigation policy delegate when opening a new window to an invalid URL.
-
-Note, this test must be run in DumpRenderTree.
diff --git a/LayoutTests/fast/loader/window-open-to-invalid-url-calls-policy-delegate.html b/LayoutTests/fast/loader/window-open-to-invalid-url-calls-policy-delegate.html
deleted file mode 100644 (file)
index 21ee4a0..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script>
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.setCustomPolicyDelegate(true, false);
-    testRunner.waitUntilDone();
-    testRunner.setCanOpenWindows();
-}
-</script>
-</head>
-<body>
-<p>Tests that we call the navigation policy delegate when opening a new window to an invalid URL.</p>
-<p>Note, this test must be run in DumpRenderTree.</p>
-<script>
-window.open("http://A=a&B=b", "_top");
-window.setTimeout(function() {
-    if (window.testRunner)
-        testRunner.notifyDone();
-}, 0);
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/loader/window-open-to-invalid-url-disallowed-expected.txt b/LayoutTests/fast/loader/window-open-to-invalid-url-disallowed-expected.txt
deleted file mode 100644 (file)
index 85ab4c7..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-main frame - willPerformClientRedirectToURL: http://A=a&B=b 
-main frame - didFinishDocumentLoadForFrame
-main frame - didFinishLoadForFrame
-main frame - didCancelClientRedirectForFrame
-Tests that we do not open a new window to an invalid URL. This test PASSED if you see an entry in the dumped frame load callbacks of the form: "willPerformClientRedirectToURL: http://A=a&B=b" followed by "didCancelClientRedirectForFrame".
-
-Note, this test must be run in DumpRenderTree.
diff --git a/LayoutTests/fast/loader/window-open-to-invalid-url-disallowed.html b/LayoutTests/fast/loader/window-open-to-invalid-url-disallowed.html
deleted file mode 100644 (file)
index 104259e..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script>
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.dumpFrameLoadCallbacks();
-    testRunner.waitUntilDone();
-    testRunner.setCanOpenWindows();
-}
-</script>
-</head>
-<body>
-<p>Tests that we do not open a new window to an invalid URL. This test PASSED if you see an entry in the dumped frame load callbacks of the form: &quot;willPerformClientRedirectToURL: http://A=a&amp;B=b&quot; followed by &quot;didCancelClientRedirectForFrame&quot;.</p>
-<p>Note, this test must be run in DumpRenderTree.</p>
-<script>
-window.open("http://A=a&B=b", "_top");
-window.setTimeout(function() {
-    if (window.testRunner)
-        testRunner.notifyDone();
-}, 0);
-</script>
-</body>
-</html>
index 667f9f0..7c1dba1 100644 (file)
@@ -1,3 +1,15 @@
+2014-08-18  Andy Estes  <aestes@apple.com>
+
+        Revert r172697.
+
+        It made several webarchive layout tests flaky and didn't have the correct behavior for non-quick redirects.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
+        * loader/NavigationScheduler.cpp:
+        (WebCore::NavigationScheduler::shouldScheduleNavigation):
+        * page/Settings.in:
+
 2014-08-15  Andy Estes  <aestes@apple.com>
 
         REGRESSION (r167856): adobe.com no longer able to launch Create Cloud app using a URL with a custom scheme
index 229896b..e5c8da2 100644 (file)
@@ -2889,7 +2889,7 @@ bool FrameLoader::handleBeforeUnloadEvent(Chrome& chrome, FrameLoader* frameLoad
     return chrome.runBeforeUnloadConfirmPanel(text, &m_frame);
 }
 
-void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest& request, PassRefPtr<FormState> formState, bool shouldContinue)
+void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest&, PassRefPtr<FormState> formState, bool shouldContinue)
 {
     // If we loaded an alternate page to replace an unreachableURL, we'll get in here with a
     // nil policyDataSource because loading the alternate page will have passed
@@ -2898,14 +2898,11 @@ void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest& reque
 
     bool isTargetItem = history().provisionalItem() ? history().provisionalItem()->isTargetItem() : false;
 
-    bool willRedirectToInvalidURL = m_quickRedirectComing && !request.url().isValid();
-
-    // Three reasons we can't continue:
+    // Two reasons we can't continue:
     //    1) Navigation policy delegate said we can't so request is nil. A primary case of this 
     //       is the user responding Cancel to the form repost nag sheet.
     //    2) User responded Cancel to an alert popped up by the before unload event handler.
-    //    3) A redirect will occur to an invalid URL.
-    bool canContinue = shouldContinue && shouldClose() && !willRedirectToInvalidURL;
+    bool canContinue = shouldContinue && shouldClose();
 
     if (!canContinue) {
         // If we were waiting for a quick redirect, but the policy delegate decided to ignore it, then we 
index 50eb224..f5ef2d3 100644 (file)
@@ -311,6 +311,8 @@ inline bool NavigationScheduler::shouldScheduleNavigation(const URL& url) const
         return false;
     if (protocolIsJavaScript(url))
         return true;
+    if (!url.isValid() && !m_frame.settings().allowNavigationToInvalidURL())
+        return false;
     return NavigationDisablerForBeforeUnload::isNavigationAllowed();
 }
 
index 4f516ff..6d796e5 100644 (file)
@@ -226,6 +226,10 @@ temporaryTileCohortRetentionEnabled initial=true
 
 useImageDocumentForSubframePDF initial=false
 
+# 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
+
 # Allow SourceBuffers to store up to 304MB each, enough for approximately five minutes
 # of 1080p video and stereo audio.
 maximumSourceBufferSize type=int, initial=318767104, conditional=MEDIA_SOURCE
index d94b7d1..2caf42c 100644 (file)
@@ -1,3 +1,13 @@
+2014-08-18  Andy Estes  <aestes@apple.com>
+
+        Revert r172697.
+
+        It made several webarchive layout tests flaky and didn't have the correct behavior for non-quick redirects.
+
+        * Misc/WebKitVersionChecks.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2014-08-15  Andy Estes  <aestes@apple.com>
 
         REGRESSION (r167856): adobe.com no longer able to launch Create Cloud app using a URL with a custom scheme
index 1394dc6..436c584 100644 (file)
@@ -71,6 +71,7 @@
 #define WEBKIT_FIRST_VERSION_WITH_CSS_ATTRIBUTE_SETTERS_IGNORING_PRIORITY 2239 // iOS 6.0
 #define WEBKIT_FIRST_VERSION_WITH_YOUTUBE_EMBED_IFRAME_TRANSFORM 2239 // iOS 6.0
 #define WEBKIT_FIRST_VERSION_WITHOUT_LEGACY_BACKGROUNDSIZE_SHORTHAND_BEHAVIOR 2665 // iOS 7.0
+#define WEBKIT_FIRST_VERSION_WITH_NAVIGATION_URL_VALIDATION 3185 // iOS 8.0
 #endif // PLATFORM(IOS)
 
 #ifdef __cplusplus
index 4957482..7f6fffa 100644 (file)
@@ -2327,6 +2327,8 @@ static bool needsSelfRetainWhileLoadingQuirk()
 #if ENABLE(IOS_TEXT_AUTOSIZING)
     settings.setMinimumZoomFontSize([preferences _minimumZoomFontSize]);
 #endif
+
+    settings.setAllowNavigationToInvalidURL(!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_NAVIGATION_URL_VALIDATION));
 #endif // PLATFORM(IOS)
 
 #if PLATFORM(MAC)