Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /editing/crashtests/remove-all-children-of-documentElement-in-designMode-when-no-body.html - WPT Dashboard Interop Dashboard
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script>
document.addEventListener("DOMContentLoaded", () => {
document.designMode = "on";
document.documentElement.innerText = "abc def\n"; // causes removing the implicit <body> element
let child;
while ((child = document.documentElement.lastChild)) {
child.remove();
}
}, {once: true});
</script>
</head>
</html>