highlight-paired-cascade-005.html (1441B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>CSS Pseudo-Elements Test: paired cascade: UA default highlight colors are not used when highlight pseudo has declared color value of unset</title> 4 <link rel="author" name="Delan Azabani" href="mailto:dazabani@igalia.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#highlight-cascade"> 6 <link rel="match" href="highlight-paired-cascade-005-ref.html"> 7 <meta name="assert" value="This test verifies that setting color to unset on ::selection suppresses any UA non-initial used value for background-color. The unset value is defined as both “treated as [inherit or initial depending on whether the property is inherited]” and “effectively erases all declared values occurring earlier in the cascade [(inclusive)]”, which are normally equivalent, but under paired cascade, the former wins."> 8 <script src="support/selections.js"></script> 9 <link rel="stylesheet" href="../support/highlights.css"> 10 <style> 11 main { 12 font-size: 7em; 13 margin: 0.5em; 14 } 15 main::selection { 16 /* 17 Used background-color should be initial (transparent). 18 https://www.w3.org/TR/CSS21/colors.html#propdef-background-color 19 */ 20 color: unset; 21 } 22 </style> 23 <p>Test passes if the text below does not appear to be highlighted. 24 <main class="highlight_reftest">quick</main> 25 <script>selectNodeContents(document.querySelector("main"));</script>