blob: 6757ece09b9f5909b55ca8c995ecfe08d4bcb3bd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
<html>
<head>
<style>
.invisible {
width: 0;
height: 0;
}
</style>
<script>
function print(message, color)
{
var paragraph = document.createElement("div");
paragraph.appendChild(document.createTextNode(message));
paragraph.style.fontFamily = "monospace";
if (color)
paragraph.style.color = color;
document.getElementById("console").appendChild(paragraph);
}
function test()
{
if (window.testRunner)
testRunner.dumpAsText();
Array.prototype.forEach = function(f) {
for (var i = 0; i < this.length; i++) // >
f(this[i]);
};
var objectHash = new Object();
var embedHash = new Object();
var intersectionHash = new Object();
var divElement = document.createElement('div');
var object, embed;
object = document.getElementById("object");
embed = document.getElementById("embed");
for (var p in object)
if (typeof object[p] != 'function')
objectHash[p] = 1;
for (var p in embed)
if (typeof embed[p] != 'function')
embedHash[p] = 1;
for (var p in objectHash)
if (embedHash[p]) // ;
intersectionHash[p] = 1;
print("[OBJECT, EMBED] share:", "green");
var array = new Array();
for (var p in intersectionHash)
if (typeof divElement[p] == 'undefined') // weed out items shared by all elements
array.push(p);
array.sort();
array.forEach(print);
print("----------");
print(object.tagName + " also has:", "green");
var array = new Array();
for (var p in objectHash)
if (!intersectionHash[p])
array.push(p);
array.sort();
array.forEach(print);
print("----------");
print(embed.tagName + " also has:", "green");
var array = new Array();
for (var p in embedHash)
if (!intersectionHash[p])
array.push(p);
array.sort();
array.forEach(print);
}
</script>
</head>
<body onload="test();">
<hr>
<div id='console'></div>
<div><object class="invisible" id="object"></object></div>
<div><embed class="invisible" id="embed"></embed></div>
</body>
</html>
|