[Webkit-unassigned] [Bug 225148] [selectors] :focus-visible and keyboard events

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 4 23:26:55 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=225148

--- Comment #7 from Maciej Stachowiak <mjs at apple.com> ---
> As I said, this is one of they key things behind :focus-visible, that when you click a DIV with tabindex you don't see a focus ring. Only when you use the keyboard to focus it, it shows it.

The spec for :focus-visible doesn't say anything about changing when the default focus ring appears. Rather, it's about giving authors a styling hook to style the focus ring only in exactly the cases where the browser would have drawn it by default.

Or, to quote the spec:

"While the :focus pseudo-class always matches the currently-focused element, UAs only sometimes visibly indicate focus (such as by drawing a “focus ring”), instead using a variety of heuristics to visibly indicate the focus only when it would be most helpful to the user. The :focus-visible pseudo-class matches a focused element in these situations only, allowing authors to change the appearance of the focus indicator without changing when a focus indicator appears."

<https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo>

Nowhere does the spec say anything about when UAs draw focus rings by default, or dictate a change to pre-existing behavior.

Note in particular that the heuristic for when to draw a focus ring on a focused element may be platform-specific and even browser-specific.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210505/3aaf82f6/attachment.htm>


More information about the webkit-unassigned mailing list