Bug 1453281 - Remove obsolete menubar binding and styling. r?paolo,bgrins draft
authorDão Gottwald <dao@mozilla.com>
Wed, 11 Apr 2018 17:29:27 +0200
changeset 780592 d8ea0cf23701c6ada6dd0fe96f51390d03b09b1c
parent 780587 cfe6399e142c71966ef58a16cfd52c0b46dc6b1e
push id106029
push userdgottwald@mozilla.com
push dateWed, 11 Apr 2018 15:29:52 +0000
reviewerspaolo, bgrins
bugs1453281
milestone61.0a1
Bug 1453281 - Remove obsolete menubar binding and styling. r?paolo,bgrins MozReview-Commit-ID: Kao3jst0DBJ
browser/base/content/browser-menubar.inc
browser/themes/linux/places/organizer.css
browser/themes/windows/places/organizer.css
devtools/client/scratchpad/scratchpad.xul
devtools/client/webide/content/webide.xul
layout/tools/layout-debug/ui/content/layoutdebug.xul
toolkit/content/widgets/toolbar.xml
toolkit/content/xul.css
toolkit/themes/linux/global/toolbar.css
toolkit/themes/osx/global/toolbar.css
toolkit/themes/windows/global/toolbar.css
--- a/browser/base/content/browser-menubar.inc
+++ b/browser/base/content/browser-menubar.inc
@@ -2,18 +2,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
        <menubar id="main-menubar"
                 onpopupshowing="if (event.target.parentNode.parentNode == this &amp;&amp;
                                     !('@mozilla.org/widget/nativemenuservice;1' in Cc))
                                   this.setAttribute('openedwithkey',
-                                                    event.target.parentNode.openedWithKey);"
-                style="border:0px;padding:0px;margin:0px;-moz-appearance:none">
+                                                    event.target.parentNode.openedWithKey);">
             <menu id="file-menu" label="&fileMenu.label;"
                   accesskey="&fileMenu.accesskey;">
               <menupopup id="menu_FilePopup"
                          onpopupshowing="updateUserContextUIVisibility();">
                 <menuitem id="menu_newNavigatorTab"
                           label="&tabCmd.label;"
                           command="cmd_newNavigatorTab"
                           key="key_newNavigatorTab"
--- a/browser/themes/linux/places/organizer.css
+++ b/browser/themes/linux/places/organizer.css
@@ -54,21 +54,16 @@
 #forward-button:-moz-locale-dir(rtl) {
   list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=toolbar");
 }
 #forward-button[disabled="true"]:-moz-locale-dir(rtl) {
   list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=toolbar&state=disabled");
 }
 
 /* Menu */
-#placesMenu {
-  -moz-appearance: none;
-  border: none;
-}
-
 #placesMenu > menu {
   padding-inline-start: 4px;
   -moz-binding: url("chrome://browser/skin/places/organizer.xml#toolbarbutton-dropdown");
   -moz-appearance: toolbarbutton;
 }
 
 #placesMenu > menu:active,
 #placesMenu > menu:hover,
--- a/browser/themes/windows/places/organizer.css
+++ b/browser/themes/windows/places/organizer.css
@@ -30,18 +30,16 @@
 #back-button:-moz-locale-dir(rtl) > .toolbarbutton-icon,
 #forward-button:-moz-locale-dir(rtl) > .toolbarbutton-icon {
   transform: scaleX(-1);
 }
 
 /* Menu */
 #placesMenu {
   margin-inline-start: 6px;
-  -moz-appearance: none;
-  border: none;
 }
 
 #placesMenu > menu {
   padding-inline-start: 4px;
   padding-inline-end: 1px;
   padding-top: 2px;
   padding-bottom: 2px;
   -moz-appearance: toolbarbutton;
--- a/devtools/client/scratchpad/scratchpad.xul
+++ b/devtools/client/scratchpad/scratchpad.xul
@@ -136,16 +136,17 @@
        command="sp-cmd-documentationLink"/>
   <key id="key_gotoLine"
        key="&gotoLineCmd.key;"
        command="key_gotoLine"
        modifiers="accel"/>
 
 </keyset>
 
+<toolbar type="menubar">
 <menubar id="sp-menubar">
   <menu id="sp-file-menu" label="&fileMenu.label;" accesskey="&fileMenu.accesskey;">
     <menupopup id="sp-menu-filepopup">
       <menuitem id="sp-menu-newscratchpad"
                 label="&newWindowCmd.label;"
                 accesskey="&newWindowCmd.accesskey;"
                 key="sp-key-window"
                 command="sp-cmd-newWindow"/>
@@ -325,16 +326,17 @@
       <menuitem id="sp-menu-documentation"
                 label="&documentationLink.label;"
                 accesskey="&documentationLink.accesskey;"
                 command="sp-cmd-documentationLink"
                 key="key_openHelp"/>
     </menupopup>
   </menu>
 </menubar>
+</toolbar>
 
 <toolbar id="sp-toolbar"
          class="devtools-toolbar">
   <toolbarbutton id="sp-toolbar-open"
                  class="devtools-toolbarbutton"
                  label="&openFileCmd.label;"
                  command="sp-cmd-openFile"/>
   <toolbarbutton id="sp-toolbar-save"
--- a/devtools/client/webide/content/webide.xul
+++ b/devtools/client/webide/content/webide.xul
@@ -52,16 +52,17 @@
       <command id="cmd_stop" oncommand="Cmds.stop()" label="&projectMenu_stop_label;"/>
       <command id="cmd_toggleToolbox" oncommand="Cmds.toggleToolbox()"/>
       <command id="cmd_zoomin" label="&viewMenu_zoomin_label;" oncommand="Cmds.zoomIn()"/>
       <command id="cmd_zoomout" label="&viewMenu_zoomout_label;" oncommand="Cmds.zoomOut()"/>
       <command id="cmd_resetzoom" label="&viewMenu_resetzoom_label;" oncommand="Cmds.resetZoom()"/>
     </commandset>
   </commandset>
 
+  <toolbar type="menubar">
   <menubar id="main-menubar">
     <menu id="menu-project" label="&projectMenu_label;" accesskey="&projectMenu_accesskey;">
       <menupopup id="menu-project-popup">
         <menuitem command="cmd_newApp" accesskey="&projectMenu_newApp_accesskey;"/>
         <menuitem command="cmd_importPackagedApp" accesskey="&projectMenu_importPackagedApp_accesskey;"/>
         <menuitem command="cmd_importHostedApp" accesskey="&projectMenu_importHostedApp_accesskey;"/>
         <menuitem id="menuitem-show_projectPanel" command="cmd_showProjectPanel" key="key_showProjectPanel" label="&projectMenu_selectApp_label;" accesskey="&projectMenu_selectApp_accesskey;"/>
         <menuseparator/>
@@ -92,16 +93,17 @@
         <menuseparator/>
         <menuitem command="cmd_zoomin" key="key_zoomin" accesskey="&viewMenu_zoomin_accesskey;"/>
         <menuitem command="cmd_zoomout" key="key_zoomout" accesskey="&viewMenu_zoomout_accesskey;"/>
         <menuitem command="cmd_resetzoom" key="key_resetzoom" accesskey="&viewMenu_resetzoom_accesskey;"/>
       </menupopup>
     </menu>
 
   </menubar>
+  </toolbar>
 
   <keyset id="mainKeyset">
     <key key="&key_quit;" id="key_quit" command="cmd_quit" modifiers="accel"/>
     <key key="&key_showProjectPanel;" id="key_showProjectPanel" command="cmd_showProjectPanel" modifiers="accel"/>
     <key key="&key_play;" id="key_play" command="cmd_play" modifiers="accel"/>
     <key keycode="&key_toggleToolbox;" id="key_toggleToolbox" command="cmd_toggleToolbox"/>
     <key key="&key_zoomin;" id="key_zoomin" command="cmd_zoomin" modifiers="accel"/>
     <key key="&key_zoomin2;" id="key_zoomin2" command="cmd_zoomin" modifiers="accel"/>
--- a/layout/tools/layout-debug/ui/content/layoutdebug.xul
+++ b/layout/tools/layout-debug/ui/content/layoutdebug.xul
@@ -44,16 +44,17 @@
     <key id="openFileKb" key="&ldb.Open.commandkey;" oncommand="openFile()"  modifiers="accel"/>
     <key id="key_close"/>
     <key id="key_quit"/>
   </keyset>
 
   <vbox flex="1">
 
     <toolbox>
+      <toolbar type="menubar">
       <menubar id="main-menubar">
         <menu id="menu_file" label="File" accesskey="F">
           <menupopup id="menu_FilePopup">
             <menuitem id="menu_open" label="&ldb.Open.label;" accesskey="&ldb.Open.accesskey;" key="openFileKb" oncommand="openFile()"/>
             <menuitem id="menu_close" label="Close" accesskey="C" oncommand="window.close();"/>
           </menupopup>
         </menu>
         <menu label="&ldb.ToggleMenu.label;"
@@ -86,16 +87,17 @@
             <menuseparator />
             <menuitem id="menu_dumpReflowStats" label="&ldb.dumpReflowStats.label;" accesskey="&ldb.dumpReflowStats.accesskey;" oncommand="gDebugger.dumpReflowStats();" />
           </menupopup>
         </menu>
         <menu id="tasksMenu"/>
         <menu id="windowMenu"/>
         <menu id="menu_Help"/>
       </menubar>
+      </toolbar>
 
       <toolbar>
         <toolbarbutton id="back-button" class="toolbarbutton-1"
                        label="&ldb.BackButton.label;"
                        oncommand="gBrowser.goBack();" />
         <toolbarbutton id="forward-button" class="toolbarbutton-1"
                        label="&ldb.ForwardButton.label;"
                        oncommand="gBrowser.goForward();" />
--- a/toolkit/content/widgets/toolbar.xml
+++ b/toolkit/content/widgets/toolbar.xml
@@ -120,60 +120,16 @@
                      this.getAttribute("customizing") != "true";
             };
           } catch (e) {}
         }
       ]]></constructor>
     </implementation>
   </binding>
 
-  <binding id="menubar">
-    <implementation>
-       <field name="_active">false</field>
-       <field name="_statusbar">null</field>
-       <field name="_originalStatusText">null</field>
-       <property name="statusbar" onget="return this.getAttribute('statusbar');"
-                                  onset="this.setAttribute('statusbar', val); return val;"/>
-       <method name="_updateStatusText">
-          <parameter name="itemText"/>
-          <body>
-           <![CDATA[
-            if (!this._active)
-                return;
-            var newText = itemText ? itemText : this._originalStatusText;
-            if (newText != this._statusbar.label)
-                this._statusbar.label = newText;
-           ]]>
-          </body>
-        </method>
-    </implementation>
-    <handlers>
-        <handler event="DOMMenuBarActive">
-          <![CDATA[
-            if (!this.statusbar) return;
-            this._statusbar = document.getElementById(this.statusbar);
-            if (!this._statusbar)
-              return;
-            this._active = true;
-            this._originalStatusText = this._statusbar.label;
-          ]]>
-        </handler>
-        <handler event="DOMMenuBarInactive">
-          <![CDATA[
-            if (!this._active)
-              return;
-            this._active = false;
-            this._statusbar.label = this._originalStatusText;
-          ]]>
-        </handler>
-        <handler event="DOMMenuItemActive">this._updateStatusText(event.target.statusText);</handler>
-        <handler event="DOMMenuItemInactive">this._updateStatusText("");</handler>
-    </handlers>
-  </binding>
-
   <binding id="toolbarpaletteitem" extends="xul:button">
     <content>
       <xul:hbox class="toolbarpaletteitem-box" flex="1" xbl:inherits="type,place">
         <children/>
       </xul:hbox>
     </content>
   </binding>
 
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -267,17 +267,16 @@ splitter,
 scale,
 menulist {
   -moz-window-dragging: no-drag;
 }
 
 /******* toolbar *******/
 
 toolbox {
-  -moz-appearance: toolbox;
   -moz-box-orient: vertical;
 }
 
 toolbar[customizing="true"][collapsed="true"] {
   /* Some apps, e.g. Firefox, use 'collapsed' to hide toolbars.
      Override it while customizing. */
   visibility: visible;
 }
@@ -315,22 +314,16 @@ toolbarpaletteitem {
   -moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbarpaletteitem");
 }
 
 toolbarpaletteitem[place="palette"] {
   -moz-box-orient: vertical;
   -moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbarpaletteitem-palette");
 }
 
-/********* menubar ***********/
-
-menubar {
-  -moz-binding: url("chrome://global/content/bindings/toolbar.xml#menubar");
-}
-
 /********* menu ***********/
 
 menubar > menu {
   -moz-binding: url("chrome://global/content/bindings/menu.xml#menu-menubar");
 }
 
 menubar > menu.menu-iconic {
   -moz-binding: url("chrome://global/content/bindings/menu.xml#menu-menubar-iconic");
--- a/toolkit/themes/linux/global/toolbar.css
+++ b/toolkit/themes/linux/global/toolbar.css
@@ -3,58 +3,50 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* ===== toolbar.css ====================================================
   == Styles used by XUL toolbar-related elements.
   ======================================================================= */
 
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
-/* ::::: menubar & toolbar ::::: */
+toolbox {
+  -moz-appearance: toolbox;
+}
 
 toolbar {
   -moz-appearance: toolbar;
   min-width: 1px;
   min-height: 20px;
   padding: 2px 0px;
 }
 
-menubar, toolbar[type="menubar"] {
+toolbar[type="menubar"] {
   -moz-appearance: menubar;
   color: -moz-menubartext;
   min-width: 1px;
   min-height: 20px;
   padding: 1px 0px;
 }
 
-menubar:-moz-lwtheme,
 toolbar:-moz-lwtheme {
   -moz-appearance: none;
   color: inherit;
 }
 
-/* in browser.xul, the menubar is inside a toolbar... */
-toolbaritem > menubar {
-  -moz-appearance: none;
-}
-
-/* ::::: toolbar decorations ::::: */
-
 toolbarseparator {
   -moz-appearance: separator;
   margin : 0;
   min-width: 2px;
 }
 
 toolbarspacer {
   width: 15px;
 }
 
-/* ::::: toolbarpaletteitem ::::: */
-
 toolbarpaletteitem {
   cursor: grab;
 }
 
 /* ..... drag and drop feedback ..... */
 
 toolbarpaletteitem[place="toolbar"] {
   margin-left: -2px;
--- a/toolkit/themes/osx/global/toolbar.css
+++ b/toolkit/themes/osx/global/toolbar.css
@@ -1,39 +1,37 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
+toolbox {
+  /* Setting -moz-appearance:toolbox causes sheets to attach under the
+   * toolbox and has no other effects. It doesn't render anything. */
+  -moz-appearance: toolbox;
+}
+
 toolbar {
   min-width: 1px;
   min-height: 20px;
   -moz-appearance: toolbar;
 }
 
-menubar:-moz-lwtheme,
 toolbar:-moz-lwtheme {
   -moz-appearance: none;
   background: none;
   border-color: transparent;
 }
 
-menubar {
-  -moz-appearance: dialog; /* For content menubars, "toolbar" is too dark, so we use "dialog". */
-  min-width: 1px;
-}
-
 toolbarseparator {
   -moz-appearance: separator;
   margin: 3px 4px;
 }
 
-/* ::::: toolbarpaletteitem ::::: */
-
 toolbarpaletteitem {
   cursor: grab;
 }
 
 toolbarspacer {
   min-width: 24px !important;
 }
 
--- a/toolkit/themes/windows/global/toolbar.css
+++ b/toolkit/themes/windows/global/toolbar.css
@@ -3,51 +3,43 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* ===== toolbar.css ====================================================
   == Styles used by XUL toolbar-related elements.
   ======================================================================= */
 
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
-/* ::::: toolbar & menubar ::::: */
-
-toolbar, menubar {
-  -moz-appearance: toolbar;
+toolbox {
+  -moz-appearance: toolbox;
 }
 
 toolbar {
+  -moz-appearance: toolbar;
   min-width: 1px;
   min-height: 19px;
 }
 
-toolbar:first-child, menubar {
+toolbar:first-child {
   min-width: 1px;
 }
 
-/* ::::: lightweight theme ::::: */
-
-menubar:-moz-lwtheme,
 toolbox:-moz-lwtheme,
 toolbar:-moz-lwtheme {
   -moz-appearance: none;
 }
 
-/* ::::: toolbar decorations ::::: */
-
 toolbarseparator {
   -moz-appearance: separator;
 }
 
 toolbarspacer {
   width: 15px;
 }
 
-/* ::::: toolbarpaletteitem ::::: */
-
 toolbarpaletteitem {
   cursor: grab;
 }
 
 /* ..... drag and drop feedback ..... */
 
 toolbarpaletteitem[place="toolbar"] {
   margin-left: -2px;