| <form id="someForm"></form> |
| <input type="text" name="someName" form="someForm"> |
| <script src="../../resources/js-test-pre.js"></script> |
| description("Tests form.elements is invalidated when input element's form attribute is changed."); |
| var input = document.querySelector('input'); |
| evalAndLog("collection = document.getElementById('someForm').elements;"); |
| shouldBe("collection.length", "1"); |
| shouldBe("collection.length; input.setAttribute('form', 'otherForm'); collection.length", "0"); |
| shouldBe("collection.length; input.setAttribute('form', 'someForm'); collection.length", "1"); |
| container.style.display = 'none'; |