chromium/third_party/blink/web_tests/fast/dom/gc-6.html

<head>
<script>

function frameLoaded()
{
    gc();
    var output= document.getElementById("output");

    output.innerHTML += spanB.customProperty + "<BR>";
    output.innerHTML += spanB + "<BR>";
    output.innerHTML += spanB.parentNode + "<BR>";
    output.innerHTML += spanB.ownerDocument + "<BR>";

    if (window.testRunner)
        testRunner.notifyDone();
}

function doit()
{
    var frame = document.getElementById("frame");
    spanB = frame.contentDocument.getElementById("span-B");
    spanB.customProperty = "B";
    frame.srcdoc = "";
    frame.onload = frameLoaded;
    frame.src = "about:blank";
}

if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

</script>
</head>

<body onload="doit()">
<div style="border: 1px solid red">
<p>
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.
</p>
<p>
The output should be the following pieces of text on lines by
themselves: "B", "[object HTMLSpanElement]", "[object HTMLSpanElement]", "[object HTMLDocument]".
</p>
</div>

<div id="output">
</div>

<iframe id="frame" srcdoc='<div id="div"><span id="span-A"><span id="span-B"><span id="span-C">original span</span></span></span></div>'>
</body>