<body onload="test()">
<p>Test that an image isn't accessible via form.property syntax after being removed from document.</p>
<div>Testing...</div>
<form className="a">
<img src="" id="i">
</form>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

function gc()
{
    if (window.GCController)
        return GCController.collect();

    for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
        var s = new String("abc");
    }
}

function test()
{
    var f = document.getElementsByTagName("form")[0];
    f.removeChild(document.getElementsByTagName("img")[0]);
    f.foobar;
    setTimeout(function() {
        gc();
        try {
            f.i.nodeName;
            document.getElementsByTagName("div")[0].innerHTML = "FAIL";
        } catch (ex) {
            document.getElementsByTagName("div")[0].innerHTML = "PASS";
        }
        if (window.testRunner)
            testRunner.notifyDone();
    }, 0);
}
</script>
