Bug 890476 - Don't build a menubar on OSX, r=dao
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 08 Jul 2013 17:15:16 +0200
changeset 164556 34c0f40827de47fbc0f3d1fa242e7af234561e43
parent 164555 227581811069f3a38c51572e43f6a64b90ddd227
child 164557 04a9719e70576b9f586c64eb314dad191fac66dc
push id4703
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 20:24:19 +0000
treeherdermozilla-aurora@20af7fbd96c1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs890476
milestone25.0a1
Bug 890476 - Don't build a menubar on OSX, r=dao
browser/base/content/browser.css
browser/components/customizableui/content/toolbar.xml
browser/components/customizableui/src/CustomizableUI.jsm
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -13,16 +13,20 @@ browser[remote="true"] {
   -moz-binding: url("chrome://global/content/bindings/remote-browser.xml#remote-browser");
 }
 
 toolbar[customizable="true"] {
   -moz-binding: url("chrome://browser/content/customizableui/toolbar.xml#toolbar");
 }
 
 %ifdef XP_MACOSX
+#toolbar-menubar {
+  -moz-binding: url("chrome://browser/content/customizableui/toolbar.xml#toolbar-menubar-stub");
+}
+
 toolbar[customizable="true"]:not([nowindowdrag="true"]) {
   -moz-binding: url("chrome://browser/content/customizableui/toolbar.xml#toolbar-drag");
 }
 %endif
 
 #toolbar-menubar[autohide="true"] {
   -moz-binding: url("chrome://browser/content/customizableui/toolbar.xml#toolbar-menubar-autohide");
 }
--- a/browser/components/customizableui/content/toolbar.xml
+++ b/browser/components/customizableui/content/toolbar.xml
@@ -141,16 +141,43 @@
           return [node.id for (node of this._customizationTarget.children)].join(',');
         ]]></getter>
       </property>
 
 
     </implementation>
   </binding>
 
+  <binding id="toolbar-menubar-stub">
+    <implementation>
+      <property name="toolbox" readonly="true">
+        <getter><![CDATA[
+          if (this._toolbox)
+            return this._toolbox;
+
+          if (this.parentNode && this.parentNode.localName == "toolbox") {
+            this._toolbox = this.parentNode;
+          }
+
+          return this._toolbox;
+        ]]></getter>
+      </property>
+      <property name="currentSet" readonly="true">
+        <getter><![CDATA[
+          return this.getAttribute("defaultset");
+        ]]></getter>
+      </property>
+      <method name="insertItem">
+        <body><![CDATA[
+          return null;
+        ]]></body>
+      </method>
+    </implementation>
+  </binding>
+
   <!-- The toolbar-menubar-autohide and toolbar-drag bindings are almost
        verbatim copies of their toolkit counterparts - they just inherit from
        the customizableui's toolbar binding instead of toolkit's. We're currently
        OK with the maintainance burden of having two copies of a binding, since
        the long term goal is to move the customization framework into toolkit. -->
 
   <binding id="toolbar-menubar-autohide"
            extends="chrome://browser/content/customizableui/toolbar.xml#toolbar">
--- a/browser/components/customizableui/src/CustomizableUI.jsm
+++ b/browser/components/customizableui/src/CustomizableUI.jsm
@@ -143,23 +143,25 @@ let CustomizableUIInternal = {
         "search-container",
         "webrtc-status-button",
         "bookmarks-menu-button",
         "downloads-button",
         "home-button",
         "social-share-button",
       ]
     });
+#ifndef XP_MACOSX
     this.registerArea(CustomizableUI.AREA_MENUBAR, {
       legacy: true,
       type: CustomizableUI.TYPE_TOOLBAR,
       defaultPlacements: [
         "menubar-items",
       ]
     });
+#endif
     this.registerArea(CustomizableUI.AREA_TABSTRIP, {
       legacy: true,
       type: CustomizableUI.TYPE_TOOLBAR,
       defaultPlacements: [
         "tabbrowser-tabs",
         "new-tab-button",
         "alltabs-button",
         "tabs-closebutton",