highlight-paired-cascade-003.html (1430B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>CSS Pseudo-Elements Test: paired cascade: UA default highlight colors are used when highlight pseudo cascade yields only properties other than highlight colors</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-003-ref.html"> 7 <meta name="assert" value="This test verifies that setting text-decoration on ::selection does not suppress any UA non-initial used values for color or background-color. While the former is an applicable (shorthand) property for highlight styles, it is not one of the highlight colors (color or background-color), so paired cascade does not apply."> 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 values for color and background-color should be the 18 UA defaults, usually like black on blue or white on blue, 19 *not* initial on initial (like unhighlighted content). 20 */ 21 text-decoration: none; 22 } 23 </style> 24 <p>Test passes if the text below appears to be highlighted. 25 <main class="highlight_reftest">quick</main> 26 <script>selectNodeContents(document.querySelector("main"));</script>