<script>
    if (window.testRunner)
    {
        testRunner.dumpAsText();
        testRunner.waitUntilDone();
    }

    function iframeLoaded()
    {
        var result = document.getElementById("result");
        var iframe = document.getElementById("target");
        iframe.contentWindow.addEventListener("resize", function(event) {
            iframe.parentNode.removeChild(iframe);
            result.innerHTML = "COMPLETE";
            if (window.testRunner)
                testRunner.notifyDone();
        }, false);
        iframe.offsetTop;
        iframe.style.height = "100px";
        result.innerHTML = "STILL RUNNING";
    }
</script>
<p>
    Test order of frame's resize handler when we remove the frame during a resizing of the frame to a small size.
</p>
<div id="result">UNKNOWN</div>
<iframe onload="iframeLoaded()" id="target" src="data:text/html,"></iframe>
