Highlight-invalid-static-range-crash.html (480B)
1 <!DOCTYPE html> 2 3 <body onload="boom()"> 4 <p id="A"></p> 5 <p id="B"></p> 6 </body> 7 8 <script> 9 function boom() { 10 let highlight0 = new Highlight(); 11 12 let range = new StaticRange({ 13 endContainer: document.getElementById("A"), 14 startOffset: 1, 15 startContainer: document.getElementById("B"), 16 endOffset: 1, 17 }); 18 CSS.highlights.set("highlight0", highlight0); 19 20 document.getElementById("A").remove(); 21 highlight0.add(range); 22 } 23 </script>