Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /shadow-dom/crashtests/add-host-child-text-crash.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>Adding text node to a shadow host should not crash</title>
<div id="host"></div>
<script>
const host = document.querySelector('#host');
const shadowRoot = host.attachShadow({'mode': 'open'});
const slot = document.createElement('slot');
shadowRoot.appendChild(slot);
host.appendChild(document.createElement('div'));
document.body.offsetLeft;
host.appendChild(document.createTextNode('hello'));
document.body.offsetLeft;
</script>