<p>
    Test for a crash when deactivating a document that had adopted a &lt;form>
    element.
</p>
<p>
    The test passed if it did not crash.
</p>
<iframe id="iframe"></iframe>
<script>
    var iframe = document.getElementById("iframe");

    onload = function()
    {
        if (window.testRunner) {
            testRunner.dumpAsText();
            testRunner.waitUntilDone();
        }

        document.body.offsetTop;
        var otherDocument = iframe.contentDocument;
        var form = document.createElement("form");
        otherDocument.adoptNode(form);
        form = null;
        setTimeout(finish, 0);
    }

    function finish()
    {
        if (window.GCController)
            GCController.collect()
        else {
            for (var i = 0; i < 10000; i++)
                var foo = { };
        }

        iframe.parentNode.removeChild(iframe);

        if (window.testRunner)
            testRunner.notifyDone();
    }
</script>
