| <script src="../../resources/js-test-pre.js"></script> |
| <body onload="runTest()"> |
| <p>Test to NOT save state of a detached form control.</p> |
| <input id=emptyOnFirstVisit> |
| <form action="data:text/html,<script>history.back()</script>" id=form1> |
| <input name=user id=input2> |
| var form1 = document.getElementById('form1'); |
| var state = document.getElementById('emptyOnFirstVisit'); |
| testRunner.waitUntilDone(); |
| form1.innerHTML = '<input name=user id=input1>'; |
| i1 = document.getElementById('input1'); |
| // Submit form in a timeout to make sure that we create a new back/forward list item. |
| setTimeout(function() {document.getElementById('form1').submit();}, 0); |
| shouldBe('document.getElementById("input2").value', '""'); // Not 'value1'. |