WebCore:
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Dec 2008 18:37:32 +0000 (18:37 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Dec 2008 18:37:32 +0000 (18:37 +0000)
2008-12-10  Brady Eidson  <beidson@apple.com>

        Reviewed by Darin

        https://bugs.webkit.org/show_bug.cgi?id=22194 and <rdar://problem/6388378> -
        Dialog when going back to a page from whence you submitted a form

        http://trac.webkit.org/changeset/37317 changed the manner in which headers are added to
        http requests, which caused the networking layer to have an incomplete set of headers
        just before consulting the Policy Delegate.  This caused a cache miss and incorrectly made
        us believe we'd be resubmitting the form.

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadItem):  Being careful to maintain the new behavior required by
          the Origin header mechanism as discussed in bug 22194, restore the previous behavior of
          setting all the headers before the networking layer is asked about the cache lookup.

WebKitTools:

2008-12-10  Brady Eidson  <beidson@apple.com>

        Reviewed by Darin

        Change the custom policy delegate to actually allow navigation for tests that need it.
        The new behavior is opt-in and doesn't require any changes in old tests.

        * DumpRenderTree/LayoutTestController.cpp:
        (setCustomPolicyDelegateCallback):  Allow for a second boolean argument to set the permissive flag on the custom
          policy delegate, which will be false by default to maintain original behavior.
        * DumpRenderTree/LayoutTestController.h:
        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
        (LayoutTestController::setCustomPolicyDelegate):

        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
        (LayoutTestController::setCustomPolicyDelegate):  Partially stubbed out for now.
        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
        (LayoutTestController::setCustomPolicyDelegate):  Still stubbed out, but with new param.

        * DumpRenderTree/mac/PolicyDelegate.h:
        * DumpRenderTree/mac/PolicyDelegate.mm:
        (-[PolicyDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]):  If the permissive flag
          is set, allow the navigation.
        (-[PolicyDelegate setPermissive:]):  Change the behavior between "use" and "ignore" - allowing navigation or not.

LayoutTests:

2008-12-10  Brady Eidson  <beidson@apple.com>

        Reviewed by Darin

        New layout tests for testing the fix for https://bugs.webkit.org/show_bug.cgi?id=22194:

        * http/tests/navigation/post-goback-repost-policy-expected.txt: Added.
        * http/tests/navigation/post-goback-repost-policy.html: Added.
        * http/tests/navigation/resources/goback-with-policydelegate.html: Added.
        * http/tests/navigation/resources/post-target-policy-test.html: Added.

        Updated layout test results for the new "custom policy delegate" mechanism:

        * fast/encoding/mailto-always-utf-8-expected.txt:
        * fast/forms/mailto/advanced-get-expected.txt:
        * fast/forms/mailto/advanced-put-expected.txt:
        * fast/forms/mailto/get-multiple-items-expected.txt:
        * fast/forms/mailto/get-multiple-items-text-plain-expected.txt:
        * fast/forms/mailto/get-multiple-items-x-www-form-urlencoded-expected.txt:
        * fast/forms/mailto/get-non-ascii-always-utf-8-expected.txt:
        * fast/forms/mailto/get-non-ascii-expected.txt:
        * fast/forms/mailto/get-non-ascii-text-plain-expected.txt:
        * fast/forms/mailto/get-non-ascii-text-plain-latin-1-expected.txt:
        * fast/forms/mailto/get-overwrite-query-expected.txt:
        * fast/forms/mailto/post-append-query-expected.txt:
        * fast/forms/mailto/post-multiple-items-expected.txt:
        * fast/forms/mailto/post-multiple-items-multipart-form-data-expected.txt:
        * fast/forms/mailto/post-multiple-items-text-plain-expected.txt:
        * fast/forms/mailto/post-multiple-items-x-www-form-urlencoded-expected.txt:
        * fast/forms/mailto/post-text-plain-expected.txt:
        * fast/forms/mailto/post-text-plain-with-accept-charset-expected.txt:
        * http/tests/security/feed-urls-from-remote-expected.txt:

        Skip the new test on Windows until the policy delegate can be enhanced there:
        * platform/win/Skipped:
        (It is already implicitly skipped for qt and gtk)

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

35 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/encoding/mailto-always-utf-8-expected.txt
LayoutTests/fast/forms/mailto/advanced-get-expected.txt
LayoutTests/fast/forms/mailto/advanced-put-expected.txt
LayoutTests/fast/forms/mailto/get-multiple-items-expected.txt
LayoutTests/fast/forms/mailto/get-multiple-items-text-plain-expected.txt
LayoutTests/fast/forms/mailto/get-multiple-items-x-www-form-urlencoded-expected.txt
LayoutTests/fast/forms/mailto/get-non-ascii-always-utf-8-expected.txt
LayoutTests/fast/forms/mailto/get-non-ascii-expected.txt
LayoutTests/fast/forms/mailto/get-non-ascii-text-plain-expected.txt
LayoutTests/fast/forms/mailto/get-non-ascii-text-plain-latin-1-expected.txt
LayoutTests/fast/forms/mailto/get-overwrite-query-expected.txt
LayoutTests/fast/forms/mailto/post-append-query-expected.txt
LayoutTests/fast/forms/mailto/post-multiple-items-expected.txt
LayoutTests/fast/forms/mailto/post-multiple-items-multipart-form-data-expected.txt
LayoutTests/fast/forms/mailto/post-multiple-items-text-plain-expected.txt
LayoutTests/fast/forms/mailto/post-multiple-items-x-www-form-urlencoded-expected.txt
LayoutTests/fast/forms/mailto/post-text-plain-expected.txt
LayoutTests/fast/forms/mailto/post-text-plain-with-accept-charset-expected.txt
LayoutTests/http/tests/navigation/post-goback-repost-policy-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/navigation/post-goback-repost-policy.html [new file with mode: 0644]
LayoutTests/http/tests/navigation/resources/goback-with-policydelegate.html [new file with mode: 0644]
LayoutTests/http/tests/navigation/resources/post-target-policy-test.html [new file with mode: 0644]
LayoutTests/http/tests/security/feed-urls-from-remote-expected.txt
LayoutTests/platform/win/Skipped
WebCore/ChangeLog
WebCore/loader/FrameLoader.cpp
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/LayoutTestController.cpp
WebKitTools/DumpRenderTree/LayoutTestController.h
WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
WebKitTools/DumpRenderTree/mac/PolicyDelegate.h
WebKitTools/DumpRenderTree/mac/PolicyDelegate.mm
WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp

index f10ba8a..75fc7b4 100644 (file)
@@ -1,3 +1,40 @@
+2008-12-10  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Darin
+
+        New layout tests for testing the fix for https://bugs.webkit.org/show_bug.cgi?id=22194:
+
+        * http/tests/navigation/post-goback-repost-policy-expected.txt: Added.
+        * http/tests/navigation/post-goback-repost-policy.html: Added.
+        * http/tests/navigation/resources/goback-with-policydelegate.html: Added.
+        * http/tests/navigation/resources/post-target-policy-test.html: Added.
+
+        Updated layout test results for the new "custom policy delegate" mechanism:
+
+        * fast/encoding/mailto-always-utf-8-expected.txt:
+        * fast/forms/mailto/advanced-get-expected.txt:
+        * fast/forms/mailto/advanced-put-expected.txt:
+        * fast/forms/mailto/get-multiple-items-expected.txt:
+        * fast/forms/mailto/get-multiple-items-text-plain-expected.txt:
+        * fast/forms/mailto/get-multiple-items-x-www-form-urlencoded-expected.txt:
+        * fast/forms/mailto/get-non-ascii-always-utf-8-expected.txt:
+        * fast/forms/mailto/get-non-ascii-expected.txt:
+        * fast/forms/mailto/get-non-ascii-text-plain-expected.txt:
+        * fast/forms/mailto/get-non-ascii-text-plain-latin-1-expected.txt:
+        * fast/forms/mailto/get-overwrite-query-expected.txt:
+        * fast/forms/mailto/post-append-query-expected.txt:
+        * fast/forms/mailto/post-multiple-items-expected.txt:
+        * fast/forms/mailto/post-multiple-items-multipart-form-data-expected.txt:
+        * fast/forms/mailto/post-multiple-items-text-plain-expected.txt:
+        * fast/forms/mailto/post-multiple-items-x-www-form-urlencoded-expected.txt:
+        * fast/forms/mailto/post-text-plain-expected.txt:
+        * fast/forms/mailto/post-text-plain-with-accept-charset-expected.txt:
+        * http/tests/security/feed-urls-from-remote-expected.txt:
+
+        Skip the new test on Windows until the policy delegate can be enhanced there:
+        * platform/win/Skipped:
+        (It is already implicitly skipped for qt and gtk)
+
 2008-12-10  Pierre-Olivier Latour  <pol@apple.com>
 
         Reviewed by Darin Adler.
index 3d2890d..ee5d1f7 100644 (file)
@@ -1,4 +1,4 @@
-Policy delegate: attempt to load mailto:?subject=%E3%82%BF%E3%82%A4%E3%83%88%E3%83%AB&body=%E6%9C%AC%E6%96%87
+Policy delegate: attempt to load mailto:?subject=%E3%82%BF%E3%82%A4%E3%83%88%E3%83%AB&body=%E6%9C%AC%E6%96%87 with navigation type 'link clicked'
 Test encoding of mailto URLs. Click on the URL - a new message with Japanese subject and body should open in your mail client.
 
 Subject : Japanese Body : Japanese
index 5a1ff4d..35fdd05 100644 (file)
@@ -1,4 +1,4 @@
-Policy delegate: attempt to load mailto:?to=to1%40site.com%2Cto2%40site.com%2Cto3%40site.com&cc=cc1%40site.com%2Ccc2%40site.com%2Ccc3%40site.com&bcc=bcc1%40site.com%2Cbcc2%40site.com%2Cbcc3%40site.com&subject=m%26m%3B%3F%3D&body=line1%0D%0Aline2%0D%0Aline3%0D%0Aline4
+Policy delegate: attempt to load mailto:?to=to1%40site.com%2Cto2%40site.com%2Cto3%40site.com&cc=cc1%40site.com%2Ccc2%40site.com%2Ccc3%40site.com&bcc=bcc1%40site.com%2Cbcc2%40site.com%2Cbcc3%40site.com&subject=m%26m%3B%3F%3D&body=line1%0D%0Aline2%0D%0Aline3%0D%0Aline4 with navigation type 'form submitted'
 Press Compose button and check that the created e-mail has correct headers and body.
 
          
index 5a1ff4d..35fdd05 100644 (file)
@@ -1,4 +1,4 @@
-Policy delegate: attempt to load mailto:?to=to1%40site.com%2Cto2%40site.com%2Cto3%40site.com&cc=cc1%40site.com%2Ccc2%40site.com%2Ccc3%40site.com&bcc=bcc1%40site.com%2Cbcc2%40site.com%2Cbcc3%40site.com&subject=m%26m%3B%3F%3D&body=line1%0D%0Aline2%0D%0Aline3%0D%0Aline4
+Policy delegate: attempt to load mailto:?to=to1%40site.com%2Cto2%40site.com%2Cto3%40site.com&cc=cc1%40site.com%2Ccc2%40site.com%2Ccc3%40site.com&bcc=bcc1%40site.com%2Cbcc2%40site.com%2Cbcc3%40site.com&subject=m%26m%3B%3F%3D&body=line1%0D%0Aline2%0D%0Aline3%0D%0Aline4 with navigation type 'form submitted'
 Press Compose button and check that the created e-mail has correct headers and body.
 
          
index 9407e9e..d7960b7 100644 (file)
@@ -1,3 +1,3 @@
-Policy delegate: attempt to load mailto:nobody@gmail.com?field1=value+1&field2=value+2
+Policy delegate: attempt to load mailto:nobody@gmail.com?field1=value+1&field2=value+2 with navigation type 'form submitted'
 Field 1:  Field 2:  
 Expected results when clicking "Send" button: A new mail message is created with an empty body.
index 9270464..1e9a73a 100644 (file)
@@ -1,2 +1,2 @@
-Policy delegate: attempt to load mailto:?to=one%40example.org&body=Line+1%0D%0ALine+2%0D%0A%40%26%3D%2C%3B%3F%22
+Policy delegate: attempt to load mailto:?to=one%40example.org&body=Line+1%0D%0ALine+2%0D%0A%40%26%3D%2C%3B%3F%22 with navigation type 'form submitted'
 Field 1:  Field 2:  
index b18e1f7..7763df0 100644 (file)
@@ -1,2 +1,2 @@
-Policy delegate: attempt to load mailto:nobody@gmail.com?to=one%40example.org&field2=value+2
+Policy delegate: attempt to load mailto:nobody@gmail.com?to=one%40example.org&field2=value+2 with navigation type 'form submitted'
 Field 1:  Field 2:  
index 193b4da..fd92cb8 100644 (file)
@@ -1,2 +1,2 @@
-Policy delegate: attempt to load mailto:one@example.org?subject=Fr%C3%A8re+Fran%C3%A7ois&body=%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0
+Policy delegate: attempt to load mailto:one@example.org?subject=Fr%C3%A8re+Fran%C3%A7ois&body=%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0 with navigation type 'form submitted'
   
index 193b4da..fd92cb8 100644 (file)
@@ -1,2 +1,2 @@
-Policy delegate: attempt to load mailto:one@example.org?subject=Fr%C3%A8re+Fran%C3%A7ois&body=%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0
+Policy delegate: attempt to load mailto:one@example.org?subject=Fr%C3%A8re+Fran%C3%A7ois&body=%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0 with navigation type 'form submitted'
   
index 193b4da..fd92cb8 100644 (file)
@@ -1,2 +1,2 @@
-Policy delegate: attempt to load mailto:one@example.org?subject=Fr%C3%A8re+Fran%C3%A7ois&body=%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0
+Policy delegate: attempt to load mailto:one@example.org?subject=Fr%C3%A8re+Fran%C3%A7ois&body=%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0 with navigation type 'form submitted'
   
index 193b4da..fd92cb8 100644 (file)
@@ -1,2 +1,2 @@
-Policy delegate: attempt to load mailto:one@example.org?subject=Fr%C3%A8re+Fran%C3%A7ois&body=%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0
+Policy delegate: attempt to load mailto:one@example.org?subject=Fr%C3%A8re+Fran%C3%A7ois&body=%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0 with navigation type 'form submitted'
   
index 04805c5..ae0eb89 100644 (file)
@@ -1,3 +1,3 @@
-Policy delegate: attempt to load mailto:nobody@gmail.com?to=someone%40example.org
+Policy delegate: attempt to load mailto:nobody@gmail.com?to=someone%40example.org with navigation type 'form submitted'
  
 Expected results when clicking "Send" button: A new mail message is created with an empty body, and two addressees.
index 8224743..31232ad 100644 (file)
@@ -1,3 +1,3 @@
-Policy delegate: attempt to load mailto:nobody@gmail.com?to=another@example.org&body=Body&body=to%3Dsomeone%2540example.org
+Policy delegate: attempt to load mailto:nobody@gmail.com?to=another@example.org&body=Body&body=to%3Dsomeone%2540example.org with navigation type 'form submitted'
  
 Expected results when clicking "Send" button: A new mail message is created with an empty body, and two addressees.
index 88a590d..71e7620 100644 (file)
@@ -1,3 +1,3 @@
-Policy delegate: attempt to load mailto:nobody@gmail.com?body=field1%3Dvalue%2B1%26field2%3Dvalue%2B2
+Policy delegate: attempt to load mailto:nobody@gmail.com?body=field1%3Dvalue%2B1%26field2%3Dvalue%2B2 with navigation type 'form submitted'
 Field 1:  Field 2:  
 Expected results when clicking "Send" button: A new mail message is created with a body of "field1=value 1&field2=value 2".
index 66666fe..48b2d9f 100644 (file)
@@ -1,2 +1,2 @@
-Policy delegate: attempt to load mailto:?body=to%3Done%2540example.org%26body%3DLine%2B1%250D%250ALine%2B2%250D%250A%2540%2526%253D%252C%253B%253F%2522
+Policy delegate: attempt to load mailto:?body=to%3Done%2540example.org%26body%3DLine%2B1%250D%250ALine%2B2%250D%250A%2540%2526%253D%252C%253B%253F%2522 with navigation type 'form submitted'
 Field 1:  Field 2:  
index 9efdfb1..d7afd62 100644 (file)
@@ -1,2 +1,2 @@
-Policy delegate: attempt to load mailto:?body=to%3Done%40example.org%0D%0Abody%3DLine%201%0D%0ALine%202%0D%0A%40%26%3D%2C%3B%3F%22%2B%0D%0A
+Policy delegate: attempt to load mailto:?body=to%3Done%40example.org%0D%0Abody%3DLine%201%0D%0ALine%202%0D%0A%40%26%3D%2C%3B%3F%22%2B%0D%0A with navigation type 'form submitted'
 Field 1:  Field 2:  
index 66666fe..48b2d9f 100644 (file)
@@ -1,2 +1,2 @@
-Policy delegate: attempt to load mailto:?body=to%3Done%2540example.org%26body%3DLine%2B1%250D%250ALine%2B2%250D%250A%2540%2526%253D%252C%253B%253F%2522
+Policy delegate: attempt to load mailto:?body=to%3Done%2540example.org%26body%3DLine%2B1%250D%250ALine%2B2%250D%250A%2540%2526%253D%252C%253B%253F%2522 with navigation type 'form submitted'
 Field 1:  Field 2:  
index c0190a3..0c4112a 100644 (file)
@@ -1,2 +1,2 @@
-Policy delegate: attempt to load mailto:one@example.org?cc=two@example.org&subject=%C3%BC%D0%B0%D1%91&body=Stra%C3%9Fe%3D%C3%BC%D0%B0%D1%91%0D%0A
+Policy delegate: attempt to load mailto:one@example.org?cc=two@example.org&subject=%C3%BC%D0%B0%D1%91&body=Stra%C3%9Fe%3D%C3%BC%D0%B0%D1%91%0D%0A with navigation type 'form submitted'
  
index c0190a3..0c4112a 100644 (file)
@@ -1,2 +1,2 @@
-Policy delegate: attempt to load mailto:one@example.org?cc=two@example.org&subject=%C3%BC%D0%B0%D1%91&body=Stra%C3%9Fe%3D%C3%BC%D0%B0%D1%91%0D%0A
+Policy delegate: attempt to load mailto:one@example.org?cc=two@example.org&subject=%C3%BC%D0%B0%D1%91&body=Stra%C3%9Fe%3D%C3%BC%D0%B0%D1%91%0D%0A with navigation type 'form submitted'
  
diff --git a/LayoutTests/http/tests/navigation/post-goback-repost-policy-expected.txt b/LayoutTests/http/tests/navigation/post-goback-repost-policy-expected.txt
new file mode 100644 (file)
index 0000000..63eab1f
--- /dev/null
@@ -0,0 +1,4 @@
+Policy delegate: attempt to load http://127.0.0.1:8000/navigation/resources/post-target-policy-test.html with navigation type 'back/forward'
+Policy delegate: attempt to load http://127.0.0.1:8000/navigation/resources/post-target-policy-test.html with navigation type 'back/forward'
+
+This page was reached via a form POST. After navigating away, there should be no form resubmission nag when navigating back here.
diff --git a/LayoutTests/http/tests/navigation/post-goback-repost-policy.html b/LayoutTests/http/tests/navigation/post-goback-repost-policy.html
new file mode 100644 (file)
index 0000000..bf8e2e9
--- /dev/null
@@ -0,0 +1,26 @@
+<html>
+<head>
+<script>
+    
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+}
+    
+function loaded()
+{    
+    document.getElementById("testform").submit();
+}
+
+</script>
+</head>
+<body onload="loaded();">
+
+<form id="testform" action="resources/post-target-policy-test.html" method="post">
+<input id="somefield" type="text" value="form data">
+</form>
+
+https://bugs.webkit.org/show_bug.cgi?id=22194 - Should be no "form resubmission" nag after navigating back in some cases.<br>
+This test does some form posts then navigates back.  There should be no form resubmission nag at the last step.
+</body>
+</html>
diff --git a/LayoutTests/http/tests/navigation/resources/goback-with-policydelegate.html b/LayoutTests/http/tests/navigation/resources/goback-with-policydelegate.html
new file mode 100644 (file)
index 0000000..fdd098c
--- /dev/null
@@ -0,0 +1,19 @@
+<html>
+<head>
+<script>
+
+function loaded()
+{
+    if (window.layoutTestController)
+        layoutTestController.setCustomPolicyDelegate(true, true);
+
+    window.history.back();
+}
+
+</script>
+</head>
+<body onload="loaded();">
+This page turns on DRT's custom policy delegate then navigates back a page.
+If you're running the test in the browser, you should not get the form resubmission nag.
+</body>
+</html>
diff --git a/LayoutTests/http/tests/navigation/resources/post-target-policy-test.html b/LayoutTests/http/tests/navigation/resources/post-target-policy-test.html
new file mode 100644 (file)
index 0000000..392507e
--- /dev/null
@@ -0,0 +1,29 @@
+<html>
+<head>
+<script>
+
+function loaded()
+{
+    if (window.sessionStorage.getItem("postedForm")) {
+        window.sessionStorage.removeItem("postedForm");
+        if (window.layoutTestController) {
+            layoutTestController.setCustomPolicyDelegate(false);
+            layoutTestController.notifyDone();
+        }
+        return;
+    }
+
+    window.sessionStorage.postedForm = "true";
+    document.getElementById("testform").submit();
+}
+
+</script>
+</head>
+<body onload="loaded();">
+<form id="testform" action="goback-with-policydelegate.html" method="post">
+<input id="somefield" type="text" value="form data">
+</form>
+
+This page was reached via a form POST.  After navigating away, there should be no form resubmission nag when navigating back here.
+</body>
+</html>
index 1ef7f3b..b7a9227 100644 (file)
@@ -1,4 +1,4 @@
-Policy delegate: attempt to load feed://127.0.0.1:8000/security/resources/feed.xml
+Policy delegate: attempt to load feed://127.0.0.1:8000/security/resources/feed.xml with navigation type 'link clicked'
 < rdar://problem/5329440> REGRESSION: Clicking links with the feed:// protocol in Safari 3 does nothing 
 This test is to see if a feed URL can be followed from a link on a page.
 
index d89e097..79d4fb7 100644 (file)
@@ -356,6 +356,28 @@ editing/pasteboard/undoable-fragment-removes.html
 # Command enabling
 editing/execCommand/enabling-and-selection-2.html
 
+# Needs custom policy delegate enhancement in DRT
+http/tests/navigation/post-goback-repost-policy.html
+fast/encoding/mailto-always-utf-8.html
+fast/forms/mailto/advanced-get.html
+fast/forms/mailto/advanced-put.html
+fast/forms/mailto/get-multiple-items.html
+fast/forms/mailto/get-multiple-items-text-plain.html
+fast/forms/mailto/get-multiple-items-x-www-form-urlencoded.html
+fast/forms/mailto/get-non-ascii-always-utf-8.html
+fast/forms/mailto/get-non-ascii.html
+fast/forms/mailto/get-non-ascii-text-plain.html
+fast/forms/mailto/get-non-ascii-text-plain-latin-1.html
+fast/forms/mailto/get-overwrite-query.html
+fast/forms/mailto/post-append-query.html
+fast/forms/mailto/post-multiple-items.html
+fast/forms/mailto/post-multiple-items-multipart-form-data.html
+fast/forms/mailto/post-multiple-items-text-plain.html
+fast/forms/mailto/post-multiple-items-x-www-form-urlencoded.html
+fast/forms/mailto/post-text-plain.html
+fast/forms/mailto/post-text-plain-with-accept-charset.html
+http/tests/security/feed-urls-from-remote.html
+
 ################################################################################
 ######################### All of above may be related ##########################
 ################################################################################
index 9cde4f8..f097763 100644 (file)
@@ -1,3 +1,20 @@
+2008-12-10  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Darin
+
+        https://bugs.webkit.org/show_bug.cgi?id=22194 and <rdar://problem/6388378> -
+        Dialog when going back to a page from whence you submitted a form
+
+        http://trac.webkit.org/changeset/37317 changed the manner in which headers are added to
+        http requests, which caused the networking layer to have an incomplete set of headers
+        just before consulting the Policy Delegate.  This caused a cache miss and incorrectly made
+        us believe we'd be resubmitting the form.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::loadItem):  Being careful to maintain the new behavior required by
+          the Origin header mechanism as discussed in bug 22194, restore the previous behavior of
+          setting all the headers before the networking layer is asked about the cache lookup.
+
 2008-12-10  Dimitri Glazkov  <dglazkov@chromium.org>
 
         Reviewed by Timothy Hatcher.
index a3af322..17751e9 100644 (file)
@@ -4359,6 +4359,7 @@ void FrameLoader::loadItem(HistoryItem* item, FrameLoadType loadType)
         }
         
         if (!inPageCache) {
+            bool addedExtraFields = false;
             ResourceRequest request(itemURL);
 
             // If this was a repost that failed the page cache, we might try to repost the form.
@@ -4374,6 +4375,11 @@ void FrameLoader::loadItem(HistoryItem* item, FrameLoadType loadType)
                 RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::createFromString(item->formReferrer());
                 addHTTPOriginIfNeeded(request, securityOrigin->toString());
         
+                // Make sure to add extra fields to the request after the Origin header is added for the FormData case.
+                // See https://bugs.webkit.org/show_bug.cgi?id=22194 for more discussion.
+                addExtraFieldsToRequest(request, true, formData);
+                addedExtraFields = true;
+                
                 // FIXME: Slight hack to test if the NSURL cache contains the page we're going to.
                 // We want to know this before talking to the policy delegate, since it affects whether 
                 // we show the DoYouReallyWantToRepost nag.
@@ -4412,8 +4418,10 @@ void FrameLoader::loadItem(HistoryItem* item, FrameLoadType loadType)
 
                 action = NavigationAction(itemOriginalURL, loadType, false);
             }
+            
+            if (!addedExtraFields)
+                addExtraFieldsToRequest(request, true, formData);
 
-            addExtraFieldsToRequest(request, true, formData);
             loadWithNavigationAction(request, action, loadType, 0);
         }
     }
index 96363ae..e525cb4 100644 (file)
@@ -1,3 +1,28 @@
+2008-12-10  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Darin
+
+        Change the custom policy delegate to actually allow navigation for tests that need it.
+        The new behavior is opt-in and doesn't require any changes in old tests.
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (setCustomPolicyDelegateCallback):  Allow for a second boolean argument to set the permissive flag on the custom
+          policy delegate, which will be false by default to maintain original behavior.
+        * DumpRenderTree/LayoutTestController.h:
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        (LayoutTestController::setCustomPolicyDelegate):
+
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::setCustomPolicyDelegate):  Partially stubbed out for now.
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::setCustomPolicyDelegate):  Still stubbed out, but with new param.
+
+        * DumpRenderTree/mac/PolicyDelegate.h:
+        * DumpRenderTree/mac/PolicyDelegate.mm:
+        (-[PolicyDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]):  If the permissive flag
+          is set, allow the navigation.
+        (-[PolicyDelegate setPermissive:]):  Change the behavior between "use" and "ignore" - allowing navigation or not.
+
 2008-12-09  Mark Rowe  <mrowe@apple.com>
 
         Rubber-stamped by Ada Chan.
index 4dad5f4..cd55130 100644 (file)
@@ -477,9 +477,13 @@ static JSValueRef setCustomPolicyDelegateCallback(JSContextRef context, JSObject
     // Has mac implementation
     if (argumentCount < 1)
         return JSValueMakeUndefined(context);
+    
+    bool permissive = false;
+    if (argumentCount >= 2)
+        permissive = JSValueToBoolean(context, arguments[1]);
 
     LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
-    controller->setCustomPolicyDelegate(JSValueToBoolean(context, arguments[0]));
+    controller->setCustomPolicyDelegate(JSValueToBoolean(context, arguments[0]), permissive);
 
     return JSValueMakeUndefined(context);
 }
index 108db37..0d0fd5a 100644 (file)
@@ -59,7 +59,7 @@ public:
     void queueScript(JSStringRef url);
     void setAcceptsEditing(bool acceptsEditing);
     void setAuthorAndUserStylesEnabled(bool);
-    void setCustomPolicyDelegate(bool setDelegate);
+    void setCustomPolicyDelegate(bool setDelegate, bool permissive);
     void setDatabaseQuota(unsigned long long quota);
     void setMainFrameIsFirstResponder(bool flag);
     void setPrivateBrowsingEnabled(bool flag);
index f4bb649..7f963b2 100644 (file)
@@ -136,7 +136,7 @@ void LayoutTestController::setAcceptsEditing(bool acceptsEditing)
     webkit_web_view_set_editable(webView, acceptsEditing);
 }
 
-void LayoutTestController::setCustomPolicyDelegate(bool setDelegate)
+void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive)
 {
     // FIXME: implement
 }
index 96e4b9b..c475cdc 100644 (file)
@@ -30,6 +30,7 @@
 #import "LayoutTestController.h"
 
 #import "EditingDelegate.h"
+#import "PolicyDelegate.h"
 #import "WorkQueue.h"
 #import "WorkQueueItem.h"
 #import <Foundation/Foundation.h>
@@ -207,11 +208,12 @@ void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
     [[[mainFrame webView] preferences] setAuthorAndUserStylesEnabled:flag];
 }
 
-void LayoutTestController::setCustomPolicyDelegate(bool setDelegate)
+void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive)
 {
-    if (setDelegate)
+    if (setDelegate) {
+        [policyDelegate setPermissive:permissive];
         [[mainFrame webView] setPolicyDelegate:policyDelegate];
-    else
+    else
         [[mainFrame webView] setPolicyDelegate:nil];
 }
 
index f8bce68..4cdf7c0 100644 (file)
@@ -30,6 +30,9 @@
 
 
 @interface PolicyDelegate : NSObject {
+    BOOL permissiveDelegate;
 }
 
+- (void)setPermissive:(BOOL)permissive;
+
 @end
index fc4ac74..a0855d3 100644 (file)
                                                              frame:(WebFrame *)frame
                                                   decisionListener:(id<WebPolicyDecisionListener>)listener
 {
-    printf("Policy delegate: attempt to load %s\n", [[[request URL] absoluteString] UTF8String]);
-    [listener ignore];
+    WebNavigationType navType = (WebNavigationType)[[actionInformation objectForKey:WebActionNavigationTypeKey] intValue];
+
+    const char* typeDescription;
+    switch (navType) {
+        case WebNavigationTypeLinkClicked:
+            typeDescription = "link clicked";
+            break;
+        case WebNavigationTypeFormSubmitted:
+            typeDescription = "form submitted";
+            break;
+        case WebNavigationTypeBackForward:
+            typeDescription = "back/forward";
+            break;
+        case WebNavigationTypeReload:
+            typeDescription = "reload";
+            break;
+        case WebNavigationTypeFormResubmitted:
+            typeDescription = "form resubmitted";
+            break;
+        case WebNavigationTypeOther:
+            typeDescription = "other";
+            break;
+        default:
+            typeDescription = "illegal value";
+    }
+    
+    printf("Policy delegate: attempt to load %s with navigation type '%s'\n", [[[request URL] absoluteString] UTF8String], typeDescription);
+    
+    if (permissiveDelegate)
+        [listener use];
+    else
+        [listener ignore];
 }
 
+- (void)setPermissive:(BOOL)permissive
+{
+    permissiveDelegate = permissive;
+}
+
+
 @end
index 10c6302..0bc35af 100644 (file)
@@ -253,8 +253,10 @@ void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
     prefsPrivate->setAuthorAndUserStylesEnabled(flag);
 }
 
-void LayoutTestController::setCustomPolicyDelegate(bool setDelegate)
+void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive)
 {
+    // FIXME: Implement the permissive delegate to test http/tests/navigation/post-goback-repost-policy.html
+
     COMPtr<IWebView> webView;
     if (FAILED(frame->webView(&webView)))
         return;