Bug 1454866 part 1: PanelMultiView: Provide a way to allow keyboard navigation to an element without affecting visual presentation. r?johannh draft
authorJames Teh <jteh@mozilla.com>
Mon, 23 Apr 2018 10:37:42 +1000
changeset 786363 c663646e1d719bda4ee6750c1d2eaec37575aa84
parent 786291 8d4cf28964f6956cd22d8710b316456e2c7c848d
child 786364 65b557442499567d7888cf8f6443b4ceda708612
child 788954 8b9e4c978d3b372f9998e3ead97579422ac28459
child 791362 506e4adb0fa30a1573c98dc833b035aaa07bfb1a
push id107440
push userbmo:jteh@mozilla.com
push dateMon, 23 Apr 2018 00:46:06 +0000
reviewersjohannh
bugs1454866
milestone61.0a1
Bug 1454866 part 1: PanelMultiView: Provide a way to allow keyboard navigation to an element without affecting visual presentation. r?johannh PanelMultiView has specific code to support keyboard navigation. However, it only includes elements with class subviewbutton, which has visual styling. Some views have controls which should be included in keyboard navigation, but for which the subviewbutton styling is not appropriate. Therefore, also include elements with the new class subviewkeynav, which is specific to keyboard navigation and has no visual styling. MozReview-Commit-ID: 8A5q9nbGpdc
browser/components/customizableui/PanelMultiView.jsm
--- a/browser/components/customizableui/PanelMultiView.jsm
+++ b/browser/components/customizableui/PanelMultiView.jsm
@@ -1361,17 +1361,18 @@ var PanelView = class extends Associated
 
   /**
    * Retrieves the button elements that can be used for navigation using the
    * keyboard, that is all enabled buttons including the back button if visible.
    *
    * @return {Array}
    */
   getNavigableElements() {
-    let buttons = Array.from(this.node.querySelectorAll(".subviewbutton:not([disabled])"));
+    let buttons = Array.from(this.node.querySelectorAll(
+      ".subviewbutton:not([disabled]), .subviewkeynav:not([disabled])"));
     let dwu = this._dwu;
     return buttons.filter(button => {
       let bounds = dwu.getBoundsWithoutFlushing(button);
       return bounds.width > 0 && bounds.height > 0;
     });
   }
 
   /**