1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../resources/js-test.js"></script>
7 <p id=
"description"></p>
8 <div id=
"console"></div>
10 description("This test lists all the elements of a form per http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#category-listed.");
11 debug("This test does not add object element as a listed element. Separate test will cover that.");
13 var container
= document
.createElement('div');
14 document
.body
.appendChild(container
);
16 container
.innerHTML
= '<form id="form1">' +
17 '<button id=button1></button>' +
18 '<fieldset id=fieldset1><legend id=legend1></legend></fieldset>' +
19 '<input id=inputhidden type=hidden>' +
20 '<input id=inputtext type=text>' +
21 '<input id=inputsearch type=search>' +
22 '<input id=inputurl type=url>' +
23 '<input id=inputemail type=email>' +
24 '<input id=inputpassword type=password>' +
25 '<input id=inputdate type=date>' +
26 '<input id=inputnumber type=number>' +
27 '<input id=inputrange type=range>' +
28 '<input id=inputcolor type=color>' +
29 '<input id=inputcheckbox type=checkbox>' +
30 '<input id=inputradio type=radio>' +
31 '<input id=inputfile type=file>' +
32 '<input id=inputsubmit type=submit>' +
33 '<input id=inputimage type=image>' +
34 '<input id=inputreset type=reset>' +
35 '<input id=inputbutton type=button>' +
36 '<keygen id=keygen1></keygen>' +
37 '<label id=label1></label>' +
38 '<meter id=meter1></meter>' +
39 '<object id=object1></object>' +
40 '<output id=output1></output>' +
41 '<progress id=progress1></progress>' +
42 '<select id=select1>' +
43 ' <optgroup id=optgroup1>group1</optgroup>' +
44 ' <option id=option1>option1</option>' +
46 '<textarea id=textarea1></textarea>' +
49 var owner
= document
.getElementById('form1');
51 shouldBe('owner.elements.length', '23');
52 shouldBe('owner.elements[0].id', "'button1'");
53 shouldBe('owner.elements[1].id', "'fieldset1'");
54 shouldBe('owner.elements[2].id', "'inputhidden'");
55 shouldBe('owner.elements[3].id', "'inputtext'");
56 shouldBe('owner.elements[4].id', "'inputsearch'");
57 shouldBe('owner.elements[5].id', "'inputurl'");
58 shouldBe('owner.elements[6].id', "'inputemail'");
59 shouldBe('owner.elements[7].id', "'inputpassword'");
60 shouldBe('owner.elements[8].id', "'inputdate'");
61 shouldBe('owner.elements[9].id', "'inputnumber'");
62 shouldBe('owner.elements[10].id', "'inputrange'");
63 shouldBe('owner.elements[11].id', "'inputcolor'");
64 shouldBe('owner.elements[12].id', "'inputcheckbox'");
65 shouldBe('owner.elements[13].id', "'inputradio'");
66 shouldBe('owner.elements[14].id', "'inputfile'");
67 shouldBe('owner.elements[15].id', "'inputsubmit'");
68 shouldBe('owner.elements[16].id', "'inputreset'");
69 shouldBe('owner.elements[17].id', "'inputbutton'");
70 shouldBe('owner.elements[18].id', "'keygen1'");
71 shouldBe('owner.elements[19].id', "'object1'");
72 shouldBe('owner.elements[20].id', "'output1'");
73 shouldBe('owner.elements[21].id', "'select1'");
74 shouldBe('owner.elements[22].id', "'textarea1'");