css-highlight-painting-underline-offset-001.html (759B)
1 <!DOCTYPE html> 2 <html> 3 <meta charset="utf-8"> 4 <title>CSS Highlight API Test: ::highlight with text-underline-offset</title> 5 <link rel="help" href="https://drafts.csswg.org/css-highlight-api-1/"> 6 <link rel="match" href="css-highlight-painting-underline-offset-001-ref.html"> 7 <meta name="assert" content="Verify that text-underline-offset works in a ::highlight pseudo-element."> 8 <meta name="fuzzy" content="0-56;0-10"> 9 <style> 10 ::highlight(example) { 11 text-decoration: wavy underline green 5px; 12 text-underline-offset: 20px; 13 } 14 </style> 15 <p id="target">The underline should be offset.</p> 16 <script> 17 let range = new Range(); 18 range.setStart(target, 0); 19 range.setEnd(target, 1); 20 CSS.highlights.set(`example`, new Highlight(range)); 21 </script> 22 </html>