| <body> | |
| This test passes if it doesn't crash. | |
| <host-element id=host> | |
| <template shadowrootmode=open></template> | |
| </host-element> | |
| <script> | |
| window.testRunner?.dumpAsText(); | |
| const css = new CSSStyleSheet(); | |
| css.replaceSync("* { :has(.foo) { color: green; } }"); | |
| document.adoptedStyleSheets.push(css); | |
| host.shadowRoot.adoptedStyleSheets.push(css); | |
| document.body.offsetWidth; | |
| const div = document.createElement("div"); | |
| div.classList.add("foo"); | |
| document.body.appendChild(div); | |
| </script> |