Using overflow:auto|scroll and display:grid|flex creates a “focus trap” within shadow DOM
Categories
(Core :: DOM: Core & HTML, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox75 | --- | fixed |
People
(Reporter: abruere, Assigned: edgar)
References
(Blocks 3 open bugs)
Details
(Keywords: access)
Attachments
(4 files, 1 obsolete file)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0
Steps to reproduce:
[Affected versions]:
Latest Firefox Nightly 73.0a1 (Build ID: 20191215094838, UA: Mozilla/5.0 (X11; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0)
Firefox 70.0.1 (Build ID: 20191031062442, UA: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0)
Firefox 64 (Build ID: 20181206201918, UA: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0)
[Affected Platforms]:
All (reproduced on Linux x64 and Windows 10 x64)
[Prerequisites]:
None
[Steps to reproduce]:
1. Focus the input in shadow root (either with display:grid or flex in attached HTML).
2. Press Tab to move focus to the button in same shadow root
3. Press Tab again
Attached an HTML snippet to reproduce the issue. Here is also a JSFiddle: https://jsfiddle.net/abruere/oe3dfv70/
Actual results:
Focus moves out of the shadow root to next input in Light DOM (see last example with display: block).
Expected results:
Focus moves back to the input in the same shadow root.
[Additional details]:
The loosely related bug 1507101 might help to pin down the cause.
Intermittent focus-within-shadow test failure bug 1444671 could be related as well.
Found this bug while digging into bug 1597993.
Reporter | ||
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
It looks like a long-standing issue. I will take a look.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
See https://bugzilla.mozilla.org/show_bug.cgi?id=1607223#c1 for the details.
Updated•5 years ago
|
Comment 3•5 years ago
|
||
Comment on attachment 9118988 [details]
Bug 1604140 - Part 4: Avoid performing check of next tabbable content on the first element of shadow dom duplicatedly;
Revision D58876 was moved to bug 1607223. Setting attachment 9118988 [details] to obsolete.
Assignee | ||
Comment 4•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 5•5 years ago
|
||
The original check, currentContent != startContent
, is to skip the element we started on in frame traversal.
This would happen for instance on a scrollable element, where frame traversal could return the element again.
However, in shadow dom case, the frame traversal may start on a redirected shadow host, where startContent
is still the original start element.
Assignee | ||
Comment 6•5 years ago
|
||
Assignee | ||
Comment 7•5 years ago
|
||
Assignee | ||
Comment 8•5 years ago
|
||
Updated•5 years ago
|
Comment 12•5 years ago
|
||
Backed out for multiple failures
backout: https://hg.mozilla.org/integration/autoland/rev/196df09edf62fa8d154b7bf3c3cdc7f9733bc390
failure logs examples:
- dom/tests/mochitest/chrome/test_focus_dialog.xhtml | application timed out after 370 seconds with no output with log https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=288671660&repo=autoland&lineNumber=53529 - r/b on push: https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&searchStr=mochitest-chrome&tochange=f62d325fc393e86e12ceae55906b8c540a4dca03&fromchange=283906e4aee226cfd1cf0fc7e37340075aad9482&selectedJob=288671660
- browser_unknownContentType_dialog_layout.js | application timed out after 370 seconds with no output with log https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=288671670&repo=autoland&lineNumber=24697
- https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=288671664&repo=autoland&lineNumber=10689
Assignee | ||
Comment 14•5 years ago
|
||
Hmm, look like some thing related bug 1614224? I will rebase patches and test again.
Assignee | ||
Comment 15•5 years ago
|
||
Comment 16•5 years ago
|
||
Comment 18•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/241851c7036f
https://hg.mozilla.org/mozilla-central/rev/0af4f0491ba3
https://hg.mozilla.org/mozilla-central/rev/7b1f14ca66b9
Description
•