blob: b29b689ea15d70bdc78beb8a3536ef65eb2d1d0b [file] [log] [blame]
<!DOCTYPE html><!-- webkit-test-runner [ enableKeygenElement=true ] -->
<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>