Status: FAIL | Duration: 11ms | Subtests: 0/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi
/css/selectors/focus-within-shadow-006.html
<!DOCTYPE html> <html class="reftest-wait"> <meta charset="utf-8"> <title>Selectors Level 4: focus-within with shadow DOM</title> <link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> <link rel="help" href="https://drafts.csswg.org/selectors-4/#focus-within-pseudo"> <link rel="help" href="https://dom.spec.whatwg.org/#shadow-trees"> <link rel="match" href="focus-within-shadow-001-ref.html"> <meta name="flags" content="dom"> <meta name="assert" content="Checks that ':focus-within' is propagated to the flat tree ancestors, even if it comes from a slotted element."> <style> /* Suppress things that cannot be reproduced in the reference file */ :focus { outline: none; } :focus-within { border-color: green; } </style> <p>Test passes if there is a green rectangle below.</p> <div id="log"></div> <script> if (!document.body.attachShadow) document.getElementById("log").innerHTML = "<strong>Skip this test, shadow DOM is not supported.</strong>"; </script> <div id="shadow-host"> <div id="focusme" tabindex="1"></div> </div> <script> var shadowHost = document.getElementById("shadow-host"); shadowHost.attachShadow({ mode: "open"}).innerHTML = "<style>" + " #shadow-div:focus-within { border: solid 15px green; }" + "</style>" + "<div id='shadow-div'>" + " <slot></slot>" + "</div>"; var focusme = document.getElementById("focusme"); focusme.focus(); document.documentElement.classList.remove("reftest-wait"); </script> </html>
/css/selectors/focus-within-shadow-001-ref.html
<!DOCTYPE html> <html lang=en> <meta charset="utf-8"> <title>Selectors Level 4: focus-within shadow DOM Reference File</title> <link rel="author" title="Keyong Li" href="mailto:kli79@bloomberg.net"> <link rel="author" title="Florian Rivoal" href="mailto:florian@rivoal.net"> <style> div { border: solid 15px green; } </style> <p>Test passes if there is a green rectangle below.</p> <div></div> </html>