1
0
Fork 0
firefox/testing/web-platform/tests/shadow-dom/crashtests/highlight-api-remove-node-crash.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

18 lines
669 B
HTML

<!doctype html>
<title>Node in shadow tree highlighted with a Custom Highlight can be removed without crashing</title>
<meta name="author" title="Fernando Fiori" href="mailto:ffiori@microsoft.com">
<body>
<div id="host">
<template shadowrootmode=open>
<span>0123456789</span>
</template>
</div>
<script>
const shadowRoot = host.shadowRoot;
const spanInShadowDOM = shadowRoot.querySelector("span");
let range = new Range();
range.setStart(spanInShadowDOM.childNodes[0], 2);
range.setEnd(spanInShadowDOM.childNodes[0], 10);
CSS.highlights.set("example-highlight", new Highlight(range));
document.querySelector("body").removeChild(host);
</script>