blob: d69c50689afbe2b9adf02288f2fae620073fc808 [file] [log] [blame]
<!DOCTYPE html>
<head>
<script>
if (window.testRunner)
testRunner.dumpAsText();
onload = function() {
// Make documentElement to P element without HTML and BODY.
var htmlElement = document.documentElement;
var target = document.getElementById('target');
document.replaceChild(target, htmlElement);
document.designMode = 'on';
window.getSelection().collapse(target, 0);
document.execCommand('InsertHTML', false, '<pre></pre>');
// Here, document.documentElement is null.
document.write('Pass if not crash.');
};
</script>
</head>
<body>
<p id="target"></p>
</body>
</html>