focus-pseudo-on-shadow-host-3.html (917B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> 5 <meta name="assert" content=":focus should not match a shadow host if the focused element is a slotted content"> 6 <link rel="help" href="https://html.spec.whatwg.org/#element-has-the-focus"> 7 <link rel="help=" href="https://bugs.webkit.org/show_bug.cgi?id=202432"> 8 <link rel="match" href="/css/reference/ref-filled-green-100px-square.xht"> 9 </head> 10 <body> 11 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 12 <div id="host"><div id="target" tabindex="0"></div></div> 13 <style> 14 #host { background: green; width: 100px; height: 100px; } 15 #host:focus #target { background: red; width: 100px; height: 100px; } 16 #target { outline: none; } 17 </style> 18 <script> 19 20 const shadowRoot = host.attachShadow({mode: 'closed'}); 21 shadowRoot.innerHTML = '<slot></slot>'; 22 target.focus(); 23 24 </script> 25 </body> 26 </html>