selection-link-003.html (951B)
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 both unvisited and visited links have pseudo style."> 7 <link rel="match" href="selection-link-003-ref.html"> 8 <script src="support/selections.js"></script> 9 <style> 10 a { 11 text-decoration: none; 12 color: black; 13 } 14 a:visited::selection { 15 color: green; 16 } 17 a:link::selection { 18 color: green; 19 } 20 </style> 21 22 <p>Test passes if when selecting the content both "visited" and "unvisited" have a green color and white background.</p> 23 <main> 24 <a href="">visited</a> 25 <a href="#">unvisited</a> 26 </main> 27 28 <script>selectNodeContents(document.querySelector("main"));</script>