Re: [csswg-drafts] [selectors] :focus-visible matches on initial programmatic focus (#5885)

Firefox implement the heuristics in the first comment as [it passes `focus-visible-{014,015,016}.html` tests](https://wpt.fyi/results/css/selectors?label=master&label=experimental&aligned&q=focus-visible).

I believe I'm aligned with @emilio, I don't really care if this is just after page load, or after the user has interacted with the website. In my mind, if nothing is focused (there's no active element), and a script focus something, it's good to match `:focus-visible`. 

So maybe the 2 heuristics in the spec could be reworded in just one, something like:
> If the active element does not match :focus-visible (or there is no active element), and a script causes focus to move elsewhere, the newly focused element should match :focus-visible.


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


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

Received on Monday, 25 January 2021 16:54:36 UTC