Index: LayoutTests/fast/forms/form-submission-cancelable.html |
diff --git a/LayoutTests/fast/forms/form-submission-cancelable.html b/LayoutTests/fast/forms/form-submission-cancelable.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4efcee0693bd68f8333a0dc603866d59a345b14e |
--- /dev/null |
+++ b/LayoutTests/fast/forms/form-submission-cancelable.html |
@@ -0,0 +1,58 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="../../resources/js-test.js"></script> |
+</head> |
+<body> |
+<form method="GET" target="target"> |
+ <input name="query" value="AAA" /> |
+ <input type="submit" id="submitButton"/> |
+</form> |
+<form method="GET" target="target1"> |
+ <input name="query1" value="AAA" /> |
+ <input type="submit" id="submitButton1"/> |
+</form> |
+<iframe id="target" ></iframe> |
+<iframe id="target1" ></iframe> |
+<script> |
keishi
2014/03/07 01:56:31
nit: No indent inside <script> tag.
Habib Virji
2014/03/07 09:12:34
Done.
|
+ description("Test that form submit within onsubmit event handlers are not delayed and sends the form data when invoked"); |
keishi
2014/03/07 01:56:31
nit: single quotes
Habib Virji
2014/03/07 09:12:34
Done.
|
+ var count = 2; |
+ document.forms[0].onsubmit = function (event) { |
+ document.forms[0].submit(); |
+ document.forms[0].children.query.value = 'BBB'; |
+ return false; |
+ } |
+ |
+ document.forms[1].onsubmit = function (event) { |
+ document.forms[1].submit(); |
+ document.forms[1].children.query1.value = 'BBB'; |
+ return true; |
+ } |
+ |
+ document.getElementById('target').onload = function(event) { |
+ shouldBeEqualToString('event.target.contentWindow.location.search', '?query=AAA'); |
+ if (--count == 0) |
+ finishJSTest(); |
+ } |
+ |
+ document.getElementById('target1').onload = function(event) { |
+ shouldBeEqualToString('event.target.contentWindow.location.search', '?query1=BBB'); |
+ if (--count == 0) |
+ finishJSTest(); |
+ } |
+ |
+ window.onload = function() { |
+ document.getElementById('submitButton1').click(); |
+ document.getElementById('submitButton').click(); |
+ } |
+ |
+ if (window.testRunner) |
+ window.jsTestIsAsync = true; |
+ |
+</script> |
+</body> |
+</html> |
+ |
+ |
+ |
+ |