highlight-painting-shadows-horizontal.html (1377B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>CSS Pseudo-Elements Test: Shadows on highlights horizontal text</title> 4 <link rel="author" name="Stephen Chenney" href="mailto:schenney@igalia.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#highlight-painting"> 6 <link rel="match" href="highlight-painting-shadows-horizontal-ref.html"> 7 <meta name="assert" value="::selection and ::target-text both with shadows are painted in the correct order, including originating element shadows"> 8 <meta name="fuzzy" content="0-32;0-20"> 9 <script src="support/selections.js"></script> 10 <style> 11 :root { 12 line-height: 1; 13 white-space: pre; 14 } 15 p { 16 font-size: 2em; 17 color: black; 18 text-shadow: 0.1em 0.1em rgba(0,0,0,0.5); 19 position: absolute; 20 top: 10px; 21 left: 10px; 22 } 23 p::selection { 24 color: green; 25 text-shadow: -0.25em -0.25em rgba(0,128,0,0.5); 26 } 27 p::target-text { 28 color: blue; 29 text-shadow: 0.25em 0.25em rgba(0,0,128,0.5); 30 } 31 </style> 32 <p>partially selected target</p> 33 <script> 34 window.location.hash = "#:~:text=target"; 35 const target = document.querySelector("p"); 36 selectRangeWith(range => { 37 range.selectNodeContents(target); 38 range.setStart(target.childNodes[0], 4); 39 range.setEnd(target.childNodes[0], 21); 40 }); 41 </script>