blob: d7d706d7c14cb19cbd6f1472fed69cfce1e42e05 [file] [log] [blame]
<div id=test><iframe src="#test" onload="setTimeout(crash, 0)"></iframe></div>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
var observer = new MutationObserver(function() {});
observer.observe(document.querySelector('#test'), { attributes: true });
function crash() {
if (window.top === window) {
var iframe = document.querySelector('iframe');
var otherDocument = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html");
otherDocument.adoptNode(iframe.contentDocument.documentElement);
otherDocument.documentElement.appendChild(iframe);
gc();
setTimeout(function() {
console.log('Test passes if it prints this message without crashing');
testRunner.notifyDone();
}, 0);
}
}
</script>