blob: c8b8f8b9de7e15277eb278f881b3960de6b20012 [file] [log] [blame]
<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.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
function test()
{
var doc = frames[0].document;
var range=doc.createRange();
range.selectNodeContents(doc.body);
var frag=range.cloneContents();
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.layoutTestController)
layoutTestController.notifyDone();
}
</script>
</body>
</html>