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

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: 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
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..9419c4a2787e954bebf119c0f835c3cd60971c5c
--- /dev/null
+++ b/LayoutTests/fast/forms/form-submission-cancelable.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src="../../resources/js-test.js"></script>
+ </head>
+ <body>
+ <form method="GET" action="data:text/html,
+ <script>
+ window.onload= function() {
+ var query=window.location.search;
+ console.log(query);
+ console.log(query.indexOf('query=AAA') == 1);
keishi 2014/02/28 10:57:48 We should use js-test.js shouldBe* methods if poss
Habib Virji 2014/03/04 14:37:53 Done.
+ }
+ </script>" target="target">
+ <input name="query" value="AAA" />
+ <input type="submit" id="submitButton"/>
+ </form>
+
+ <form method="GET" action="data:text/html,
+ <script>
+ window.onload= function() {
+ var query=window.location.search;
+ console.log(query);
+ console.log(query.indexOf('query1=BBB') == 1);
+ window.testRunner && testRunner.notifyDone();
+ }
+ </script>" target="target1">
+ <input name="query1" value="AAA" />
+ <input type="submit" id="submitButton1"/>
+ </form>
+ <script>
+ description("Test for the form submit, when prevented should not submit the form");
keishi 2014/02/28 10:57:48 This bug is not about respecting the return value
keishi 2014/02/28 10:57:48 nit: We should unify string literals to single quo
Habib Virji 2014/03/04 14:37:53 Done.
+ if (window.testRunner)
+ {
keishi 2014/02/28 10:57:48 nit: No line break before braces in JavaScript.
Habib Virji 2014/03/04 14:37:53 Done.
+ testRunner.dumpAsText();
keishi 2014/02/28 10:57:48 We have js-test.js so this is already done.
Habib Virji 2014/03/04 14:37:53 Done.
+ testRunner.setCanOpenWindows();
keishi 2014/02/28 10:57:48 I think we don't need these lines? (setCanOpenWind
Habib Virji 2014/03/04 14:37:53 Done.
+ testRunner.setPopupBlockingEnabled(true);
+ testRunner.setCloseRemainingWindowsWhenComplete(true);
+ testRunner.waitUntilDone();
keishi 2014/02/28 10:57:48 We have js-test.js so we can use window.jsTestIsAs
Habib Virji 2014/03/04 14:37:53 Done.
+ }
+
+ 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;
+ }
+
+ window.onload = function()
+ {
+ document.getElementById('submitButton').click();
+ document.getElementById('submitButton1').click();
+ }
+
+ </script>
+
+ <iframe id="target"></iframe>
+ <iframe id="target1"></iframe>
+</body>
+</html>
+
+
+
+
« no previous file with comments | « no previous file | LayoutTests/fast/forms/form-submission-cancelable-expected.txt » ('j') | Source/core/html/HTMLFormElement.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698