Closed
Bug 1404651
Opened 7 years ago
Closed 7 years ago
arrow keys do not move through tabs when tabs have focus
Categories
(Firefox :: Tabbed Browser, defect, P1)
Tracking
()
VERIFIED
FIXED
Firefox 58
Tracking | Status | |
---|---|---|
firefox-esr52 | --- | unaffected |
firefox56 | --- | wontfix |
firefox57 | + | verified |
firefox58 | --- | verified |
People
(Reporter: asa, Assigned: Gijs)
References
Details
(Keywords: regression)
Attachments
(1 file)
(deleted),
text/x-review-board-request
|
dao
:
review+
ritu
:
approval-mozilla-beta+
|
Details |
If you use the keyboard to give a tab the focus and then use the right arrow or left arrow to navigate to the neighboring tab, the tab loses focus so you cannot arrow to the next tab.
Steps to reproduce:
1. Put the focus on the current selected tab (shift tab twice from the addressbar does it.)
2. Note the dotted border around the tab title
3. Hit the arrow key to move to the next tab
4. Note the lack of dotted border around the tab title
5. Hit the arrow key again to move to the next tab
Results: can't move to the next tab because focus lost
Expected Results: can arrow back and forth as much as I want without the tab strip losing focus.
Tested 57 Beta 4 on Windows 10
Reporter | ||
Updated•7 years ago
|
Keywords: regression
Comment 1•7 years ago
|
||
I managed to narrow this down to this regression range: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=6d4744a6c81c498cc81cad11b4ead64660a3d269&tochange=aa48bb3f494410de514041e8c06ca15c38680181
Blocks: 1362866
Assignee | ||
Comment 2•7 years ago
|
||
[Tracking Requested - why for this release]:
Regression in keyboard accessibility of primary UI.
Comment hidden (mozreview-request) |
Assignee | ||
Comment 4•7 years ago
|
||
This seems to be caused by the fact that we now check for the current state of focus a bit later in the e10s case, and in the arrow case the arrow key itself has moved focus to the new tab already, so in this code (from _adjustFocusBeforeTabSwitch):
+ // If focus is in the tab bar, retain it there.
+ if (document.activeElement == oldTab) {
+ // We need to explicitly focus the new tab, because
+ // tabbox.xml does this only in some cases.
+ newTab.focus();
+ } else if (gMultiProcessBrowser && document.activeElement !== newBrowser) {
+
+ let keepFocusOnUrlBar = newBrowser &&
+ newBrowser._urlbarFocused &&
+ gURLBar &&
+ gURLBar.focused;
+ if (!keepFocusOnUrlBar) {
+ // Clear focus so that _adjustFocusAfterTabSwitch can detect if
+ // some element has been focused and respect that.
+ document.activeElement.blur();
+ }
+ }
we hit the 'else' block. We should probably just check that the new tab element wasn't explicitly focused before doing that. I've put up a patch that does this.
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Updated•7 years ago
|
Updated•7 years ago
|
Priority: -- → P1
Comment 5•7 years ago
|
||
(In reply to :Gijs (no reviews, PTO EOB on 11th) from comment #4)
> + // If focus is in the tab bar, retain it there.
> + if (document.activeElement == oldTab) {
> + // We need to explicitly focus the new tab, because
> + // tabbox.xml does this only in some cases.
> + newTab.focus();
> + } else if (gMultiProcessBrowser && document.activeElement !==
> newBrowser) {
> we hit the 'else' block. We should probably just check that the new tab
> element wasn't explicitly focused before doing that. I've put up a patch
> that does this.
In other words, tabbox.xml actually has us covered now in the non-e10s case. We should clean this up some more then.
Assignee | ||
Comment 6•7 years ago
|
||
(In reply to Dão Gottwald [::dao] from comment #5)
> (In reply to :Gijs (no reviews, PTO EOB on 11th) from comment #4)
> > + // If focus is in the tab bar, retain it there.
> > + if (document.activeElement == oldTab) {
> > + // We need to explicitly focus the new tab, because
> > + // tabbox.xml does this only in some cases.
> > + newTab.focus();
> > + } else if (gMultiProcessBrowser && document.activeElement !==
> > newBrowser) {
>
> > we hit the 'else' block. We should probably just check that the new tab
> > element wasn't explicitly focused before doing that. I've put up a patch
> > that does this.
>
> In other words, tabbox.xml actually has us covered now in the non-e10s case.
> We should clean this up some more then.
I'm confused - this change affects e10s rather than non-e10s. Can you expand on your comment to help me understand what you mean here?
Flags: needinfo?(dao+bmo)
Comment hidden (mozreview-request) |
Comment 9•7 years ago
|
||
mozreview-review |
Comment on attachment 8915104 [details]
Bug 1404651 - keep focus in the tabstrip when the focus has shifted with the arrow keys,
https://reviewboard.mozilla.org/r/186370/#review193130
::: browser/base/content/tabbrowser.xml:1426
(Diff revision 2)
> let findBar = this.getFindBar(oldTab);
> oldTab._findBarFocused = (!findBar.hidden &&
> findBar._findField.getAttribute("focused") == "true");
> }
>
> - // If focus is in the tab bar, retain it there.
> + let activeEl = document.activeElement;
Can you write a new comment explaining this whole block? Alternatively, at least keep "If focus is in the tab bar, retain it there" for now because this code is a bit obscure.
::: browser/base/content/tabbrowser.xml:1427
(Diff revision 2)
> oldTab._findBarFocused = (!findBar.hidden &&
> findBar._findField.getAttribute("focused") == "true");
> }
>
> - // If focus is in the tab bar, retain it there.
> - if (document.activeElement == oldTab) {
> + let activeEl = document.activeElement;
> + if (gMultiProcessBrowser && activeEl !== newBrowser && activeEl !== newTab) {
nit: != instead of !==
Attachment #8915104 -
Flags: review?(dao+bmo) → review+
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 12•7 years ago
|
||
Pushed by gijskruitbosch@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/6bec02f9a646
keep focus in the tabstrip when the focus has shifted with the arrow keys, r=dao
Comment 13•7 years ago
|
||
Backed out for frequently (or permanently? hard to judge because of the test suite chunking) failing browser-chrome's browser/base/content/test/general/browser_tabfocus.js:
https://hg.mozilla.org/integration/autoland/rev/6771bdd9b24eedc4df2f99f2e77874acf38a0b56
Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=6bec02f9a646f11777dbc12ceeb90af76198242d&filter-resultStatus=testfailed&filter-resultStatus=busted&filter-resultStatus=exception&filter-resultStatus=retry&filter-resultStatus=usercancel&filter-resultStatus=runnable
Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=135949201&repo=autoland
[task 2017-10-10T15:28:08.123Z] 15:28:08 INFO - TEST-PASS | browser/base/content/test/general/browser_tabfocus.js | focusing tab element hasFocus -
[task 2017-10-10T15:28:08.125Z] 15:28:08 INFO - TEST-PASS | browser/base/content/test/general/browser_tabfocus.js | focusing tab element activeElement -
[task 2017-10-10T15:28:08.127Z] 15:28:08 INFO - TEST-PASS | browser/base/content/test/general/browser_tabfocus.js | main-window is always expected -
[task 2017-10-10T15:28:08.129Z] 15:28:08 INFO - Buffered messages finished
[task 2017-10-10T15:28:08.134Z] 15:28:08 INFO - TEST-UNEXPECTED-FAIL | browser/base/content/test/general/browser_tabfocus.js | tab change when selected tab element was focused focusedElement - Got browser1, expected tab1
[task 2017-10-10T15:28:08.137Z] 15:28:08 INFO - Stack trace:
[task 2017-10-10T15:28:08.140Z] 15:28:08 INFO - chrome://mochikit/content/browser-test.js:test_is:1011
[task 2017-10-10T15:28:08.143Z] 15:28:08 INFO - chrome://mochitests/content/browser/browser/base/content/test/general/browser_tabfocus.js:compareFocusResults/<:447
[task 2017-10-10T15:28:08.145Z] 15:28:08 INFO - chrome://mochikit/content/browser-test.js:run:1040
Flags: needinfo?(gijskruitbosch+bugs)
Comment 14•7 years ago
|
||
Please also check this bc failure on Windows 7 debug with e10s: https://treeherder.mozilla.org/logviewer.html#?job_id=135977273&repo=autoland
> TEST-UNEXPECTED-FAIL | browser/base/content/test/general/browser_bug462289.js | click on tab2 while tab1 is activated activates tab - Got [object XULElement], expected [object XULElement]
Assignee | ||
Comment 15•7 years ago
|
||
Let's try the old version then, clearly there must be cases where tabbox.xml doesn't have us covered... (the new version fails tests locally and the old one doesn't):
https://treeherder.mozilla.org/#/jobs?repo=try&revision=2f59dc864202850b580294df8d783b36bf3321a3
Comment hidden (mozreview-request) |
Assignee | ||
Comment 17•7 years ago
|
||
Comment on attachment 8915104 [details]
Bug 1404651 - keep focus in the tabstrip when the focus has shifted with the arrow keys,
(In reply to :Gijs (no reviews, PTO EOB on 11th) from comment #15)
> Let's try the old version then, clearly there must be cases where tabbox.xml
> doesn't have us covered... (the new version fails tests locally and the old
> one doesn't):
>
> https://treeherder.mozilla.org/#/
> jobs?repo=try&revision=2f59dc864202850b580294df8d783b36bf3321a3
The problematic tests are green here, so let's try this, then.
Flags: needinfo?(gijskruitbosch+bugs)
Attachment #8915104 -
Flags: review+ → review?(dao+bmo)
Comment 18•7 years ago
|
||
mozreview-review |
Comment on attachment 8915104 [details]
Bug 1404651 - keep focus in the tabstrip when the focus has shifted with the arrow keys,
https://reviewboard.mozilla.org/r/186370/#review193510
Attachment #8915104 -
Flags: review?(dao+bmo) → review+
Comment 19•7 years ago
|
||
Pushed by gijskruitbosch@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/0304a90aee90
keep focus in the tabstrip when the focus has shifted with the arrow keys, r=dao
Comment 20•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 58
Updated•7 years ago
|
status-firefox-esr52:
--- → unaffected
Comment 21•7 years ago
|
||
Given that the bar for uplifts to 57 is getting higher and we've already shipped this regression in 56, I'm inclined to let this ride the 58 train. Thoughts?
Flags: needinfo?(dao+bmo)
Comment 22•7 years ago
|
||
The fix is trivial and we have automated test coverage, so I think we should uplift.
Flags: needinfo?(dao+bmo)
Comment 23•7 years ago
|
||
Comment on attachment 8915104 [details]
Bug 1404651 - keep focus in the tabstrip when the focus has shifted with the arrow keys,
Approval Request Comment
[Feature/Bug causing the regression]: bug 1362866
[User impact if declined]: broken keyboard navigation in the tab strip
[Is this code covered by automated tests?]: yes
[Has the fix been verified in Nightly?]: not yet
[Needs manual test from QE? If yes, steps to reproduce]:
[List of other uplifts needed for the feature/fix]: /
[Is the change risky?]: no
[Why is the change risky/not risky?]: trivial fix
[String changes made/needed]: /
Attachment #8915104 -
Flags: approval-mozilla-beta?
Comment on attachment 8915104 [details]
Bug 1404651 - keep focus in the tabstrip when the focus has shifted with the arrow keys,
severe regression, beta57+
Attachment #8915104 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Comment 25•7 years ago
|
||
bugherder uplift |
Updated•7 years ago
|
Flags: qe-verify+
Comment 26•7 years ago
|
||
I have reproduced this bug with Nightly 58.0a1 (2017-09-30) on Windows 10 , 64 Bit !
This bug's fix is Verified with latest Beta & Nightly !
Build ID 20171013042429
User Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:57.0) Gecko/20100101 Firefox/57.0
Build ID 20171013100112
User Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:58.0) Gecko/20100101 Firefox/58.0
QA Whiteboard: [testday-20171013]
Comment 27•7 years ago
|
||
I reproduced this issue using Fx 58.0a1, build ID: 20170930220116, on Windows 10 x64.
I can confirm this issue is fixed, I verified using Fx 58.0a1(20171013100112) and Fx 57.0b9, on Windows 10 x64 and Ubuntu 14.04 LTS.
Status: RESOLVED → VERIFIED
Flags: qe-verify+
Updated•6 years ago
|
Flags: in-qa-testsuite+
You need to log in
before you can comment on or make changes to this bug.
Description
•