| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <script> | 2 <script> |
| 3 if (window.testRunner) { | 3 if (window.testRunner) { |
| 4 testRunner.dumpAsText(); | 4 testRunner.dumpAsText(); |
| 5 testRunner.waitUntilDone(); | 5 testRunner.waitUntilDone(); |
| 6 } | 6 } |
| 7 | 7 |
| 8 if (document.location.href.indexOf("n=v") == -1) | |
| 9 document.location.search = "?n=v"; | |
| 10 | |
| 11 function runTest() { | 8 function runTest() { |
| 9 if (document.location.href.indexOf("n=v") == -1) { |
| 10 document.location.search = "?n=v"; |
| 11 return; |
| 12 } |
| 12 document.forms.f.action="#firstaction"; | 13 document.forms.f.action="#firstaction"; |
| 13 document.forms.f.submit(); | 14 document.forms.f.submit(); |
| 14 document.forms.f.action="#secondaction"; | 15 document.forms.f.action="#secondaction"; |
| 15 } | 16 } |
| 16 | 17 |
| 17 function hashChanged() { | 18 function hashChanged() { |
| 18 if (document.location.href.indexOf("firstaction") != -1) { | 19 if (document.location.href.indexOf("firstaction") != -1) { |
| 19 document.getElementById("console").innerHTML="PASS"; | 20 document.getElementById("console").innerHTML="PASS"; |
| 20 if (window.testRunner) | 21 if (window.testRunner) |
| 21 testRunner.notifyDone(); | 22 testRunner.notifyDone(); |
| 22 } | 23 } |
| 23 } | 24 } |
| 24 | 25 |
| 25 | 26 |
| 26 </script> | 27 </script> |
| 27 <body onhashchange="hashChanged();" onload="runTest();"> | 28 <body onhashchange="hashChanged();" onload="runTest();"> |
| 28 <div><a href="https://bugs.webkit.org/show_bug.cgi?id=20342">https://bugs.webkit
.org/show_bug.cgi?id=20342</a></div> | 29 <div><a href="https://bugs.webkit.org/show_bug.cgi?id=20342">https://bugs.webkit
.org/show_bug.cgi?id=20342</a></div> |
| 29 <p>Test that when the form method is get, and the form action is the same as the
current location url, but with different fragment, we do not reload the page, a
nd the onload handler is not called again.</p> | 30 <p>Test that when the form method is get, and the form action is the same as the
current location url, but with different fragment, we do not reload the page, a
nd the onload handler is not called again.</p> |
| 30 <p>Also test that changing the form action after the form was submitted has no e
ffect.</p> | 31 <p>Also test that changing the form action after the form was submitted has no e
ffect.</p> |
| 31 | 32 |
| 32 <form name="f" method="GET" action="#action"><input name="n" value="v"></form> | 33 <form name="f" method="GET" action="#action"><input name="n" value="v"></form> |
| 33 <div id="console">FAIL</div> | 34 <div id="console">FAIL</div> |
| 34 <script> | 35 <script> |
| 35 </script> | 36 </script> |
| 36 </body> | 37 </body> |
| 37 </html> | 38 </html> |
| OLD | NEW |