custom-highlight-painting-015.html (790B)
1 <!DOCTYPE html> 2 <meta charset="UTF-8"> 3 <title>CSS Highlight API Test: </title> 4 <link rel="help" href="https://drafts.csswg.org/css-highlight-api-1/"> 5 <link rel="match" href="custom-highlight-painting-001-ref.html"> 6 <meta name="assert" value="Unregistering only once a Highlight that was registered under different names works as it should and is still being painted."> 7 <style> 8 ::highlight(foo) { 9 color: red; 10 } 11 ::highlight(bar) { 12 color: blue; 13 background-color: yellow; 14 } 15 </style> 16 <body><span>One </span><span>two </span><span>three…</span> 17 <script> 18 let r = new Range(); 19 r.setStart(document.body, 0); 20 r.setEnd(document.body, 2); 21 22 let h = new Highlight(r); 23 24 CSS.highlights.set("foo", h); 25 CSS.highlights.set("bar", h); 26 CSS.highlights.delete("foo"); 27 </script>