WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
139945
Mouse/Touch Events Can Focus Parent Element
https://bugs.webkit.org/show_bug.cgi?id=139945
Summary
Mouse/Touch Events Can Focus Parent Element
Rodney Rehm
Reported
2014-12-25 09:34:11 PST
Created
attachment 243744
[details]
reduced test case reduced test case:
http://medialize.github.io/ally.js/tests/browser-bugs/webkit-pointer-focus-parent.html
Clicking on an <a> element nested in a <div tabindex="-1"> will cause the <div> to receive focus. If anything should receive focus, it should be the <a> element. This behavior can be observed for mousedown and touchstart. A way to circumvent this behavior is upon mousedown removing all parental tabindex attributes, so once the mousedown handler finished the only naturally focusable element remaining is the element actually clicked upon. On mouseup the tabindex attributes must be restored. The same applies to touchstart and touchend/touchcancel.
Attachments
reduced test case
(790 bytes, text/html)
2014-12-25 09:34 PST
,
Rodney Rehm
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Ahmad Saleem
Comment 1
2022-08-29 14:56:28 PDT
I am able to reproduce this bug in Safari Technology Preview 152 using attached reduction and clicking on first case where <a> with tab index = 1, it leads to <div> having focus and the 'red' outline is extended to whole visual viewport while in case of other browsers, it is limited to similar to other case, where tab index is negative 1 and just limit to <a> text. All other browsers (Chrome Canary 107 and Firefox Nightly 106) work similar in both cases and match each other. Thanks!
Ahmad Saleem
Comment 2
2024-06-30 15:37:34 PDT
Safari Technology Preview 197 now matches Chrome Canary 128 and Firefox Nightly 128. Marking this as 'RESOLVED CONFIGURATION CHANGED'.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug