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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 4 21:52:02 PDT 2021


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

--- Comment #6 from Manuel Rego Casasnovas <rego at igalia.com> ---
(In reply to Ryosuke Niwa from comment #5)
> (In reply to Manuel Rego Casasnovas from comment #4)
> > https://bugs.webkit.org/show_bug.cgi?id=225148(In reply to Ryosuke Niwa from
> > comment #3)
> > > (In reply to Manuel Rego Casasnovas from comment #0)
> > > > Created attachment 427251 [details]
> > > > Example
> > > > 
> > > > This comes from a discussion in a different bug:
> > > > https://bugs.webkit.org/show_bug.cgi?id=225075
> > > >
> > > > The usual example for this case is a DIV with tabindex, so it can be focused.
> > > > You click on the DIV and initially you don't match :focus-visible.
> > > 
> > > That doesn't match what we do today. We show the focus ring immediately when
> > > the user clicks on a focusable element.
> > 
> > That's the main thing :focus-visible wants to address.
> > 
> > As all browsers were showing a focus ring just after a click on a DIV with
> > tabindex, people started to add rules like ":focus { outline: none; }". But
> > these rules are very bad from an a11y point of view, as when users use
> > keyboard navigation to focus that DIV, they won't get any focus ring either.
> >
> > With :focus-visible you'll only see the focus ring when it's actually useful
> > (keyboard navigation) and people won't need to use things like ":focus  {
> > outline: none; }".
> 
> Are you saying that the intent is to not show the focus ring when the user
> clicks on an element with tabindex? I don't think we want to do that.

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.

If WebKit wants to always show a focus ring when a DIV with tabindex is focused via mouse click, then authors are going to start doing:
    :focus-visible {
        outline: none;
    }
And that would disable it also for keyboard users which is bad for accessibility.

-- 
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/d2e53284/attachment.htm>


More information about the webkit-unassigned mailing list