4 <script src=
"../../resources/js-test.js"></script>
7 <form method=
"GET" id=
"form" onsubmit=
"formSubmit();afterSubmit(form);" target=
"target">
8 <input type=
"text" id=
"textData" name=
"textData" value=
"a">
9 <input type=
"submit" id=
"submitButton" name=
"submitform" value=
"Step">
11 <iframe id=
"target" name=
"target"></iframe>
13 description('Test that form.submit() when submitted from JS, form element added and removed, should submit the form without added element');
16 function formSubmit(event
)
18 var textData
= document
.getElementById('textData');
19 var form
= document
.getElementById('form');
20 var submit
= document
.getElementById('submitButton');
22 hidden
= document
.createElement('hidden');
23 hidden
.value
= submit
.value
;
24 hidden
.name
= submit
.name
;
25 form
.appendChild(hidden
);
30 function afterSubmit(form
)
32 form
.removeChild(hidden
);
35 document
.getElementById('target').onload = function(event
) {
36 shouldBeEqualToString('event.target.contentWindow.location.search', '?textData=b&submitform=Step');
40 window
.onload = function() {
41 document
.getElementById('submitButton').click();
44 if (window
.testRunner
)
45 window
.jsTestIsAsync
= true;