custom-highlight-painting-016.html (906B)
1 <!DOCTYPE html> 2 <meta charset="UTF-8"> 3 <title>CSS Highlight API Test: Painting</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="Highlighted elements must be correctly painted and there should be no caching that doesn't take highlight names into account"> 7 <style> 8 #affected::highlight(foo) { 9 background-color: yellow; 10 color: blue; 11 } 12 </style> 13 <body><span></span><span id="affected">One </span><span id="affected">two </span><span>three…</span> 14 <script> 15 // The first <span> style resolution shouldn't cause caching an empty set of matched properties that could be used with the spans that should be highlighted later. 16 const node = document.body; 17 let r = new Range(); 18 r.setStart(node, 1); 19 r.setEnd(node, 3); 20 CSS.highlights.set("foo", new Highlight(r)); 21 </script>