OLD | NEW |
---|---|
(Empty) | |
1 <!doctype html> | |
2 <script src="../../resources/js-test.js"></script> | |
3 <form id="f1"> | |
4 <button id=n1></button> | |
5 <fieldset id=n1><legend id=legend1></legend></fieldset> | |
6 <input name=n1 type=hidden> | |
7 <input name=n1 type=image> | |
8 <input name=n1 type=text> | |
9 <input name=n1 type=radio> | |
10 <keygen id=n1></keygen> | |
11 <output id=n1></output> | |
12 <object name=n1></object> | |
13 <select name=n1><option id=n1></option></select> | |
14 <textarea id=n1></textarea> | |
15 <div id=n1></div> | |
16 <option id=n1></option> | |
17 </form> | |
18 <script> | |
19 description("Test RadioNodeLists returned by the HTMLFormElement named-getter.") ; | |
20 | |
21 var form1 = document.getElementById("f1"); | |
22 shouldBe("form1.elements.length", "10"); | |
23 | |
24 debug("Check that only 'listed elements' are included in the list, if any."); | |
25 var radioNodeList = form1["n1"]; | |
26 shouldBe("radioNodeList.length", "10"); | |
27 | |
28 shouldBeTrue("radioNodeList[0] instanceof HTMLButtonElement"); | |
29 shouldBeTrue("radioNodeList[1] instanceof HTMLFieldSetElement"); | |
30 shouldBeTrue("radioNodeList[2] instanceof HTMLInputElement"); | |
31 shouldBe("radioNodeList[2].type", "'hidden'"); | |
tkent
2013/12/20 00:18:11
shouldBeEqualToString("...", "hidden");
is cleaner
sof
2013/12/20 07:02:12
Yes; done.
| |
32 shouldBeTrue("radioNodeList[3] instanceof HTMLInputElement"); | |
33 shouldBe("radioNodeList[3].type", "'text'"); | |
tkent
2013/12/20 00:18:11
Ditto.
sof
2013/12/20 07:02:12
Done.
| |
34 shouldBeTrue("radioNodeList[4] instanceof HTMLInputElement"); | |
35 shouldBe("radioNodeList[4].type", "'radio'"); | |
tkent
2013/12/20 00:18:11
Ditto.
sof
2013/12/20 07:02:12
Done.
| |
36 shouldBeTrue("radioNodeList[5] instanceof HTMLKeygenElement"); | |
37 shouldBeTrue("radioNodeList[6] instanceof HTMLOutputElement"); | |
38 shouldBeTrue("radioNodeList[7] instanceof HTMLObjectElement"); | |
39 shouldBeTrue("radioNodeList[8] instanceof HTMLSelectElement"); | |
40 shouldBeTrue("radioNodeList[9] instanceof HTMLTextAreaElement"); | |
41 </script> | |
42 <p id="description"></p> | |
tkent
2013/12/20 00:18:11
nit: You don't need to write #description element.
sof
2013/12/20 07:02:12
Done.
| |
OLD | NEW |