gecko-dev/browser/components/controlcenter/content
James Teh 4e6ac5b1e0 Bug 1477673: Refactor PanelMultiView keyboard navigation to use a TreeWalker. r=Gijs,johannh
Previously, this code cached a list of controls on first use and used that for navigation.
This refactor addresses several issues:

1. There is now a separate focus order for tab/shift+tab and down/up arrows.
    This allows menulists, textboxes, etc. which use the arrow keys themselves to be focused with tab, but skipped with the arrows.
    This means the user won't fall into these controls when using the up/down arrow keys and be confused by the subsequent arrowing behaviour.

2. When a menulist, textbox, etc. is focused, the arrow keys, space and enter are now passed to the control.
    This is a better fix for handling of the arrow keys by menulists (bug 1522092).
    It also fixes left arrow in a textarea moving to the previous view instead of moving the caret (bug 1489874).

3. This improves handling of dynamic updates to the panel.
    For example, elements that are initially disabled and enabled later will be navigable.
    This is because the next element is determined dynamically by the TreeWalker, rather than using a cached list.

4. The interim fix for bug 1522092 disabled PanelMultiView keyboard navigation.
    This caused some regressions, including arrow keys/activation on the Site Identity Report a Problem link (bug 1539976) and some controls not being navigable if the Site Identity panel is opened using the mouse (bug 1539984).
    With the above fixes, we can now re-enable PanelMultiView keyboard navigation in the Site identity panel and thus fix these regressions.

5. Previously, PanelMultiView keyboard navigation was disabled in the main toolbar overflow menu.
    This is because the search box can be added to the overflow menu, which previously caused problems for the arrow keys.
    With the above fixes, we can now safely enable PanelMultiView keyboard navigation in the overflow menu.

6. PanelMultiView keyboard tests have been added.
    Previously, we relied on tests specific to various panels to exercise this functionality.

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

--HG--
extra : moz-landing-system : lando
2019-04-15 01:38:08 +00:00
..
panel.inc.xul Bug 1477673: Refactor PanelMultiView keyboard navigation to use a TreeWalker. r=Gijs,johannh 2019-04-15 01:38:08 +00:00