blob: 85f7c5995c52563cc779c6717cecd51d115a089b [file] [log] [blame]
<!DOCTYPE html>
<html>
<div>Tests for a crash due to adopting a DOM node during DOMFocusOut event. Test passes if it doesn't crash.</div>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
</script>
<div id="div1"></div>
<div id="div2">
<applet>
<iframe srcdoc="<iframe srcdoc=''>">
</iframe>
</applet>
<header id="header1">
<keygen autofocus>
</header>
</div>
<script>
function doit()
{
div2.addEventListener("DOMFocusOut", function () {
document.implementation.createDocument("", "", null).adoptNode(div2);
setTimeout(() => {
if (window.internals)
internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();
if (window.testRunner)
testRunner.notifyDone();
}, 0);
}, false);
div1.outerHTML = header1.outerHTML;
}
window.onload = function() {
if (window.internals)
internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();
else
div2.getBoundingClientRect();
setTimeout("doit()", 1);
}
</script>
</html>