<html>
<body onload="test()">
<iframe src='data:text/html,<a id="a" href="#" onclick="document.write(window != top ? &apos;<p>FAIL</p>&apos; : &apos;<p>PASS</p>&apos;); return false">link</a>'></iframe>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

function test()
{
    var doc = frames[0].document;
    var range=doc.createRange();
    range.selectNodeContents(doc.body);
    var frag=range.extractContents();
    document.body.appendChild(frag);

    frames[0].location = "data:text/html,";
    frames[0].frameElement.onload = test2;
}

function test2()
{
    var event = top.document.createEvent('MouseEvent');
    event.initEvent('click', true, true);
    top.document.getElementsByTagName('a')[0].dispatchEvent(event);
    if (window.testRunner)
        testRunner.notifyDone();
}
</script>
</body>
</html>
