Bug 1442045 - Replace baseMenuOverlay.xul, macMenuOverlay.xul and macWindowMenu.inc with inlining and preprocessing. rs=jorgk
authorRichard Marti <richard.marti@gmail.com>
Thu, 01 Mar 2018 22:39:29 +0100
changeset 31195 bf7adc1ba8ee2f5494d107d8f6b8f6e6046c4661
parent 31194 dfb521841f3bb30f9fb417a40f0909b1db7cdd1b
child 31196 866932b038ba7b247d89548f639a289b93d55da9
push id383
push userclokep@gmail.com
push dateMon, 07 May 2018 21:52:48 +0000
reviewersjorgk
bugs1442045
Bug 1442045 - Replace baseMenuOverlay.xul, macMenuOverlay.xul and macWindowMenu.inc with inlining and preprocessing. rs=jorgk
mail/base/content/baseMenuOverlay.xul
mail/base/content/helpMenu.inc
mail/base/content/macMenuOverlay.xul
mail/base/content/macWindowMenu.inc
mail/base/content/mailWindowOverlay.xul
mail/base/content/viewSourceOverlay.xul
mail/base/jar.mn
mail/components/addrbook/content/addressbook.xul
mail/components/compose/content/messengercompose.xul
mail/locales/en-US/chrome/messenger/addressbook/abMainWindow.dtd
rename from mail/base/content/baseMenuOverlay.xul
rename to mail/base/content/helpMenu.inc
--- a/mail/base/content/baseMenuOverlay.xul
+++ b/mail/base/content/helpMenu.inc
@@ -1,79 +1,36 @@
-<?xml version="1.0"?>
-# 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/.
-
-<!DOCTYPE overlay [
-<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
-%brandDTD;
-<!ENTITY % baseMenuOverlayDTD SYSTEM "chrome://messenger/locale/baseMenuOverlay.dtd">
-%baseMenuOverlayDTD;
-]>
-<overlay id="baseMenuOverlay"
-         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-  <script type="application/javascript"
-          src="chrome://communicator/content/utilityOverlay.js"/>
-
-  <script type="application/javascript"
-          src="chrome://messenger/content/mailCore.js"/>
-
-  <script type="application/javascript"
-          src="chrome://global/content/viewSourceUtils.js"/>
-
+      <menu id="helpMenu"
 #ifdef XP_WIN
-  <menu id="helpMenu"
-        label="&helpMenuWin.label;" accesskey="&helpMenuWin.accesskey;">
+            label="&helpMenuWin.label;" accesskey="&helpMenuWin.accesskey;">
 #else
-  <menu id="helpMenu"
-        label="&helpMenu.label;" accesskey="&helpMenu.accesskey;">
+            label="&helpMenu.label;" accesskey="&helpMenu.accesskey;">
 #endif
-    <menupopup id="menu_HelpPopup">
+        <menupopup id="menu_HelpPopup">
+          <menuitem id="menu_openHelp"
 #ifdef XP_MACOSX
-      <menuitem id="menu_openHelp"
-                label="&openHelpMac2.label;" key="key_openHelp"
-                oncommand="openSupportURL();"/>
+                    label="&openHelpMac2.label;"
 #else
-      <menuitem id="menu_openHelp"
-                label="&openHelp.label;" accesskey="&openHelp.accesskey;"
-                oncommand="openSupportURL();"
-                key="key_openHelp"/>
-#endif
-      <menuitem id="whatsNew"
-                label="&whatsNewCmd.label;" accesskey="&whatsNewCmd.accesskey;"
-                oncommand="openWhatsNew();"/>
-      <menuitem id="releaseNotes"
-                label="&releaseCmd2.label;" accesskey="&releaseCmd2.accesskey;"
-                oncommand="openFormattedURL('app.releaseNotesURL');"/>
-      <menuseparator id="functionsSeparator"/>
-      <menuitem id="helpSafeMode"
-                label="&helpSafeMode.label;"
-                accesskey="&helpSafeMode.accesskey;"
-                oncommand="safeModeRestart();"/>
-#ifndef XP_MACOSX
-      <menuseparator id="aboutSeparator"/>
+                    label="&openHelp.label;"
+                    accesskey="&openHelp.accesskey;"
 #endif
-      <menuitem id="aboutName"
-                label="&aboutMenuCmd2.label;"
-                accesskey="&aboutMenuCmd2.accesskey;"
-                oncommand="openAboutDialog();"/>
-    </menupopup>
-  </menu>
-  <keyset id="baseMenuKeyset">
-#ifdef XP_MACOSX
-    <key id="key_openHelp"
-         oncommand="openSupportURL();"
-         key="&openHelpMac2.commandkey;"
-         modifiers="&openHelpMac2.modifiers;"/>
-#else
-    <key id="key_openHelp"
-         oncommand="openSupportURL();"
-         keycode="&openHelp.commandkey;"/>
+                    key="key_openHelp"
+                    oncommand="openSupportURL();"/>
+          <menuitem id="whatsNew"
+                    label="&whatsNewCmd.label;" accesskey="&whatsNewCmd.accesskey;"
+                    oncommand="openWhatsNew();"/>
+          <menuitem id="releaseNotes"
+                    label="&releaseCmd2.label;" accesskey="&releaseCmd2.accesskey;"
+                    oncommand="openFormattedURL('app.releaseNotesURL');"/>
+          <menuseparator id="functionsSeparator"/>
+          <menuitem id="helpSafeMode"
+                    label="&helpSafeMode.label;"
+                    accesskey="&helpSafeMode.accesskey;"
+                    oncommand="safeModeRestart();"/>
+#ifndef XP_MACOSX
+          <menuseparator id="aboutSeparator"/>
 #endif
-  </keyset>
-  <stringbundleset id="stringbundleset">
-    <stringbundle id="bundle_messenger"
-                  src="chrome://messenger/locale/messenger.properties"/>
-  </stringbundleset>
-</overlay>
+          <menuitem id="aboutName"
+                    label="&aboutMenuCmd2.label;"
+                    accesskey="&aboutMenuCmd2.accesskey;"
+                    oncommand="openAboutDialog();"/>
+        </menupopup>
+      </menu>
rename from mail/base/content/macMenuOverlay.xul
rename to mail/base/content/macWindowMenu.inc
--- a/mail/base/content/macMenuOverlay.xul
+++ b/mail/base/content/macWindowMenu.inc
@@ -1,36 +1,28 @@
-<!-- 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/. -->
-
-
-<!DOCTYPE overlay [
-  <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
-  %brandDTD;
-  <!ENTITY % messengerDTD SYSTEM "chrome://messenger/locale/messenger.dtd" >
-  %messengerDTD;
-]>
-
-<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-  <menupopup id="windowPopup">
-    <menuseparator insertbefore="sep-window-list"/>
-    <menuitem accesskey="&messengerCmd.accesskey;"
-              label="&messengerCmd.label;"  key="key_mail"
-              oncommand="toMessengerWindow();" id="tasksMenuMail"
-              insertbefore="sep-window-list"/>
-    <menuitem id="tasksMenuAddressBook"
-              label="&addressBookCmd.label;"
-              accesskey="&addressBookCmd.accesskey;"
-              key="key_addressbook"
-              oncommand="toAddressBook();"
-              insertbefore="sep-window-list"/>
-  </menupopup>
-
-  <keyset id="tasksKeys">
-    <key id="key_addressbook"
-         key="&addressBookCmd.key;"
-         modifiers="accel, shift"
-         oncommand="toAddressBook();"/>
-  </keyset>
-
-</overlay>
+      <!-- Mac window menu -->
+      <menu id="windowMenu"
+            label="&windowMenu.label;"
+            onpopupshowing="macWindowMenuDidShow();"
+            onpopuphidden="macWindowMenuDidHide();">
+        <menupopup id="windowPopup">
+          <menuitem id="minimizeWindow"
+                    label="&minimizeWindow.label;"
+                    oncommand="window.minimize();"
+                    key="key_minimizeWindow"/>
+          <menuitem id="zoomWindow"
+                    label="&zoomWindow.label;"
+                    oncommand="zoomWindow();"/>
+          <!-- decomment when "BringAllToFront" is implemented
+            <menuseparator/>
+            <menuitem label="&bringAllToFront.label;" disabled="true"/> -->
+          <menuseparator id="mac-window-list"/>
+          <menuitem accesskey="&messengerCmd.accesskey;"
+                    label="&messengerCmd.label;"  key="key_mail"
+                    oncommand="toMessengerWindow();" id="tasksMenuMail"/>
+          <menuitem id="tasksMenuAddressBook"
+                    label="&addressBookCmd.label;"
+                    accesskey="&addressBookCmd.accesskey;"
+                    key="key_addressbook"
+                    oncommand="toAddressBook();"/>
+          <menuseparator id="sep-window-list"/>
+        </menupopup>
+      </menu>
--- a/mail/base/content/mailWindowOverlay.xul
+++ b/mail/base/content/mailWindowOverlay.xul
@@ -14,20 +14,16 @@
 <!-- Overlaying utilityOverlay.xul here is a temporary band-aid for a
      hard-to-reproduce problem where File, Edit, and View menus disappear on
      Mac when certain add-ons are installed (bug 398702).  Work to find a
      better fix is ongoing.  Ultimately, utilityOverlay.xul wants to
      disappear from Thunderbird entirely (bug 359748). -->
 <?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
 
 <?xul-overlay href="chrome://communicator/content/charsetOverlay.xul"?>
-#ifdef XP_MACOSX
-<?xul-overlay href="chrome://messenger/content/macMenuOverlay.xul"?>
-#endif
-<?xul-overlay href="chrome://messenger/content/baseMenuOverlay.xul"?>
 <?xul-overlay href="chrome://messenger/content/about-support/aboutSupportOverlay.xul"?>
 
 <!DOCTYPE overlay [
   <!ENTITY % messengerDTD SYSTEM "chrome://messenger/locale/messenger.dtd">
   %messengerDTD;
   <!ENTITY % msgViewPickerDTD SYSTEM "chrome://messenger/locale/msgViewPickerOverlay.dtd" >
   %msgViewPickerDTD;
   <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
@@ -54,16 +50,21 @@
 <script type="application/javascript" src="chrome://messenger/content/messageDisplay.js"/>
 <script type="application/javascript" src="chrome://messenger/content/folderDisplay.js"/>
 <script type="application/javascript" src="chrome://messenger-newsblog/content/newsblogOverlay.js"/>
 <script type="application/javascript" src="chrome://messenger/content/mail-offline.js"/>
 <script type="application/javascript" src="chrome://global/content/printUtils.js"/>
 <script type="application/javascript" src="chrome://messenger/content/msgViewPickerOverlay.js"/>
 <script type="application/javascript" src="chrome://messenger/content/plugins.js"/>
 <script type="application/javascript" src="chrome://global/content/viewZoomOverlay.js"/>
+<script type="application/javascript" src="chrome://communicator/content/utilityOverlay.js"/>
+<script type="application/javascript" src="chrome://messenger/content/mailCore.js"/>
+#ifdef XP_MACOSX
+<script type="application/javascript" src="chrome://global/content/macWindowMenu.js"/>
+#endif
 <script type="application/javascript" src="chrome://messenger/content/newmailaccount/uriListener.js"/>
 
 <stringbundleset id="stringbundleset">
   <stringbundle id="brand_bundle" src="chrome://branding/locale/brand.properties"/>
   <stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
   <stringbundle id="bundle_offlinePrompts" src="chrome://messenger/locale/offline.properties"/>
 </stringbundleset>
 
@@ -578,24 +579,25 @@
 #expand    <key id="key_selectTab6" oncommand="focusOnMail(5, event);" key="6" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
 #expand    <key id="key_selectTab7" oncommand="focusOnMail(6, event);" key="7" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
 #expand    <key id="key_selectTab8" oncommand="focusOnMail(7, event);" key="8" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
 #expand    <key id="key_selectLastTab" oncommand="focusOnMail(-1, event);" key="9" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
 
 #ifdef XP_MACOSX
   <!-- Mac Window menu keys -->
   <key id="key_minimizeWindow" command="minimizeWindow" key="&minimizeWindow.key;" modifiers="accel"/>
+  <key id="key_addressbook" key="&addressBookCmd.key;" oncommand="toAddressBook();" modifiers="accel, shift"/>
     <!-- the following 3 keys are used in the application menu on Mac OS X Cocoa widgets -->
   <key id="key_preferencesCmdMac" key="&preferencesCmdMac.commandkey;" modifiers="&preferencesCmdMac.modifiers;"/>
   <key id="key_hideThisAppCmdMac" key="&hideThisAppCmdMac.commandkey;" modifiers="&hideThisAppCmdMac.modifiers;"/>
   <key id="key_hideOtherAppsCmdMac" key="&hideOtherAppsCmdMac.commandkey;" modifiers="&hideOtherAppsCmdMac.modifiers;"/>
+  <key id="key_openHelp" oncommand="openSupportURL();" key="&openHelpMac2.commandkey;" modifiers="&openHelpMac2.modifiers;"/>
+#else
+  <key id="key_openHelp" oncommand="openSupportURL();" keycode="&openHelp.commandkey;"/>
 #endif
-
-  <!-- Common keys for the base menu overlay -->
-  <keyset id="baseMenuKeyset"/>
 </keyset>
 
   <!-- "Please keep all items and separators up to date in nsContextMenu.js when making changes here" -->
   <menupopup id="mailContext"
              pagemenu="start"
              onpopupshowing="return fillMailContextMenu(event);"
              onpopuphiding="mailContextOnPopupHiding(event);">
 
@@ -3152,22 +3154,21 @@
         <menuitem id="menu_mac_hide_others" label="&hideOtherAppsCmdMac.label;" key="key_hideOtherAppsCmdMac"/>
         <menuitem id="menu_mac_show_all" label="&showAllAppsCmdMac.label;"/>
 #endif
 #endif
        </menupopup>
       </menu>
 
 #ifdef XP_MACOSX
-<!-- Mac window menu -->
-#includesubst @TOOLKIT_DIR@/content/macWindowMenu.inc
+#include macWindowMenu.inc
 #endif
 
       <!-- Help -->
-      <menu id="helpMenu"/>
+#include helpMenu.inc
 
       <spacer id="menubar_spacer" flex="100%"/>
       </menubar>
     </toolbaritem>
 #ifdef CAN_DRAW_IN_TITLEBAR
 #ifndef XP_MACOSX
     <hbox class="titlebar-placeholder" type="caption-buttons" ordinal="1000"/>
 #endif
--- a/mail/base/content/viewSourceOverlay.xul
+++ b/mail/base/content/viewSourceOverlay.xul
@@ -1,27 +1,58 @@
 <?xml version="1.0"?>
 # 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/.
 
-<?xul-overlay href="chrome://messenger/content/baseMenuOverlay.xul"?>
+<!DOCTYPE overlay [
+<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
+%brandDTD;
+<!ENTITY % baseMenuOverlayDTD SYSTEM "chrome://messenger/locale/baseMenuOverlay.dtd">
+%baseMenuOverlayDTD;
+]>
 
 <overlay id="viewSourceOverlay"
          xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
+<script type="application/javascript" src="chrome://messenger/content/mailCore.js"/>
+
   <window id="viewSource">
     <commandset id="baseMenuCommandSet"/>
     <keyset id="baseMenuKeyset"/>
     <stringbundleset id="stringbundleset"/>
   </window>
 
   <command id="cmd_highlightSyntax" disabled="true"/>
-  <menubar id="viewSource-main-menubar">
+  <keyset id="helpMenuKeyset">
+    <key id="key_openHelp"
+         oncommand="openSupportURL();"
 #ifdef XP_MACOSX
-    <menu id="windowMenu"/>
-    <menupopup id="taskPopup"/>
+         key="&openHelpMac2.commandkey;"
+         modifiers="&openHelpMac2.modifiers;"/>
+#else
+         keycode="&openHelp.commandkey;"/>
 #endif
-    <menu id="helpMenu"/>
+  </keyset>
+
+  <menubar id="viewSource-main-menubar">
+    <menu id="helpMenu"
+#ifdef XP_WIN
+          label="&helpMenuWin.label;" accesskey="&helpMenuWin.accesskey;">
+#else
+          label="&helpMenu.label;" accesskey="&helpMenu.accesskey;">
+#endif
+      <menupopup id="menu_HelpPopup">
+        <menuitem id="menu_openHelp"
+#ifdef XP_MACOSX
+                  label="&openHelpMac2.label;"
+#else
+                  label="&openHelp.label;"
+                  accesskey="&openHelp.accesskey;"
+#endif
+                  key="key_openHelp"
+                  oncommand="openSupportURL();"/>
+      </menupopup>
+    </menu>
   </menubar>
   <browser id="content" disablehistory="true"/>
 </overlay>
--- a/mail/base/jar.mn
+++ b/mail/base/jar.mn
@@ -87,21 +87,19 @@ messenger.jar:
     content/messenger/configEditorOverlay.xul       (content/configEditorOverlay.xul)
     content/messenger/EdSpellCheckOverlay.xul       (content/EdSpellCheckOverlay.xul)
     content/messenger/EdSpellCheckOverlay.js        (content/EdSpellCheckOverlay.js)
     content/messenger/composerOverlay.css           (content/composerOverlay.css)
     content/messenger/threadPane.js                 (content/threadPane.js)
     content/messenger/threadPaneColumnPicker.xml    (content/threadPaneColumnPicker.xml)
     content/messenger/protovis-r2.6-modded.js       (content/protovis-r2.6-modded.js)
 #ifdef XP_MACOSX
-    content/messenger/macMenuOverlay.xul            (content/macMenuOverlay.xul)
     content/messenger/macMessengerOverlay.xul       (content/macMessengerOverlay.xul)
     content/messenger/macMessengerOverlay.js        (content/macMessengerOverlay.js)
 #endif
-*   content/messenger/baseMenuOverlay.xul           (content/baseMenuOverlay.xul)
     content/messenger/selectionsummaries.js         (content/selectionsummaries.js)
     content/messenger/multimessageview.css          (content/multimessageview.css)
     content/messenger/multimessageview_print.css    (content/multimessageview_print.css)
     content/messenger/sharedsummary.css             (content/sharedsummary.css)
     content/messenger/multimessageview.xhtml        (content/multimessageview.xhtml)
     content/messenger/multimessageview.js           (content/multimessageview.js)
     content/messenger/glodaFacetTab.js              (content/glodaFacetTab.js)
     content/messenger/glodaFacetViewWrapper.xul     (content/glodaFacetViewWrapper.xul)
--- a/mail/components/addrbook/content/addressbook.xul
+++ b/mail/components/addrbook/content/addressbook.xul
@@ -3,28 +3,25 @@
 # 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/.
 
 <?xml-stylesheet href="chrome://messenger/content/bindings.css" type="text/css"?>
 <?xml-stylesheet href="chrome://messenger/skin/searchBox.css" type="text/css"?>
 <?xml-stylesheet href="chrome://messenger/skin/addressbook/addressbook.css" type="text/css"?>
 
-#ifdef XP_MACOSX
-<?xul-overlay href="chrome://messenger/content/macMenuOverlay.xul"?>
-#endif
-<?xul-overlay href="chrome://messenger/content/baseMenuOverlay.xul"?>
-
 <!DOCTYPE window [
 <!ENTITY % abMainWindowDTD SYSTEM "chrome://messenger/locale/addressbook/abMainWindow.dtd" >
 %abMainWindowDTD;
 <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
 %brandDTD;
 <!ENTITY % customizeToolbarDTD SYSTEM "chrome://messenger/locale/customizeToolbar.dtd">
 %customizeToolbarDTD;
+<!ENTITY % baseMenuOverlayDTD SYSTEM "chrome://messenger/locale/baseMenuOverlay.dtd">
+%baseMenuOverlayDTD;
 ]>
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:html="http://www.w3.org/1999/xhtml"
     id="addressbookWindow"
     title="&addressbookWindow.title;"
     windowtype="mail:addressbook"
@@ -52,16 +49,19 @@
 <script type="application/javascript" src="chrome://global/content/printUtils.js"/>
 <script type="application/javascript" src="chrome://messenger/content/msgPrintEngine.js"/>
 
 <!-- move needed functions into a single js file -->
 <script type="application/javascript" src="chrome://communicator/content/utilityOverlay.js"/>
 <script type="application/javascript" src="chrome://global/content/nsDragAndDrop.js"/>
 <script type="application/javascript" src="chrome://messenger/content/addressbook/abDragDrop.js"/>
 <script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
+#ifdef XP_MACOSX
+<script type="application/javascript" src="chrome://global/content/macWindowMenu.js"/>
+#endif
 <script type="application/javascript" src="chrome://messenger/content/addressbook/abResultsPane.js"/>
 <script type="application/javascript" src="chrome://messenger/content/addressbook/abCardViewOverlay.js"/>
 <script type="application/javascript" src="chrome://messenger/content/toolbarIconColor.js"/>
 
 <commandset id="addressBook">
   <commandset id="CommandUpdate_AddressBook"
               commandupdater="true"
               events="focus,addrbook-select"
@@ -191,21 +191,23 @@
   <key keycode="VK_F6" oncommand="SwitchPaneFocus(event);" modifiers="shift"/>
   <key keycode="VK_F6" oncommand="SwitchPaneFocus(event);"/>
 
   <key key="&quickSearchCmd.key;" oncommand="QuickSearchFocus();" modifiers="accel"/>
   <key id="key_mail"  key="&messengerCmd.commandkey;" oncommand="toMessengerWindow();" modifiers="accel"/>
 #ifdef XP_MACOSX
   <!-- Mac Window keys -->
   <key id="key_minimizeWindow" command="minimizeWindow" key="&minimizeWindow.key;" modifiers="accel"/>
+  <key id="key_addressbook" key="&addressBookCmd.key;" oncommand="toAddressBook();" modifiers="accel, shift"/>
+  <key id="key_openHelp" oncommand="openSupportURL();" key="&openHelpMac2.commandkey;" modifiers="&openHelpMac2.modifiers;"/>
+#else
+  <key id="key_openHelp" oncommand="openSupportURL();" keycode="&openHelp.commandkey;"/>
 #endif
 </keyset>
 
-<keyset id="baseMenuKeyset"/>
-
 <menupopup id="dirTreeContext" onpopupshowing="updateDirTreeContext();">
   <menuitem id="dirTreeContext-properties"
             command="cmd_properties-contextMenu"/>
   <menuseparator/>
   <menuitem id="dirTreeContext-newcard" label="&newContactButton.label;"
             accesskey="&newContactButton.accesskey;" command="cmd_newCard"/>
   <menuitem id="dirTreeContext-newlist"
             label="&newlistButton.label;"
@@ -571,16 +573,21 @@
           <menupopup id="taskPopup">
 
 
         <!-- Moving the messengerCmd menu item item to the Window menu on the Mac -->
 #ifndef XP_MACOSX
             <menuitem id="tasksMenuMail" accesskey="&messengerCmd.accesskey;"
                       label="&messengerCmd.label;" key="key_mail"
                       oncommand="toMessengerWindow();"/>
+            <menuitem id="tasksMenuAddressBook"
+                      label="&addressBookCmd.label;"
+                      accesskey="&addressBookCmd.accesskey;"
+                      key="key_addressbook"
+                      oncommand="toAddressBook();"/>
             <menuseparator/>
 #endif
             <menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="toImport()"/>
             <menuitem label="&exportCmd.label;"
                       accesskey="&exportCmd.accesskey;"
                       oncommand="AbExportSelection();"/>
 
 #ifndef XP_UNIX
@@ -596,22 +603,21 @@
                       accesskey="&preferencesCmd2.accesskey;"
                       command="cmd_preferences"/>
 #endif
 #endif
           </menupopup>
         </menu>
 
 #ifdef XP_MACOSX
-<!-- Mac window menu -->
-#includesubst @TOOLKIT_DIR@/content/macWindowMenu.inc
+#include ../../../base/content/macWindowMenu.inc
 #endif
 
       <!-- Help -->
-      <menu id="helpMenu"/>
+#include ../../../base/content/helpMenu.inc
     </menubar>
    </toolbaritem>
   </toolbar>
 
   <toolbarpalette id="AddressBookToolbarPalette">
       <toolbarbutton class="toolbarbutton-1" id="button-newcard"
                      label="&newContactButton.label;" command="cmd_newCard"
                      tooltiptext="&newContactButton.tooltip;"/>
--- a/mail/components/compose/content/messengercompose.xul
+++ b/mail/components/compose/content/messengercompose.xul
@@ -3,35 +3,33 @@
 # 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/.
 
 <?xml-stylesheet href="chrome://messenger/content/bindings.css" type="text/css"?>
 <?xml-stylesheet href="chrome://messenger/skin/messengercompose/messengercompose.css" type="text/css"?>
 <?xml-stylesheet href="chrome://messenger/skin/folderMenus.css" type="text/css"?>
 <?xml-stylesheet href="chrome://messenger/skin/attachmentList.css" type="text/css"?>
 <?xul-overlay href="chrome://editor/content/editorOverlay.xul"?>
-#ifdef XP_MACOSX
-<?xul-overlay href="chrome://messenger/content/macMenuOverlay.xul"?>
-#endif
-<?xul-overlay href="chrome://messenger/content/baseMenuOverlay.xul"?>
 <?xul-overlay href="chrome://communicator/content/charsetOverlay.xul"?>
 
 <!DOCTYPE window [
   <!ENTITY % messengercomposeDTD SYSTEM "chrome://messenger/locale/messengercompose/messengercompose.dtd" >
   %messengercomposeDTD;
   <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
   %brandDTD;
   <!ENTITY % charsetDTD SYSTEM "chrome://global/locale/charsetMenu.dtd" >
   %charsetDTD;
   <!ENTITY % customizeToolbarDTD SYSTEM "chrome://messenger/locale/customizeToolbar.dtd">
   %customizeToolbarDTD;
   <!ENTITY % textcontextDTD SYSTEM "chrome://global/locale/textcontext.dtd">
   %textcontextDTD;
   <!ENTITY % viewZoomOverlayDTD SYSTEM "chrome://messenger/locale/viewZoomOverlay.dtd">
   %viewZoomOverlayDTD;
+  <!ENTITY % baseMenuOverlayDTD SYSTEM "chrome://messenger/locale/baseMenuOverlay.dtd">
+  %baseMenuOverlayDTD;
 ]>
 
 <window id="msgcomposeWindow"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:nc="http://home.netscape.com/NC-rdf#"
         onunload="ComposeUnload()"
         onload="ComposeLoad()"
         onclose="return DoCommandClose()"
@@ -63,16 +61,19 @@
 <script type="application/javascript" src="chrome://messenger/content/addressbook/abDragDrop.js"/>
 <script type="application/javascript" src="chrome://global/content/nsDragAndDrop.js"/>
 
 <!-- move needed functions into a single js file -->
 <script type="application/javascript" src="chrome://messenger/content/messengercompose/addressingWidgetOverlay.js"/>
 <script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
 <script type="application/javascript" src="chrome://global/content/contentAreaUtils.js"/>
 <script type="application/javascript" src="chrome://global/content/viewZoomOverlay.js"/>
+#ifdef XP_MACOSX
+<script type="application/javascript" src="chrome://global/content/macWindowMenu.js"/>
+#endif
 <script type="application/javascript" src="chrome://communicator/content/utilityOverlay.js"/>
 <script type="application/javascript" src="chrome://messenger/content/toolbarIconColor.js"/>
 
 <commandset id="composeCommands">
   <commandset id="msgComposeCommandUpdate"
               commandupdater="true"
               events="focus"
               oncommandupdate="CommandUpdate_MsgCompose()"/>
@@ -342,23 +343,23 @@
   <key keycode="VK_F6" oncommand="SwitchElementFocus(event);" modifiers="control"/>
   <key keycode="VK_F6" oncommand="SwitchElementFocus(event);" modifiers="control,shift"/>
   <key keycode="VK_F6" oncommand="SwitchElementFocus(event);" modifiers="shift"/>
   <key keycode="VK_F6" oncommand="SwitchElementFocus(event);"/>
 
 #ifdef XP_MACOSX
   <!-- Mac Window Menu -->
   <key id="key_minimizeWindow" command="minimizeWindow" key="&minimizeWindow.key;" modifiers="accel"/>
+  <key id="key_openHelp" oncommand="openSupportURL();" key="&openHelpMac2.commandkey;" modifiers="&openHelpMac2.modifiers;"/>
+#else
+  <key id="key_openHelp" oncommand="openSupportURL();" keycode="&openHelp.commandkey;"/>
 #endif
-
   <key keycode="VK_ESCAPE" oncommand="handleEsc();"/>
 </keyset>
 
-<keyset id="baseMenuKeyset"/>
-
 <keyset id="editorKeys"/>
 
 <!-- Reorder Attachments Panel -->
 <panel id="reorderAttachmentsPanel"
        backdrag="true"
        orient="vertical"
        type="arrow"
        flip="slide"
@@ -863,22 +864,21 @@
             <menuitem id="menu_preferences" label="&preferencesCmd2.label;" accesskey="&preferencesCmd2.accesskey;"
                       oncommand="openOptionsDialog('paneCompose');"/>
 #endif
 #endif
          </menupopup>
       </menu>
 
 #ifdef XP_MACOSX
-<!-- Mac window menu -->
-#includesubst @TOOLKIT_DIR@/content/macWindowMenu.inc
+#include ../../../base/content/macWindowMenu.inc
 #endif
 
       <!-- Help -->
-      <menu id="helpMenu"/>
+#include ../../../base/content/helpMenu.inc
     </menubar>
    </toolbaritem>
   </toolbar>
 
   <toolbarpalette id="MsgComposeToolbarPalette">
 
     <toolbarbutton class="toolbarbutton-1"
                id="button-send" label="&sendButton.label;"
--- a/mail/locales/en-US/chrome/messenger/addressbook/abMainWindow.dtd
+++ b/mail/locales/en-US/chrome/messenger/addressbook/abMainWindow.dtd
@@ -119,16 +119,19 @@ because displayed names don't have the c
 <!ENTITY sortMenu.accesskey                             "S">
 
 <!-- Tools Menu -->
 <!ENTITY tasksMenu.label                                "Tools">
 <!ENTITY tasksMenu.accesskey                            "T">
 <!ENTITY messengerCmd.label                             "Mail &amp; Newsgroups">
 <!ENTITY messengerCmd.accesskey                         "M">
 <!ENTITY messengerCmd.commandkey                        "1">
+<!ENTITY addressBookCmd.label                           "Address Book">
+<!ENTITY addressBookCmd.accesskey                       "a">
+<!ENTITY addressBookCmd.key                             "B">
 <!ENTITY searchAddressesCmd.label                       "Search Addresses…">
 <!ENTITY searchAddressesCmd.accesskey                   "S">
 <!ENTITY importCmd.label                                "Import…">
 <!ENTITY importCmd.accesskey                            "I">
 <!ENTITY exportCmd.label                                "Export…">
 <!ENTITY exportCmd.accesskey                            "E">
 <!ENTITY preferencesCmd2.label                          "Options">
 <!ENTITY preferencesCmd2.accesskey                      "O">