Backed out changeset dc10b8966344 (bug 940182)
authorMike Conley <mconley@mozilla.com>
Tue, 03 Dec 2013 23:24:16 -0500
changeset 174150 9a2aa1fbe02ee33c630d68b56033b60a9df13f5f
parent 174149 8f6dc3a5ab670cfdfe0e6e01328f68466382d9e2
child 174151 947c1845e42acbf7a30b2f735a0786dc29c572c1
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs940182
milestone28.0a1
backs outdc10b8966344c178c2e04b20686533ed117d7fb8
Backed out changeset dc10b8966344 (bug 940182)
browser/components/customizableui/src/CustomizableUI.jsm
browser/components/customizableui/src/CustomizableWidgets.jsm
--- a/browser/components/customizableui/src/CustomizableUI.jsm
+++ b/browser/components/customizableui/src/CustomizableUI.jsm
@@ -649,27 +649,21 @@ let CustomizableUIInternal = {
 
     aPanel.toolbox = document.getElementById("navigator-toolbox");
     aPanel.customizationTarget = aPanel;
 
     this.addPanelCloseListeners(aPanel);
 
     let placements = gPlacements.get(CustomizableUI.AREA_PANEL);
     this.buildArea(CustomizableUI.AREA_PANEL, placements, aPanel);
-    for (let child of aPanel.children) {
-      if (child.localName != "toolbarbutton") {
-        if (child.localName == "toolbaritem") {
-          this.ensureButtonContextMenu(child, aPanel);
-        }
-        continue;
-      }
-      this.ensureButtonContextMenu(child, aPanel);
-      child.setAttribute("tabindex", "0");
-      if (!child.hasAttribute("type")) {
-        child.setAttribute("type", "wrap");
+    for (let btn of aPanel.querySelectorAll("toolbarbutton")) {
+      btn.setAttribute("tabindex", "0");
+      this.ensureButtonContextMenu(btn, aPanel);
+      if (!btn.hasAttribute("type")) {
+        btn.setAttribute("type", "wrap");
       }
     }
 
     this.registerBuildArea(CustomizableUI.AREA_PANEL, aPanel);
   },
 
   onWidgetAdded: function(aWidgetId, aArea, aPosition) {
     this.insertNode(aWidgetId, aArea, aPosition, true);
--- a/browser/components/customizableui/src/CustomizableWidgets.jsm
+++ b/browser/components/customizableui/src/CustomizableWidgets.jsm
@@ -487,16 +487,18 @@ const CustomizableWidgets = [{
       node.classList.add("toolbaritem-combined-buttons");
       node.classList.add(kWidePanelItemClass);
 
       buttons.forEach(function(aButton, aIndex) {
         if (aIndex != 0)
           node.appendChild(aDocument.createElementNS(kNSXUL, "separator"));
         let btnNode = aDocument.createElementNS(kNSXUL, "toolbarbutton");
         setAttributes(btnNode, aButton);
+        if (inPanel)
+          btnNode.setAttribute("tabindex", "0");
         node.appendChild(btnNode);
       });
 
       let listener = {
         onWidgetAdded: function(aWidgetId, aArea, aPosition) {
           if (aWidgetId != this.id)
             return;
           updateCombinedWidgetStyle(node, aArea);