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

Side by Side 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, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/forms/form-submission-cancelable-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <form method="GET" target="target">
8 <input name="query" value="AAA" />
9 <input type="submit" id="submitButton"/>
10 </form>
11 <form method="GET" target="target1">
12 <input name="query1" value="AAA" />
13 <input type="submit" id="submitButton1"/>
14 </form>
15 <iframe id="target" ></iframe>
16 <iframe id="target1" ></iframe>
17 <script>
keishi 2014/03/07 01:56:31 nit: No indent inside <script> tag.
Habib Virji 2014/03/07 09:12:34 Done.
18 description("Test that form submit within onsubmit event handlers are not de layed 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.
19 var count = 2;
20 document.forms[0].onsubmit = function (event) {
21 document.forms[0].submit();
22 document.forms[0].children.query.value = 'BBB';
23 return false;
24 }
25
26 document.forms[1].onsubmit = function (event) {
27 document.forms[1].submit();
28 document.forms[1].children.query1.value = 'BBB';
29 return true;
30 }
31
32 document.getElementById('target').onload = function(event) {
33 shouldBeEqualToString('event.target.contentWindow.location.search', '?qu ery=AAA');
34 if (--count == 0)
35 finishJSTest();
36 }
37
38 document.getElementById('target1').onload = function(event) {
39 shouldBeEqualToString('event.target.contentWindow.location.search', '?qu ery1=BBB');
40 if (--count == 0)
41 finishJSTest();
42 }
43
44 window.onload = function() {
45 document.getElementById('submitButton1').click();
46 document.getElementById('submitButton').click();
47 }
48
49 if (window.testRunner)
50 window.jsTestIsAsync = true;
51
52 </script>
53 </body>
54 </html>
55
56
57
58
OLDNEW
« 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