2 <p>Test access to images inside forms as form element propertyies. Expected results match IE, because its behavior makes much more sense than Firefox one.
</p>
4 <form><img id=
"bar"></form>
9 testRunner
.dumpAsText();
13 document
.getElementById("log").innerHTML
+= msg
+ "<br>";
15 function shouldBe(a
, b
)
18 log((result
== eval(b
)) ? ("PASS: '" + a
+ "' is '" + b
+ "'.") : ("FAIL: '" + a
+ "' should be '" + b
+ "', was '" + result
+ "'."));
22 var imgFoo
= document
.createElement("img");
23 var imgBar
= document
.body
.getElementsByTagName("img")[0];
24 var div
= document
.getElementById("div");
25 imgFoo
.setAttribute("id", "foo");
27 document
.forms
[0].appendChild(imgFoo
);
28 document
.forms
[0].appendChild(imgBar
);
30 document
.forms
[1].appendChild(imgFoo
);
31 shouldBe('document.forms[0].foo', 'undefined');
32 shouldBe('document.forms[1].foo', 'imgFoo');
34 document
.forms
[0].removeChild(imgBar
);
35 shouldBe('document.forms[0].bar', 'undefined');
37 // Don't leave a broken image icon in test results.
38 document
.forms
[1].removeChild(imgFoo
);