custom-highlight-painting-021.html (858B)
1 <!DOCTYPE html> 2 <meta charset="UTF-8"> 3 <title>CSS Highlight API Test: Highlighting thick text</title> 4 <link rel="author" title="Stephen Chenney" href="mailto:schenney@igalia.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#highlight-text"> 6 <link rel="match" href="custom-highlight-painting-021-ref.html"> 7 <meta name="assert" value="Text with -webkit-text-stroke-width should not be highlighted."> 8 <meta name="fuzzy" content="0-128;0-4"> 9 <style> 10 body { 11 -webkit-text-stroke-width: 3px; 12 font-size: 25px; 13 } 14 ::highlight(foo) { 15 background-color: green; 16 } 17 </style> 18 <body>This thick text should not be highlighted</body> 19 <script> 20 let textNode = document.body.firstChild; 21 22 let r1 = new Range(); 23 r1.setStart(textNode, 4); 24 r1.setEnd(textNode, 16); 25 26 let h1 = new Highlight(r1); 27 28 CSS.highlights.set("foo", h1); 29 </script>