Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(404)

Unified Diff: LayoutTests/fast/forms/form-submission-cancelable.html

Issue 177683004: Don't delay submit in onsubmit event handler (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Send form data at time of method invocation Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/forms/form-submission-cancelable-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
+
+
+
+
« no previous file with comments | « no previous file | LayoutTests/fast/forms/form-submission-cancelable-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698