host-context-specificity-003.html (605B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>CSS Test: the :host-context() selector affects specificity</title> 4 <link rel="help" href="https://drafts.csswg.org/css-scoping/#host-selector"> 5 <link rel="match" href="reference/green-box.html"> 6 <p>Test passes if you see a single 100px by 100px green box below.</p> 7 <div id="host"></div> 8 <script> 9 host.attachShadow({ mode: 'open' }).innerHTML = ` 10 <style> 11 :host-context(*) div { 12 width: 100px; 13 height: 100px; 14 background: green; 15 } 16 div { 17 background: red; 18 } 19 </style> 20 <div></div> 21 `; 22 </script>