summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/elements-invalidate-on-form-attribute-invalidation.html
blob: 13fa69e23213b0e433cff83a4a58dc30b10c0a4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<html>
<body>
<div id="container">
<form id="someForm"></form>
<input type="text" name="someName" form="someForm">
</div>
<script src="../../resources/js-test.js"></script>
<script>

description("Tests form.elements is invalidated when input element's form attribute is changed.");

var input = document.querySelector('input');
var collection;
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';

</script>
</body>
</html>