visited-in-visited-compound.html (865B)
1 <!DOCTYPE html> 2 <title>Behavior of :visited with a compound subject selector</title> 3 <!-- 4 Note: this test is intentionally not specific about the exact expected 5 result, since the exact behavior is not specified well at the moment. 6 As long as a#inner and #inner (see -ref.html) behaves the same way 7 for the same DOM, we consider that a pass. 8 --> 9 <link rel="help" href="https://drafts.csswg.org/selectors/#visited-pseudo"> 10 <link rel="match" href="visited-in-visited-compound-ref.html"> 11 <style> 12 :visited > a#inner { color: red; } 13 </style> 14 <a href="" id=outer>Visited1</a> 15 <script> 16 window.onload = () => { 17 // Use script, since the parser can't produce this. 18 let inner = document.createElement('a'); 19 inner.setAttribute('href', ''); 20 inner.setAttribute('id', 'inner'); 21 inner.textContent = 'Visited2'; 22 outer.append(inner); 23 } 24 </script>