summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/form-radio-node-list.html
blob: 192b816e82499daebe34ed0303f6517ec310b5fb (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!doctype html>
<script src="../../resources/js-test.js"></script>
<form id="f1">
    <button id=n1></button>
    <fieldset id=n1><legend id=legend1></legend></fieldset>
    <input name=n1 type=hidden>
    <input name=n1 type=image>
    <input name=n1 type=text>
    <input name=n1 type=radio>
    <keygen id=n1></keygen>
    <output id=n1></output>
    <object name=n1></object>
    <select name=n1><option id=n1></option></select>
    <textarea id=n1></textarea>
    <div id=n1></div>
    <option id=n1></option>
</form>
<script>
description("Test RadioNodeLists returned by the HTMLFormElement named-getter.");

var form1 = document.getElementById("f1");
shouldBe("form1.elements.length", "10");

debug("Check that only 'listed elements' are included in the list, if any.");
var radioNodeList = form1["n1"];
shouldBe("radioNodeList.length", "10");

shouldBeTrue("radioNodeList[0] instanceof HTMLButtonElement");
shouldBeTrue("radioNodeList[1] instanceof HTMLFieldSetElement");
shouldBeTrue("radioNodeList[2] instanceof HTMLInputElement");
shouldBeEqualToString("radioNodeList[2].type", "hidden");
shouldBeTrue("radioNodeList[3] instanceof HTMLInputElement");
shouldBeEqualToString("radioNodeList[3].type", "text");
shouldBeTrue("radioNodeList[4] instanceof HTMLInputElement");
shouldBeEqualToString("radioNodeList[4].type", "radio");
shouldBeTrue("radioNodeList[5] instanceof HTMLKeygenElement");
shouldBeTrue("radioNodeList[6] instanceof HTMLOutputElement");
shouldBeTrue("radioNodeList[7] instanceof HTMLObjectElement");
shouldBeTrue("radioNodeList[8] instanceof HTMLSelectElement");
shouldBeTrue("radioNodeList[9] instanceof HTMLTextAreaElement");
</script>