keyboard focus is trapped inside <slot>
Categories
(Core :: DOM: Core & HTML, defect, P2)
Tracking
()
People
(Reporter: cronon12, Assigned: edgar)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 OPR/57.0.3098.106
Steps to reproduce:
Version: 64.0
Build ID: 20181207224003
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0
- Open https://codepen.io/anon/pen/XoPORj
- Click on white space
- Press tab key few times
Actual results:
Focus starts moving only between buttons inside the <slot> tag.
Expected results:
Focus should go through both "inside" and "outside" buttons
Comment 1•6 years ago
|
||
This issue occurs as described on Windows, Mac OS and Ubuntu on all three main versions of Firefox.
Component chosen is Keyboard Navigation.
Thank you for your contribution!
Updated•6 years ago
|
| Assignee | ||
Comment 2•6 years ago
|
||
It looks like we don't handle focus navigation with unassigned slot well.
| Assignee | ||
Comment 3•6 years ago
|
||
(In reply to cronon12 from comment #0)
Focus starts moving only between buttons inside the <slot> tag.
It is because the FindOwner [1] call of "inside" button returns <slot>, and then GetNextTabbableContentInAncestorScopes redirects startContent to <slot> given that it could not find next tabbable content, then the following frame/tree traversa [3]l starts from <slot> and stop at the first "inside" button again.
The owner of "inside" button should not be the <slot> and we should not run GetNextTabbableContentInAncestorScopes either since there is no shadow dom involved at all...
[1] https://searchfox.org/mozilla-central/rev/b29663c6c9c61b0bf29e8add490cbd6bad293a67/dom/base/nsFocusManager.cpp#2952
[2] https://searchfox.org/mozilla-central/rev/b29663c6c9c61b0bf29e8add490cbd6bad293a67/dom/base/nsFocusManager.cpp#3211
[3] https://searchfox.org/mozilla-central/rev/b29663c6c9c61b0bf29e8add490cbd6bad293a67/dom/base/nsFocusManager.cpp#3233-3267
| Assignee | ||
Comment 4•6 years ago
|
||
(In reply to Edgar Chen [:edgar] from comment #3)
The owner of "inside" button should not be the <slot> and we should not run GetNextTabbableContentInAncestorScopes either since there is no shadow dom involved at all...
I was wrong, per spec, slot element is a also a scope owner even if it is not in shadow dom or has no assigned nods. So the issue here is that in some cases we only check shadow host, but we should also check slot as well.
| Assignee | ||
Comment 5•6 years ago
|
||
| Assignee | ||
Comment 6•6 years ago
|
||
| Assignee | ||
Comment 7•6 years ago
|
||
| Assignee | ||
Comment 8•6 years ago
|
||
Comment 10•6 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/12ffc4e92ff6
https://hg.mozilla.org/mozilla-central/rev/48f01f2f5573
https://hg.mozilla.org/mozilla-central/rev/4e227c741b4b
Updated•6 years ago
|
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
This issue is now verified in Nightly v66.0a1 from 2019-01-23 on Windows 10, Ubuntu 16 and Mac OS 10.14.2.
Thanks!
Updated•6 years ago
|
Description
•