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: Alice via GitHub <sysbot+gh@w3.org>
Date: Sun, 24 Jan 2021 22:29:00 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-766450776-1611527339-sysbot+gh@w3.org>
Hm, what happens in the second case after a `blur()`? The code above is still directly after page load, it's just longer after a page load. 

https://codepen.io/sundress/pen/WNGqobM tests the same thing, but after a user has interacted with the page, blurring the previously active element before the delay. In my testing, Chrome "remembers" the previous value for `:focus-visible` (i.e. matches when the "Press this button" button was pressed using the keyboard, doesn't match when it was pressed using a mouse). The same behaviour happens without the delay as well.

It seems that Firefox has not (yet?) implemented this suggested heuristic: "If the active element matches :focus-visible, and a script causes focus to move elsewhere, the newly focused element should match :focus-visible."

What do you think the behaviour should be for this case?

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

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Sunday, 24 January 2021 22:29:04 UTC

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