4 https://bugzilla.mozilla.org/show_bug.cgi?id=567938
7 <title>Test for Bug
567938</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <script src=
"/tests/SimpleTest/EventUtils.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=567938">Mozilla Bug
567938</a>
15 <iframe id='iframe'
name=
"submit_frame" style=
"visibility: hidden;"></iframe>
16 <div id=
"content" style=
"display: none">
17 <form id='f' method='get' target='submit_frame'
>
21 <script type=
"application/javascript">
23 /** Test for Bug
567938 **/
25 SimpleTest.waitForExplicitFinish();
26 addLoadEvent(runTests);
28 var gTestData = [
"submit",
"image"];
31 function initializeNextTest()
33 var form = document.forms[
0];
36 form.textContent =
"";
38 // Add the new element.
39 var element = document.createElement(
"input");
41 element.type = gTestData[gCurrentTest];
42 // eslint-disable-next-line no-implied-eval
43 element.onclick = function() { setTimeout(
"document.forms[0].submit();",
0); return false; };
44 form.appendChild(element);
45 form.action = gTestData[gCurrentTest];
47 sendMouseEvent({type: 'click'}, 'i');
52 document.getElementById('iframe').addEventListener('load', function(aEvent) {
53 is(frames.submit_frame.location.href,
54 `${location.origin}/tests/dom/html/test/${gTestData[gCurrentTest]}?`,
55 "The form should have been submitted");
57 if (gCurrentTest < gTestData.length) {
60 aEvent.target.removeEventListener('load', arguments.callee);