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•5 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•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
It looks like we don't handle focus navigation with unassigned slot well.
Assignee | ||
Comment 3•5 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•5 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•5 years ago
|
||
Assignee | ||
Comment 6•5 years ago
|
||
The nodes under slot scope is already being traversed in GetNextTabbableContentIn*Scope.
Assignee | ||
Comment 7•5 years ago
|
||
Slot element could be also focusable.
Assignee | ||
Comment 8•5 years ago
|
||
Pushed by echen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/12ffc4e92ff6 Part 1: Some minor nsFocusManager cleanup; r=smaug https://hg.mozilla.org/integration/autoland/rev/48f01f2f5573 Part 2: Skip the node under slot scope in frame traversal; r=smaug https://hg.mozilla.org/integration/autoland/rev/4e227c741b4b Part 3: nsFocusManager::GetNextTabbableContentInScope should also check slot if aSkipOwner is false; r=smaug
Comment 10•5 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•5 years ago
|
Comment 11•5 years ago
|
||
https://hg.mozilla.org/projects/cedar/rev/12ffc4e92ff6a552e36d5367abe11f79f458bdb8 Bug 1519090 - Part 1: Some minor nsFocusManager cleanup; r=smaug https://hg.mozilla.org/projects/cedar/rev/48f01f2f5573921e1f02617ebc9c5426eaef9973 Bug 1519090 - Part 2: Skip the node under slot scope in frame traversal; r=smaug https://hg.mozilla.org/projects/cedar/rev/4e227c741b4bb4ebb15d869a02acb83c1a656a54 Bug 1519090 - Part 3: nsFocusManager::GetNextTabbableContentInScope should also check slot if aSkipOwner is false; r=smaug
Comment 12•5 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•5 years ago
|
Description
•