Bug 1364166 - Only update combined buttons style in the customizableUI panel. r=Gijs
authorJohann Hofmann <jhofmann@mozilla.com>
Thu, 11 May 2017 22:05:01 -0400
changeset 358392 dae04df6968031a834aa9e72ba4722f24672f2fd
parent 358391 0e8f01e9fefb71b91c4f31ddfb96c34ba92dc60a
child 358393 bbe1cf88947a2f1f50957bf972000f27068abae4
push id31824
push userkwierso@gmail.com
push dateMon, 15 May 2017 23:04:35 +0000
treeherdermozilla-central@a4235c4be96e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1364166
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1364166 - Only update combined buttons style in the customizableUI panel. r=Gijs This Photon-specific workaround styles the zoom and edit button combinations when the user switches back to the old menu panel. Before this patch, it used to apply the panel style even if the buttons were in the toolbar. This patch fixes that by not even updating the style if the buttons are not in the panel. MozReview-Commit-ID: JZZUTudSDeZ
browser/components/customizableui/CustomizableWidgets.jsm
--- a/browser/components/customizableui/CustomizableWidgets.jsm
+++ b/browser/components/customizableui/CustomizableWidgets.jsm
@@ -751,18 +751,19 @@ const CustomizableWidgets = [
           aArea = aArea || this.currentArea;
           updateCombinedWidgetStyle(node, aArea, true);
         },
 
         // Hack. This can go away when the old menu panel goes away (post photon).
         // We need it right now for the case where we re-register the old-style
         // main menu panel if photon is disabled at runtime, and we automatically
         // put the widgets in there, so they get the right style in the panel.
-        onAreaNodeRegistered(aArea, aContainer) {
+        onAreaNodeRegistered: (aArea, aContainer) => {
           if (aContainer.ownerDocument == node.ownerDocument &&
+              aArea == this.currentArea &&
               aArea == CustomizableUI.AREA_PANEL) {
             updateCombinedWidgetStyle(node, aArea, true);
           }
         },
       };
       CustomizableUI.addListener(listener);
 
       return node;
@@ -858,18 +859,19 @@ const CustomizableWidgets = [
           aArea = aArea || this.currentArea;
           updateCombinedWidgetStyle(node, aArea);
         },
 
         // Hack. This can go away when the old menu panel goes away (post photon).
         // We need it right now for the case where we re-register the old-style
         // main menu panel if photon is disabled at runtime, and we automatically
         // put the widgets in there, so they get the right style in the panel.
-        onAreaNodeRegistered(aArea, aContainer) {
+        onAreaNodeRegistered: (aArea, aContainer) => {
           if (aContainer.ownerDocument == node.ownerDocument &&
+              aArea == this.currentArea &&
               aArea == CustomizableUI.AREA_PANEL) {
             updateCombinedWidgetStyle(node, aArea);
           }
         },
       };
       CustomizableUI.addListener(listener);
 
       return node;