11 function print(message
, color
)
13 var paragraph
= document
.createElement("div");
14 paragraph
.appendChild(document
.createTextNode(message
));
15 paragraph
.style
.fontFamily
= "monospace";
17 paragraph
.style
.color
= color
;
18 document
.getElementById("console").appendChild(paragraph
);
23 if (window
.layoutTestController
)
24 layoutTestController
.dumpAsText();
26 Array
.prototype.forEach = function(f
) {
27 for (var i
= 0; i
< this.length
; i
++) // >
31 var objectHash
= new Object();
32 var embedHash
= new Object();
33 var appletHash
= new Object();
34 var intersectionHash
= new Object();
36 var object
, embed
, applet
;
38 object
= document
.getElementById("object");
39 embed
= document
.getElementById("embed");
40 applet
= document
.getElementById("applet");
43 if (typeof object
[p
] != 'function')
47 if (typeof embed
[p
] != 'function')
51 if (typeof applet
[p
] != 'function')
54 for (var p
in objectHash
)
55 if (embedHash
[p
] && appletHash
[p
]) // ;
56 intersectionHash
[p
] = 1;
58 print("[OBJECT, EMBED, APPLET] share:", "green");
59 var array
= new Array();
60 for (var p
in intersectionHash
)
61 if (typeof document
.body
[p
] == 'undefined') // weed out items shared by all elements
67 print(object
.tagName
+ " also has:", "green");
68 var array
= new Array();
69 for (var p
in objectHash
)
70 if (!intersectionHash
[p
])
76 print(embed
.tagName
+ " also has:", "green");
77 var array
= new Array();
78 for (var p
in embedHash
)
79 if (!intersectionHash
[p
])
85 var array
= new Array();
86 print(applet
.tagName
+ " also has:", "green");
87 for (var p
in appletHash
)
88 if (!intersectionHash
[p
])
96 <body onload=
"test();">
99 <div id='console'
></div>
101 <object class=
"invisible" id=
"object"></object>
102 <embed class=
"invisible" id=
"embed"></embed>
103 <applet class=
"invisible" id=
"applet"></applet>