1 <p>Test for (rdar://problem/
5725058). If you see this text, then all is well and no crash has occurred.
</p>
3 <p id=
"a">paragraph a
</p>
4 <p id=
"b">paragraph b
</p>
7 testRunner
.dumpAsText();
9 function triggerGarbageCollection()
11 if (window
.GCController
) {
12 GCController
.collect();
15 for (var i
= 0; i
< 10000; ++i
)
21 // This only works if in a function. I'm not sure why.
23 // Get node and length from paragraph A into the cache.
24 document
.getElementById("a").childNodes
[0];
25 document
.getElementById("a").childNodes
.length
;
30 // Get back to "zero node lists".
31 triggerGarbageCollection();
33 // Remove the child node of paragraph A. Use innerHTML to avoid getting a reference to the node being removed.
34 document
.getElementById("a").innerHTML
= "";
36 // Get back to "one node list".
37 var childNodesB
= document
.getElementById("b").childNodes
;
39 // Now try the original list.
40 var x
= document
.getElementById("a").childNodes
[0];
41 x
= document
.getElementById("a").childNodes
.length
;