6 var B
= document
.getElementById("span-B");
7 B
.customProperty
= "B";
8 B
.parentNode
.customProperty
= "A";
9 B
.firstChild
.customProperty
= "C";
11 document
.getElementById("div").innerHTML
= "<span>replacement content</span>";
13 // create lots of objects to force a garbage collection
21 var output
= document
.getElementById("output");
23 output
.innerHTML
+= B
.customProperty
+ "<BR>";
25 output
.innerHTML
+= B
.parentNode
.customProperty
+ "<BR>";
28 output
.innerHTML
+= B
.firstChild
.customProperty
+ "<BR>";
32 if (window
.testRunner
) {
33 testRunner
.dumpAsText();
39 <body onload=
"doit()">
40 <div style=
"border: 1px solid red">
42 This test verifies that JavaScript wrappers for DOM nodes are
43 protected against garbage collection for node trees that are outside
44 the document, so long as there's a reference to at least one node in
48 The output should be the following pieces of text on lines by themselves:
"replacement content",
"B",
"A",
"C".
52 <span id=
"span-A"><span id=
"span-B"><span id=
"span-C">original span
</span></span></span>