<p>This test verifies that removing an iframe from the DOM removes the 
corresponding frame from the page, even if the iframe's id has changed and the 
iframe is loading a document.</p>
<pre id="console"></pre>
<iframe id="iframe"></iframe>

<script>
function log(s)
{
    document.getElementById("console").appendChild(document.createTextNode(s));
}

if (window.testRunner)
    testRunner.dumpAsText();

var iframe = document.getElementById("iframe");
iframe.setAttribute("id", "iframe2", 0);
iframe.setAttribute("src", "data:text/html,", 0);
iframe.parentNode.removeChild(iframe);

if (frames.length)
    log("FAIL: iframe remained in the page.\n");
else
    log("PASS: iframe removed from the page.\n");
</script>
