[Webkit-unassigned] [Bug 22261] Clicking on a non-text input element does not give it focus

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jun 13 02:46:50 PDT 2021


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

David Scourfield <bugzilla at dai.codes> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at dai.codes

--- Comment #74 from David Scourfield <bugzilla at dai.codes> ---
(In reply to Darin Adler from comment #73)

> Perhaps in the end the Safari will be *forced* to do this, because we simply can’t resist the tide of all those website developers who are relying on this aspect of how Windows works

[The HTML spec](https://html.spec.whatwg.org/multipage/interaction.html) actually calls out that:

> the user agent might determine that an element is not click focusable even if it is focusable. For example, in some user agents, clicking on a non-editable form control does not focus it, i.e. the user agent has determined that such controls are not click focusable

So the behaviour of Safari on Mac in this case is perfectly fine, and standards-compliant.

However, the spec also states that:

> User agents should consider focusable areas with non-null tabindex values to be click focusable.

Which I interpret as if a button has `tabindex="0"` (or a positive integer) then it should always be focused after being clicked.  Currently Safari will treat buttons with non-null tabindex values just the same as buttons with null tabindex values, so this is a bug as it's a violation of the HTML spec.

IMO making buttons click focusable if they have a non-null tabindex value is an excellent compromise; it allows the user agent to behave in the system-default way for most situations whilst giving authors the ability to explicitly instruct the user agent that they require a particular button to be focused when clicked.

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


More information about the webkit-unassigned mailing list