host-not-001.html (942B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>:host combined with :not</title> 4 <link rel="help" href="https://drafts.csswg.org/selectors/#featureless"> 5 <link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html"> 6 <p>Test passes if there is a filled green square.</p> 7 <div id=host> 8 </div> 9 <script> 10 host.attachShadow({mode: "open"}).innerHTML = ` 11 <style> 12 :host { 13 width: 100px; 14 height: 100px; 15 background-color: green; 16 } 17 div:host { 18 background-color: red; 19 } 20 :not(div):host { 21 background-color: red; 22 } 23 :host:not(div) { 24 background-color: red; 25 } 26 :host:is(div) { 27 background-color: red; 28 } 29 :is(div):host { 30 background-color: red; 31 } 32 :host:not(:hover) { 33 background-color: red; 34 } 35 :host:not(:defined) { 36 background-color: red; 37 } 38 </style> 39 `; 40 41 </script>