Loss of focus when switching between settings categories from the keyboard
Categories
(Firefox :: Settings UI, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr128 | --- | unaffected |
| firefox-esr140 | --- | wontfix |
| firefox142 | --- | wontfix |
| firefox143 | --- | wontfix |
| firefox144 | --- | wontfix |
| firefox145 | --- | wontfix |
| firefox146 | --- | fixed |
People
(Reporter: lukasz.golonka, Assigned: tgiles)
References
(Regression)
Details
(Keywords: access, nightly-community, regression, Whiteboard: [recomp])
Attachments
(2 files)
|
4.11 KB,
patch
|
Details | Diff | Splinter Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
STR:
1 Open Firefox settings
2. Tab to the list of categories
3. Navigate with arrow keys to the "Home" category, notice that when categories are switched, focus remains on the list of categories
4. Press down arrow to move to the "Search" category
Actual behavior:
Focus lands on the document, rather than being still on the list of categories.
Expected behavior:
No focus loss.
Comment 1•7 months ago
|
||
Regression window:
https://hg-edge.mozilla.org/integration/autoland/pushloghtml?fromchange=cada12b663001136a23f97b26aa59701d8e520d6&tochange=03b4d5426f6b2e9ddfdcb7c27640a9509cda2c1b
Updated•7 months ago
|
Comment 2•7 months ago
|
||
:npypchenko, since you are the author of the regressor, bug 1956399, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
Updated•7 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
| Assignee | ||
Comment 3•7 months ago
|
||
I genuinely do not understand how Bug 1956399 is the regressor here, but I'm getting the exact same regression range posted by Alice in Comment #1. Based on some quick investigation, it seems there's something going on between the gotoPref call that happens at preferences.js:234 and the gotoPref call that happens onHashChange at preferences.js:273.
I'm making this assumption based on the following:
- I added logs and stack traces to the start of
gotoPref, directly loggingdocument.activeElementto determine when the focus seems to leave the richlistbox - I keyboard navigated from the "Home" button to the "Search" button in the richlistbox so that the logs would fire:
<richlistbox id="categories" data-l10n-id="category-list" data-l10n-attrs="aria-label" aria-label="Categories" allowevents="true" last-selected="category-search" keyboard-navigation="true">
preferences.js:281:20
gotoPref chrome://browser/content/preferences/preferences.js:277
init_all chrome://browser/content/preferences/preferences.js:234
_fireOnSelect chrome://global/content/elements/richlistbox.js:299
selectItem chrome://global/content/elements/richlistbox.js:440
moveByOffset chrome://global/content/elements/richlistbox.js:757
_moveByOffsetFromUserEvent chrome://global/content/elements/richlistbox.js:805
RichListBox chrome://global/content/elements/richlistbox.js:32
anonymous unknown:0
<html:body id="preferences-body" xmlns="http://www.mozilla.org/k…keeper/there.is.only.xul">
preferences.js:281:20
gotoPref chrome://browser/content/preferences/preferences.js:277
onHashChange chrome://browser/content/preferences/preferences.js:273
anonymous unknown:0
Something seems to be causing the focus to move to the document before the onHashChange function is called, but I'm not sure what...
Comment 4•6 months ago
|
||
This is an access s3 in that there is a workaround, but it is very annoying at best for keyboard users. In particular, less experienced keyboard or screen reader users might not know what has happened or how to deal with this situation. It is definitely a nasty papercut that a user will hit repeatedly.
| Assignee | ||
Comment 5•6 months ago
|
||
This will most likely be fixed by Bug 1867385 as that bug is for replacing the existing navigation sidebar with the page navigation reusable component.
Updated•6 months ago
|
| Assignee | ||
Updated•6 months ago
|
Updated•6 months ago
|
| Assignee | ||
Comment 6•6 months ago
|
||
:Jamie, :smaug, I'm hoping one or both of yall have some insight as to this issue at hand. I've noticed a few things that I can't really explain, again hoping that someone will have an explanation for what is happening here.
- For some reason, the
blurandfocusoutevents are fired when focusing the 'Search' category through keyboard navigation. I have no idea where these events are coming from and would appreciate some help in finding their source.- The
blurandfocusoutevents are not fired on any other category when using keyboard navigation - Additionally, the
keydownandkeyupevents are fired on all the other categories. Thekeyupevent never seems to be fired (but that's probably because the focus has moved to the body element and thus is being fired on that element instead of therichlistbox)
- The
- The culprit appears to be line 344 in preferences where document.location.hash is set to friendlyName
- If I comment out this line, then focus isn't stolen for some reason. Something is happening before onHashChange is called and I can't figure out where.
- I can't wrap my head around why changing the hash to
#searchis causing this focus issue and why it doesn't happen with any of the other categories.
Attached is my investigation patch for this issue if you want more context into what I've done so far. I thought the issue might have been in richlistbox, but that doesn't appear to be the case.
I'd appreciate any additional insights or steps to figure out what is going on here, thanks.
| Assignee | ||
Comment 7•6 months ago
|
||
Here's a link to a profile that reproduces the issue. There appears to be a pretty significant gap between the keydown event that selects the "Search" category and the keyup event that fires on the "preferences-body" element with no markers being generated. Seems like the majority of the time is spent in ZwUserMsgWaitForMultipleObjectsEx which seems normal. There's only one blur event being fired so I was looking into that but I can't figure out what is making that happen from the stack.
Comment 8•6 months ago
|
||
Changing #target does change focus in general.
https://searchfox.org/firefox-main/rev/d5770dd3a8e0c22c71c8b283831ff6f410d5ff05/docshell/base/nsDocShell.cpp#9348-9349
->
https://searchfox.org/firefox-main/rev/d5770dd3a8e0c22c71c8b283831ff6f410d5ff05/docshell/base/nsDocShell.cpp#11263,11339-11340
->
https://searchfox.org/firefox-main/rev/d5770dd3a8e0c22c71c8b283831ff6f410d5ff05/layout/base/PresShell.cpp#3313,3322,3328
Is it possible that #search is focusable but other #fragments aren't or something like that?
| Assignee | ||
Comment 9•6 months ago
|
||
By changing the vbox id of the "Web Search" section, we prevent focus
from being stolen. I'm not entirely sure why this change fixes the issue
as it's likely something to do with the "7.4.6.4 Scrolling to a
fragment" part of the HTML spec. If I had to guess...it's because we end
up finding a valid focus target, due to the id of the vbox being "search".
Then we end up following the focusing steps and move the focus to the
document body.
I would bet there are no elements with ids that are the same as the hash
values we use to move between categories in about:preferences, thus
focus doesn't move because there are no valid focus targets in the
document.
See Comment #8 by :smaug for more detail.
| Assignee | ||
Updated•6 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Comment 10•5 months ago
|
||
Comment 11•5 months ago
|
||
| bugherder | ||
Comment 12•5 months ago
|
||
The patch landed in nightly and beta is affected.
:tgiles, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox145towontfix.
For more information, please visit BugBot documentation.
Updated•5 months ago
|
| Assignee | ||
Updated•5 months ago
|
Updated•5 months ago
|
Description
•