Re: [csswg-drafts] [selectors] :focus-visible and Shadow DOM (#5893)

> FWIW, it would be problematic for :focus-visible to become a way of detecting whether there is a shadow root or not.

Do you mean that you could know or not if an element is a shadow root by focusing it via script (`host.focus()`) and then checking it matches `:focus` but not `:focus-visible`?

I believe in WebKit you can do something similar already, as elements with `:focus` have an outline, you could do `host.focus()` and then check that `host` actually matches `:focus` but the `outline-style` is `none`. It would be a way to detect the same thing form a script somehow (e.g. https://cdpn.io/mrego/debug/WNorXNv/bZAQWKNVvEyM).


-- 
GitHub Notification of comment by mrego
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5893#issuecomment-773824183 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 5 February 2021 06:30:25 UTC