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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/submit-form-not-attached-to-document.html

Issue 2416033002: Fixed the behaviour of form submit to match the standard: no submit is taken place when the form is… (Closed)
Patch Set: Modified layout tests for the new behaviour Created 4 years, 2 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <body>
5 <form action="javascript: redirect()"></form>
6 <script>
7 var f1 = document.forms[0];
8 test(function() {
9 f1.parentNode.removeChild(f1);
10 f1.submit();
11 }, 'Submitting a form that has been removed.');
12
13 var f2 = document.createElement('form');
14 f2.action = "javascript: redirect()";
15 test(function() {
16 f2.submit();
17 }, 'Submitting a form that has never been attached to the document.');
18
19 document.body.appendChild(f2);
20 var f3 = f2.cloneNode(true);
21 f2.action = "javascript: submit_success()";
22 f3.action = "javascript: redirect()";
23 test(function() {
24 f2.submit();
25 }, 'Submitting a form that is attached to the document.');
26
27 test(function() {
28 f3.submit();
29 }, 'Submitting a form cloned from a form that is attached to the document.');
30
31 function redirect() {
32 assert_unreached('A form should never be submitted if it is not attached to th e document.');
33 }
34
35 function submit_success() {
36 assert_true(true, 'A form that is attached to the document should be submitted .');
37 }
38
39 </script>
40 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698