4 https://bugzilla.mozilla.org/show_bug.cgi?id=398243
7 <title>Test for Bug
398243</title>
8 <script type=
"text/javascript" src=
"/MochiKit/MochiKit.js"></script>
9 <script type=
"text/javascript" src=
"/tests/SimpleTest/SimpleTest.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=398243">Mozilla Bug
398243</a>
15 <div id=
"content" style=
"display: none">
17 <iframe id=
"testframe" src=
"http://localhost:8888/tests/content/base/test/formReset.html"></iframe>
19 <script class=
"testbody" type=
"text/javascript">
20 /** Test for Bug
398243 **/
21 const enteredText1 =
"New value for text input";
22 const enteredText2 =
"New value for texarea";
23 SimpleTest.waitForExplicitFinish();
25 function afterLoad() {
26 var iframeDoc = $(
"testframe").contentDocument;
27 /* change all the form controls */
28 iframeDoc.getElementById(
"checkbox1").checked = true;
29 iframeDoc.getElementById(
"checkbox2").checked = false;
30 iframeDoc.getElementById(
"textinput").value = enteredText1;
31 iframeDoc.getElementById(
"textarea").value = enteredText2;
34 $(
"testframe").setAttribute(
"onload",
"afterReload()");
35 iframeDoc.location.reload();
38 addLoadEvent(afterLoad);
40 function afterReload() {
41 var iframeDoc = $(
"testframe").contentDocument;
42 is(iframeDoc.getElementById(
"checkbox1").checked, true,
43 "checkbox #1 state preserved");
44 is(iframeDoc.getElementById(
"checkbox2").checked, false,
45 "checkbox #2 state preserved");
46 is(iframeDoc.getElementById(
"textinput").value, enteredText1,
47 "text preserved in <input>");
48 is(iframeDoc.getElementById(
"textarea").value, enteredText2,
49 "text preserved in <textarea>");