Closed
Bug 1500273
Opened 6 years ago
Closed 6 years ago
Shift-Tab does not take the focus back to input inside Shadow DOM
Categories
(Core :: DOM: Core & HTML, defect, P3)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla66
People
(Reporter: timdream, Assigned: edgar)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
771 bytes,
text/html
|
Details | |
1004 bytes,
text/html
|
Details | |
47 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
STR:
See test case, which creates a DOM like
<body>
<input> #1
<span tabIndex="0"> #2
shadowRoot
<input> #3
<input> #4
<input> #5
<input> #6
Expected
1. Focus on #1 and press tab will take focus from #1 to #6
2. Focus on #6 and press Shift+Tab will take focus backward from #6 to #1
Actual
1. as expected
2. focus jumps from #6 to #1
Note
This is not what I saw in https://bugzilla.mozilla.org/show_bug.cgi?id=1496242#c3 . I am not sure if they are related.
Reporter | ||
Comment 1•6 years ago
|
||
This one does what's expected:
<body>
<input> #1
<span tabIndex="0"> #2
shadowRoot
<span tabIndex="0"> #3
<span tabIndex="0"> #4
<span tabIndex="0"> #5
<input> #6
Updated•6 years ago
|
Priority: -- → P3
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → echen
Assignee | ||
Comment 2•6 years ago
|
||
Assignee | ||
Comment 3•6 years ago
|
||
Assignee | ||
Comment 4•6 years ago
|
||
When entering into a Shadow DOM in backward navigation, we set currentContent to the top-level host [1] but the frame still points to the last frame in Shadow DOM which could be a non-focusable frame. So we skip Shadow DOM and also the host in this case [2].
[1] https://searchfox.org/mozilla-central/rev/69f9d5002c6e3c5c571a348916fb174e6a7b4acd/dom/base/nsFocusManager.cpp#3308
[2] https://searchfox.org/mozilla-central/rev/69f9d5002c6e3c5c571a348916fb174e6a7b4acd/dom/base/nsFocusManager.cpp#3387-3394
Assignee | ||
Comment 5•6 years ago
|
||
When entering into a Shadow DOM in backward navigation, the frame still points
to the last frame in Shadow DOM which could be a non-focusable frame, so move
the handling of backward navigation for Shadow DOM upward.
Assignee | ||
Comment 6•6 years ago
|
||
Pushed by echen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c93e450706ae
Ensure backward focus navigation works in Shadow DOM; r=smaug
Comment 8•6 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox66:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
Updated•6 years ago
|
status-firefox65:
--- → ?
Comment 9•6 years ago
|
||
Is there a user impact here which justifies backport consideration or can this ride the trains?
Flags: needinfo?(echen)
Flags: in-testsuite+
Assignee | ||
Comment 10•6 years ago
|
||
Comment on attachment 9030241 [details]
Bug 1500273 - Ensure backward focus navigation works in Shadow DOM;
[Beta/Release Uplift Approval Request]
Feature/Bug causing the regression: Not a regression
User impact if declined: Focus backward navigation doesn't work as expected with Shadow DOM in certain cases.
Is this code covered by automated tests?: Yes
Has the fix been verified in Nightly?: Yes
Needs manual test from QE?: No
If yes, steps to reproduce:
List of other uplifts needed: None
Risk to taking this patch: Low
Why is the change risky/not risky? (and alternatives if risky): The change isn't complicated and only affects Shadow DOM case.
String changes made/needed: None
Flags: needinfo?(echen)
Attachment #9030241 -
Flags: approval-mozilla-beta?
Comment 11•6 years ago
|
||
Comment on attachment 9030241 [details]
Bug 1500273 - Ensure backward focus navigation works in Shadow DOM;
[Triage Comment]
Fixes broken focus backward navigation with Shadow DOM in certain cases. Approved for 65.0b6.
Attachment #9030241 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Comment 12•6 years ago
|
||
bugherder uplift |
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•