Reviewed by Maciej and Darin.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Oct 2006 08:35:29 +0000 (08:35 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Oct 2006 08:35:29 +0000 (08:35 +0000)
        http://bugzilla.opendarwin.org/show_bug.cgi?id=4372
        JavaScript document.write page form does not submit in Safari

        Test: fast/forms/document-write.html

        * page/Frame.cpp:
        (WebCore::Frame::submitForm): Don't check for parsing().

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

LayoutTests/ChangeLog
LayoutTests/fast/forms/document-write-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/document-write.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/page/Frame.cpp

index 980373f..443606d 100644 (file)
@@ -1,3 +1,13 @@
+2006-10-01  Alexey Proskuryakov  <ap@nypop.com>
+
+        Reviewed by Maciej and Darin.
+
+        Test for http://bugzilla.opendarwin.org/show_bug.cgi?id=4372
+        JavaScript document.write page form does not submit in Safari
+
+        * fast/forms/document-write-expected.txt: Added.
+        * fast/forms/document-write.html: Added.
+
 2006-09-30  Alexey Proskuryakov  <ap@nypop.com>
 
         Reviewed by Darin.
diff --git a/LayoutTests/fast/forms/document-write-expected.txt b/LayoutTests/fast/forms/document-write-expected.txt
new file mode 100644 (file)
index 0000000..f35a800
--- /dev/null
@@ -0,0 +1,5 @@
+Test for bug 4372: JavaScript document.write page form does not submit in Safari if document.close is not called.
+
+SUCCESS
+
+
diff --git a/LayoutTests/fast/forms/document-write.html b/LayoutTests/fast/forms/document-write.html
new file mode 100644 (file)
index 0000000..235467e
--- /dev/null
@@ -0,0 +1,31 @@
+<html>
+<head>
+<script>
+function test() {
+  if (document.URL.indexOf('?') == -1) {
+
+    if (window.layoutTestController) {
+      layoutTestController.dumpAsText();
+      layoutTestController.waitUntilDone();
+    }
+    
+    document.write("<html><body>" +
+    "<form name='f' action='?' method='post'>" +
+    "<input type=submit></form><scri" +
+    "pt>document.f.submit();</scri" +
+    "pt></body></html>");
+  } else {
+    document.getElementById("result").innerHTML="SUCCESS";
+    if (window.layoutTestController)
+      layoutTestController.notifyDone();
+  }
+  
+}
+</script>
+</head>
+<body onload="test()">
+<p>Test for <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=4372">bug 4372</a>:
+JavaScript document.write page form does not submit in Safari if document.close is not called.</p>
+<p id=result>FAILURE</p>
+</body>
+</html>
index 094cea3..eee50e5 100644 (file)
@@ -1,5 +1,17 @@
 2006-10-01  Alexey Proskuryakov  <ap@nypop.com>
 
+        Reviewed by Maciej and Darin.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=4372
+        JavaScript document.write page form does not submit in Safari
+
+        Test: fast/forms/document-write.html
+
+        * page/Frame.cpp:
+        (WebCore::Frame::submitForm): Don't check for parsing().
+
+2006-10-01  Alexey Proskuryakov  <ap@nypop.com>
+
         Build fix.
 
         * bridge/mac/FrameViewMac.mm: Add missing #imports.
index 73561af..eec78e8 100644 (file)
@@ -1664,7 +1664,7 @@ void Frame::submitForm(const char *action, const String& url, const FormData& fo
       request.setContentType("Content-Type: " + contentType + "; boundary=" + boundary);
   }
 
-  if (d->m_doc->parsing() || d->m_runningScripts > 0) {
+  if (d->m_runningScripts > 0) {
     if (d->m_submitForm)
         return;
     d->m_submitForm = new FramePrivate::SubmitForm;