W3C home > Mailing lists > Public > public-css-archive@w3.org > January 2021

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

From: Manuel Rego Casasnovas via GitHub <sysbot+gh@w3.org>
Date: Mon, 25 Jan 2021 16:54:34 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-766955824-1611593673-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:25 UTC