custom-highlight-painting-020-ref.html (591B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>CSS Highlight API Test: Highlighing Ligatures Ref</title> 4 <style> 5 @font-face { 6 font-family: 'mplus'; 7 src: url('../../../fonts/mplus-1p-regular.woff'); 8 } 9 div { 10 font-size: 7em; 11 font-family: mplus, sans-serif; 12 } 13 ::selection { 14 color:green; 15 text-decoration: blue 2px line-through; 16 } 17 </style> 18 <body><div>fii ffi fff</div> 19 <script> 20 let textNode = document.body.firstChild.firstChild; 21 22 let r1 = new Range(); 23 r1.setStart(textNode, 1); 24 r1.setEnd(textNode, 9); 25 window.getSelection().addRange(r1); 26 </script>