| // create lots of objects to force a garbage collection |
| var output= document.getElementById("output"); |
| output.innerHTML += spanB.customProperty + "<BR>"; |
| output.innerHTML += spanB + "<BR>"; |
| output.innerHTML += spanB.parentNode + "<BR>"; |
| output.innerHTML += spanB.ownerDocument + "<BR>"; |
| var frame = document.getElementById("frame"); |
| spanB = frame.contentDocument.getElementById("span-B"); |
| spanB.customProperty = "B"; |
| frame.onload = frameLoaded; |
| frame.src = "about:blank"; |
| testRunner.waitUntilDone(); |
| <div style="border: 1px solid red"> |
| This test verifies that DOM documents are protected against garbage |
| collection but without necessarily keeping all their children alive, |
| so long as any node in the document is reachable. |
| The output should be the following pieces of text on lines by |
| themselves: "B", "[object HTMLElement]", "null", "[object HTMLDocument]". |
| <iframe id="frame" src='data:text/html,<div id="div"><span id="span-A"><span id="span-B"><span id="span-C">original span</span></span></span></div>'> |