blob: 51730472af357ff9bdca3d28d0b3a56e2dbfcd25 [file] [log] [blame]
<head>
<script>
function doit()
{
B = document.getElementById("span-B");
B.customProperty = "B";
document.getElementById("div").innerHTML = "<span>replacement content</span>";
// create lots of objects to force a garbage collection
var i = 0;
var s;
while (i < 5000) {
i = i+1.11;
s = s + " ";
}
var output= document.getElementById("output");
output.innerHTML += B.customProperty + "<BR>";
if (B.parentNode) {
output.innerHTML += "parent node exists<BR>";
}
if (B.firstChild) {
output.innerHTML += "child node exists<BR>";
}
}
if (window.layoutTestController) {
layoutTestController.dumpAsText();
}
</script>
</head>
<body onload="doit()">
<div style="border: 1px solid red">
<p>
This test verifies that DOM nodes are not retained just because a wrapper exists for a descendant. A wrapper must exist for the node itself or for an ancestor.
</p>
<p>
The output should be the following pieces of text on lines by themselves: "replacement content", "B", "child node exists".
</p>
</div>
<div id="div">
<span id="span-A"><span id="span-B"><span id="span-C">original span</span></span></span>
</div>
<div id="output">
</div>
</body>