| <!DOCTYPE html> |
| <script src="../../../resources/js-test.js"></script> |
| <div id="host">Should be green</div> |
| <script> |
| description("Multiple :host(-context) pseudos in same compound."); |
| |
| host.attachShadow({mode: 'open'}); |
| |
| [ |
| ":host:host-context(body)", |
| ":host-context(:not(.nomatch)):host", |
| ":host:host:host", |
| ":host-context(body):host-context(html)", |
| ":host(:not(.nomatch)):host" |
| ].forEach((selector) => { |
| host.shadowRoot.innerHTML = "<style>" + selector + "{color:green}</style><slot/>"; |
| shouldBeEqualToString("getComputedStyle(host).color", "rgb(0, 128, 0)"); |
| |
| host.shadowRoot.innerHTML = "<style>" + selector + "::before" + "{color:green;content:'green'}</style><slot/>"; |
| shouldBeEqualToString("getComputedStyle(host, '::before').color", "rgb(0, 128, 0)"); |
| }); |
| |
| </script> |