3 <p>This tests when object elements are accessible by name or id directly as properties of the
4 document object. A PASS result means that behavior matches IE and Firefox.
10 if (window
.testRunner
)
11 window
.testRunner
.dumpAsText();
14 <div style=
"visibility: hidden; width: 0px; height: 0px;">
15 <object name=
"object1" width=
"0" height=
"0"></object>
16 <object name=
"object2" width=
"0" height=
"0"><param name=
"p" value=
"v"></object>
17 <object name=
"object5" width=
"0" height=
"0"><param name=
"p" value=
"v"> </object>
18 <object name=
"object9" width=
"0" height=
"0"><param name=
"p" value=
"v"><!-- --></object>
19 <object name=
"object11" width=
"0" height=
"0"><param name=
"p" value=
"v"><!-- comment --></object>
20 <object name=
"object6" width=
"0" height=
"0"><param name=
"p" value=
"v">text
</object>
21 <object name=
"object13" width=
"0" height=
"0"><param name=
"p" value=
"v"><img width=
"0" height=
"0"></object>
22 <object id=
"object3" width=
"0" height=
"0"></object>
23 <object id=
"object4" width=
"0" height=
"0"><param name=
"p" value=
"v"></object>
24 <object id=
"object8" width=
"0" height=
"0"><param name=
"p" value=
"v"> </object>
25 <object id=
"object10" width=
"0" height=
"0"><param name=
"p" value=
"v"><!-- --></object>
26 <object id=
"object12" width=
"0" height=
"0"><param name=
"p" value=
"v"><!-- comment --></object>
27 <object id=
"object7" width=
"0" height=
"0"><param name=
"p" value=
"v">text
</object>
28 <object id=
"object14" width=
"0" height=
"0"><param name=
"p" value=
"v"><img width=
"0" height=
"0"></object>
38 document
.getElementById("results").innerHTML
+= x
;
41 function testProperty(description
, propName
, IE
) {
44 var propVal
= document
[propName
];
46 print(!propVal
== IE
? " FAIL" : " PASS");
50 print("By name:<br>");
51 testProperty("no children", "object1", true);
52 testProperty("param", "object2", true);
53 testProperty("param and whitespace", "object5", true);
54 testProperty("param and empty comment", "object9", true);
55 testProperty("param and non-empty comment", "object11", true);
56 testProperty("param and text", "object6", true);
57 testProperty("param and img", "object13", true);
58 print("<br>By id:<br>");
59 testProperty("no children", "object3", true);
60 testProperty("param", "object4", true);
61 testProperty("param and whitespace", "object8", true);
62 testProperty("param and empty comment", "object10", true);
63 testProperty("param and non-empty comment", "object12", true);
64 testProperty("param and text", "object7", true);
65 testProperty("param and img", "object14", true);