Commit graph

8 commits

Author SHA1 Message Date
James Teh
8810a3c233 Bug 1540918: When a panel is opened from the toolbar via the keyboard, restore focus to the toolbar button when the panel is closed. r=Gijs
Toolbar buttons are only made focusable when accessed via the keyboard.
As soon as they lose focus, their focusability is removed.
This is done so that clicking them doesn't focus them.
Previously, this meant that if a panel opened, focus couldn't be restored to the button like it should be when the panel was closed, as the button was no longer focusable.
To work around this, use the open="true" attribute set on the button when the panel opens.
If this is detected when the button loses focus, focusability is not removed.
Once focus is restored after the panel closes, things continue as normal.
That is, when the button loses focus for some other reason, its focusability is removed.

Differential Revision: https://phabricator.services.mozilla.com/D26073

--HG--
extra : moz-landing-system : lando
2019-04-04 17:04:18 +00:00
James Teh
9cdf8c0da1 Bug 1539647: Make the "Show more bookmarks" button navigable with the keyboard. r=Gijs
When the Bookmarks toolbar overflows, it contains buttons with style visibility: hidden.
ToolbarKeyboardNavigator wasn't checking for this and was trying to focus these buttons, which simply failed.
We now skip over these buttons, which means that the Show more bookmarks button can now be reached.

Differential Revision: https://phabricator.services.mozilla.com/D25180

--HG--
extra : moz-landing-system : lando
2019-03-29 00:46:57 +00:00
Gurzau Raul
e5f97940c5 Backed out changeset fae91b8aa3d7 (bug 1539647) for eslint falure at /content/browser-toolbarKeyNav.js on a CLOSED TREE. 2019-03-29 01:51:37 +02:00
James Teh
a35520c301 Bug 1539647: Make the "Show more bookmarks" button navigable with the keyboard. r=Gijs
When the Bookmarks toolbar overflows, it contains buttons with style visibility: hidden.
ToolbarKeyboardNavigator wasn't checking for this and was trying to focus these buttons, which simply failed.
We now skip over these buttons, which means that the Show more bookmarks button can now be reached.

Differential Revision: https://phabricator.services.mozilla.com/D25180

--HG--
extra : moz-landing-system : lando
2019-03-28 23:22:32 +00:00
James Teh
89ea40cf9f Bug 1538575: Toolbar keyboard navigation: Make arrow keys behave as expected for RTL locales. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D24841

--HG--
extra : moz-landing-system : lando
2019-03-26 10:35:21 +00:00
James Teh
3676e15738 Bug 1436086: Implement keyboard navigation for the main and Bookmarks toolbars. r=Gijs
Having separate tab stops for every toolbar control results in an unmanageable number of tab stops.
Therefore, we group several buttons under a single tab stop and allow movement between them using left/right arrows.
However, text inputs use the arrow keys for their own purposes, so they need their own tab stop.
There are also groups of buttons before and after the URL bar input which should get their own tab stop.
The subsequent buttons on the toolbar are then another tab stop after that.

Tab stops for groups of buttons are set using the <toolbartabstop/> element.
This element is invisible, but gets included in the tab order.
When one of these gets focus, it redirects focus to the appropriate button.
This avoids the need to continually manage the tabindex of toolbar buttons in response to toolbarchanges.

Navigation to for the View site information button and notification anchors is now managed by this new framework.
As such, they no longer need their own position in the tab order and the CSS has been tweaked accordingly.

For now, this new functionality is behind a pref (browser.toolbars.keyboard_navigation) which is currently disabled by default.

Differential Revision: https://phabricator.services.mozilla.com/D15060

--HG--
extra : moz-landing-system : lando
2019-02-13 22:51:06 +00:00
Cosmin Sabou
ea11387364 Backed out changeset a14a11bf2d6f (bug 1436086) for eslint failure on browser_toolbarButtonKeyPress.js. CLOSED TREE 2019-02-13 15:35:34 +02:00
James Teh
356adc5d97 Bug 1436086: Implement keyboard navigation for the main and Bookmarks toolbars. r=Gijs
Having separate tab stops for every toolbar control results in an unmanageable number of tab stops.
Therefore, we group several buttons under a single tab stop and allow movement between them using left/right arrows.
However, text inputs use the arrow keys for their own purposes, so they need their own tab stop.
There are also groups of buttons before and after the URL bar input which should get their own tab stop.
The subsequent buttons on the toolbar are then another tab stop after that.

Tab stops for groups of buttons are set using the <toolbartabstop/> element.
This element is invisible, but gets included in the tab order.
When one of these gets focus, it redirects focus to the appropriate button.
This avoids the need to continually manage the tabindex of toolbar buttons in response to toolbarchanges.

Navigation to for the View site information button and notification anchors is now managed by this new framework.
As such, they no longer need their own position in the tab order and the CSS has been tweaked accordingly.

For now, this new functionality is behind a pref (browser.toolbars.keyboard_navigation) which is currently disabled by default.

Differential Revision: https://phabricator.services.mozilla.com/D15060

--HG--
extra : moz-landing-system : lando
2019-02-13 11:18:45 +00:00