serenity/Tests/LibWeb/Layout/input/shadow-tree-removed-from-dom-receives-event.html
Timothy Flynn 18a4455d43 LibWeb: Do not assume a shadow root has a host
After commit ff48b7333c, we remove shadow
roots from elements that are removed from the DOM. Setting a node's
shadow root to null also sets that shadow root's host to null. Thus, the
comment in Node::is_shadow_including_descendant_of that assumes the host
is always non-null is not true.

The test added here would previously crash when interacting with a node
that is a descendant of a removed shadow root.
2023-12-04 01:33:57 +01:00

15 lines
341 B
HTML

<div id=container>
<details open>
<summary>summary</summary>
<span id=node></span>
</details>
</div>
<script type="text/javascript">
let node = document.getElementById("node");
let container = document.getElementById("container");
container.innerHTML = "<span>Pass!</span>";
node.click();
</script>