4 <script src=
"../../resources/js-test.js"></script>
6 <body onload=
"runTest()">
7 <p>Test to NOT save state of a detached form control.
</p>
8 <div id=
"console"></div>
10 <input id=emptyOnFirstVisit
>
11 <form action=
"data:text/html,<script>history.back()</script>" id
=form1
>
12 <input name
=user id
=input2
>
20 var form1
= document
.getElementById('form1');
21 var state
= document
.getElementById('emptyOnFirstVisit');
24 if (window
.testRunner
)
25 testRunner
.waitUntilDone();
26 state
.value
= 'visited';
28 form1
.innerHTML
= '<input name=user id=input1>';
29 i1
= document
.getElementById('input1');
31 form1
.removeChild(i1
);
32 // Submit form in a timeout to make sure that we create a new back/forward list item.
33 setTimeout(function() {document
.getElementById('form1').submit();}, 0);
36 shouldBe('document.getElementById("input2").value', '""'); // Not 'value1'.
38 if (window
.testRunner
)
39 testRunner
.notifyDone();