selection-link-002.html (922B)
1 <!DOCTYPE html> 2 <meta charset="utf-8" /> 3 <title>CSS Pseudo-Elements Test: ::selection on visited and unvisited links</title> 4 <link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-pseudo/#highlight-selectors"> 6 <meta name="assert" content="This test checks that ::selection works as expected when only unvisited links have pseudo style."> 7 <link rel="match" href="selection-link-002-ref.html"> 8 <script src="support/selections.js"></script> 9 <style> 10 a { 11 text-decoration: none; 12 color: black; 13 } 14 a:link::selection { 15 color: green; 16 } 17 </style> 18 19 <p>Test passes if when selecting the content "visited" is selected with the default colors and "unvisited" has a green color and white background.</p> 20 <main> 21 <a href="">visited</a> 22 <a href="#">unvisited</a> 23 </main> 24 25 <script>selectNodeContents(document.querySelector("main"));</script>