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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 5 13:08:15 PDT 2021


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

--- Comment #18 from Ryosuke Niwa <rniwa at webkit.org> ---
(In reply to Rob Dodson from comment #16)
>
> The spec attempts to explain that :focus-visible should not match when you
> mouse click an element with a tabindex, but does so in a way that maybe
> isn't explicit enough. Quoting from the spec:

That is a rather consequential change. It's not really about adding a new CSS selector but rather affecting when a focus ring will be shown. It needs to be discussed separately from whether to add this CSS selector or not.

> > If the element which supports keyboard input (such as an input element, or any other element that would triggers a virtual keyboard to be shown on focus if a physical keyboard were not present), indicate focus.
> This attempts to highlight the concept of "supporting keyboard input".
> Notably a div with a tabindex would not meet this criteria.

This is a non-normative example. It has no bearing on what we implement.

> > If the user interacts with the page via a pointing device (mouse, touchscreen, etc.) and the focused element does not support keyboard input, don’t indicate focus.
> The key phrasing here is "and the focused element does not support keyboard
> input". Since a div with a tabindex does not support keyboard input then it
> should not match :focus-visible when mouse-clicked. If, however, someone
> were to add contenteditable to the div, then it would meet the criteria and
> :focus-visible would match.

Ditto.

> > We should try to show it right away in places we believe will receive typing, even if the user clicked to focus it in the first place.
> 
> I think(?) we all agree that if you're clicking on a control that can
> receive text input, or an element with contenteditable, that we should show
> a ring. If that's not happening maybe it's a bug in the implementation or
> perhaps I'm missing something ��

The current implementation in Chrome and what's in WebKit's repository will show a focus ring when the user generates a non-control key keydown. We don't want to do that.

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


More information about the webkit-unassigned mailing list