Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-highlight-api/Highlight-invalid-static-range-crash.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<body onload="boom()">
<p id="A"></p>
<p id="B"></p>
</body>
<script>
function boom() {
let highlight0 = new Highlight();
let range = new StaticRange({
endContainer: document.getElementById("A"),
startOffset: 1,
startContainer: document.getElementById("B"),
endOffset: 1,
});
CSS.highlights.set("highlight0", highlight0);
document.getElementById("A").remove();
highlight0.add(range);
}
</script>