OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <style> | 3 <style> |
4 .invisible { | 4 .invisible { |
5 width: 0; | 5 width: 0; |
6 height: 0; | 6 height: 0; |
7 } | 7 } |
8 </style> | 8 </style> |
9 | 9 |
10 <script> | 10 <script> |
(...skipping 12 matching lines...) Expand all Loading... |
23 if (window.testRunner) | 23 if (window.testRunner) |
24 testRunner.dumpAsText(); | 24 testRunner.dumpAsText(); |
25 | 25 |
26 Array.prototype.forEach = function(f) { | 26 Array.prototype.forEach = function(f) { |
27 for (var i = 0; i < this.length; i++) // > | 27 for (var i = 0; i < this.length; i++) // > |
28 f(this[i]); | 28 f(this[i]); |
29 }; | 29 }; |
30 | 30 |
31 var objectHash = new Object(); | 31 var objectHash = new Object(); |
32 var embedHash = new Object(); | 32 var embedHash = new Object(); |
33 var appletHash = new Object(); | |
34 var intersectionHash = new Object(); | 33 var intersectionHash = new Object(); |
35 | 34 |
36 var object, embed, applet; | 35 var object, embed; |
37 | 36 |
38 object = document.getElementById("object"); | 37 object = document.getElementById("object"); |
39 embed = document.getElementById("embed"); | 38 embed = document.getElementById("embed"); |
40 applet = document.getElementById("applet"); | |
41 | 39 |
42 for (var p in object) | 40 for (var p in object) |
43 if (typeof object[p] != 'function') | 41 if (typeof object[p] != 'function') |
44 objectHash[p] = 1; | 42 objectHash[p] = 1; |
45 | 43 |
46 for (var p in embed) | 44 for (var p in embed) |
47 if (typeof embed[p] != 'function') | 45 if (typeof embed[p] != 'function') |
48 embedHash[p] = 1; | 46 embedHash[p] = 1; |
49 | 47 |
50 for (var p in applet) | |
51 if (typeof applet[p] != 'function') | |
52 appletHash[p] = 1; | |
53 | |
54 for (var p in objectHash) | 48 for (var p in objectHash) |
55 if (embedHash[p] && appletHash[p]) // ; | 49 if (embedHash[p]) // ; |
56 intersectionHash[p] = 1; | 50 intersectionHash[p] = 1; |
57 | 51 |
58 print("[OBJECT, EMBED, APPLET] share:", "green"); | 52 print("[OBJECT, EMBED] share:", "green"); |
59 var array = new Array(); | 53 var array = new Array(); |
60 for (var p in intersectionHash) | 54 for (var p in intersectionHash) |
61 if (typeof document.body[p] == 'undefined') // weed out items shared by
all elements | 55 if (typeof document.body[p] == 'undefined') // weed out items shared by
all elements |
62 array.push(p); | 56 array.push(p); |
63 array.sort(); | 57 array.sort(); |
64 array.forEach(print); | 58 array.forEach(print); |
65 | 59 |
66 print("----------"); | 60 print("----------"); |
67 print(object.tagName + " also has:", "green"); | 61 print(object.tagName + " also has:", "green"); |
68 var array = new Array(); | 62 var array = new Array(); |
69 for (var p in objectHash) | 63 for (var p in objectHash) |
70 if (!intersectionHash[p]) | 64 if (!intersectionHash[p]) |
71 array.push(p); | 65 array.push(p); |
72 array.sort(); | 66 array.sort(); |
73 array.forEach(print); | 67 array.forEach(print); |
74 | 68 |
75 print("----------"); | 69 print("----------"); |
76 print(embed.tagName + " also has:", "green"); | 70 print(embed.tagName + " also has:", "green"); |
77 var array = new Array(); | 71 var array = new Array(); |
78 for (var p in embedHash) | 72 for (var p in embedHash) |
79 if (!intersectionHash[p]) | 73 if (!intersectionHash[p]) |
80 array.push(p); | 74 array.push(p); |
81 array.sort(); | 75 array.sort(); |
82 array.forEach(print); | 76 array.forEach(print); |
83 | |
84 print("----------"); | |
85 var array = new Array(); | |
86 print(applet.tagName + " also has:", "green"); | |
87 for (var p in appletHash) | |
88 if (!intersectionHash[p]) | |
89 array.push(p); | |
90 array.sort(); | |
91 array.forEach(print); | |
92 } | 77 } |
93 </script> | 78 </script> |
94 </head> | 79 </head> |
95 | 80 |
96 <body onload="test();"> | 81 <body onload="test();"> |
97 | 82 |
98 <hr> | 83 <hr> |
99 <div id='console'></div> | 84 <div id='console'></div> |
100 | 85 |
101 <object class="invisible" id="object"></object> | 86 <object class="invisible" id="object"></object> |
102 <embed class="invisible" id="embed"></embed> | 87 <embed class="invisible" id="embed"></embed> |
103 <applet class="invisible" id="applet"></applet> | |
104 | 88 |
105 </body> | 89 </body> |
106 </html> | 90 </html> |
OLD | NEW |