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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 4 13:46:30 PDT 2021


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

Ryosuke Niwa <rniwa at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cfleizach at apple.com,
                   |                            |jcraig at apple.com,
                   |                            |mjs at apple.com

--- Comment #5 from Ryosuke Niwa <rniwa at webkit.org> ---
(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.

> > > Then if you type a letter or ENTER or some other key, you start matching
> > > :focus-visible.
> > > However if you just do "Ctrl + +" to zoom the page, you don't start matching
> > > :focus-visible.
> > 
> > I really don't understand where this rule comes from.
> 
> I guess this is to allow users know where the focus is by typing some key.

I don't think detecting Control key like described in https://bugs.webkit.org/show_bug.cgi?id=225148#c0 makes a whole lot of sense.

What makes more sense to me is deciding it based on whether some event handler or the default event handler did something in response to a key event or not. Namely, EventHandler::internalKeyEvent returned true.

-- 
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/20210504/9638f280/attachment.htm>


More information about the webkit-unassigned mailing list