2 <script src=
"../../resources/js-test.js"></script>
3 <img name=outside1
></img>
5 <button id=n1
></button>
6 <keygen id=n1
></keygen>
7 <output id=n1
></output>
8 <object name=n1
></object>
9 <select name=n1
><option id=n1
></option></select>
10 <input name=n1 type=hidden
>
11 <input name=n1 type=image
>
12 <input name=n1 type=text
>
13 <input name=n2 type=image
>
18 <!-- The img element isn't 'reassociatable'; add @form to verify it is so. -->
19 <img name=n2 form=f1
></img>
21 description("Test RadioNodeLists returned by the HTMLFormElement named-getter.");
25 function shouldBeImgElement(n
) {
26 shouldBeTrue("radioNodeList[" + n
+ "] instanceof HTMLImageElement");
29 function verifyLength(n
) {
30 shouldBe("radioNodeList.length", n
.toString());
31 for (var i
= 0; i
< n
; i
++)
32 shouldBeImgElement(i
);
35 debug("Check that if no 'listed elements' match by name, img elements are picked instead.");
37 var form
= document
.getElementById("f1");
38 radioNodeList
= form
["n2"];
41 var button
= document
.createElement("button");
43 form
.appendChild(button
);
46 var img
= document
.createElement("img");
48 form
.appendChild(img
);