custom-highlight-painting-017.html (938B)
1 <!DOCTYPE html> 2 <meta charset="utf-8" /> 3 <title>CSS Highlight API Test: ::highlight color with transparent originating color</title> 4 <link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-highlight-api-1/#custom-highlight-pseudo"> 6 <link rel="help" href="https://crbug.com/1273943"> 7 <meta name="assert" content="This test checks that ::highlight pseudo-element uses the specified color even when the originating element text color was trasnparent."> 8 <link rel="match" href="/css/reference/pass_if_pass_below.html"> 9 <style> 10 div { 11 color: transparent; 12 } 13 ::highlight(example-highlight) { 14 color: black; 15 } 16 </style> 17 18 <p>Test passes if there is the word "PASS" below.</p> 19 <div id="target">PASS</div> 20 21 <script> 22 let r = new Range(); 23 r.setStart(target, 0); 24 r.setEnd(target, 1); 25 26 CSS.highlights.set("example-highlight", new Highlight(r)); 27 </script>