4 <div id=
"testElements">
6 <input type=
"text" name=
"some">
7 <input type=
"text" name=
"length">
11 <option name=
"length">
17 <tr id=
"another"><td></td></tr>
18 <tr id=
"length"><td></td></tr>
24 // We need to pre-fetch these values since including the script element inserts new elements.
25 documentAllLength
= document
.all
.length
;
26 documentAllSome
= document
.all
['some'];
27 documentAll5
= document
.all
[5];
28 documentAll6
= document
.all
[6];
31 <script src=
"../../resources/js-test.js"></script>
34 description("This test ensures the builtin length property of HTMLCollection's subclasses is not overridden by a named getter of the same name.");
36 var form
= document
.forms
[0];
37 var select
= document
.querySelector('select');
38 var table
= document
.querySelector('table');
39 shouldBe("documentAllLength", "18");
40 shouldBe("documentAll5", "documentAllSome");
41 shouldBe("documentAll6.name", "'length'");
43 shouldBe("form.length", "form.elements[1]");
44 shouldBe("form.elements.length", "2");
45 shouldBe("form.elements[0]", "form.elements['some']");
46 shouldBe("form.elements[1].name", "'length'");
48 shouldBe("select.options.length", "2");
49 shouldBe("select.options[0].getAttribute('name')", "'length'");
50 shouldBe("select.options[1]", "select.options['some']");
52 shouldBe("table.rows.length", "2");
53 shouldBe("table.rows[0]", "table.rows['another']");
54 shouldBe("table.rows[1].id", "'length'");
56 document
.getElementById('testElements').style
.display
= 'none';
58 var successfullyParsed
= true;