Bug 346725 - DOM Inspector menu bar keyboard navigation issue (eliminate empty children of the menubar), r=neil
authorColby Russell <sevenspade@gmail.com>
Wed, 11 Aug 2010 22:12:16 -0500
changeset 961 d940b5d29da3be929d1a8628543cd241d5ab3988
parent 960 a3222031e75b33708ea1df67695927929b21bb04
child 962 eef568e4ee05b819869103117f2c3798d7bed9a5
push id215
push usersevenspade@gmail.com
push dateThu, 12 Aug 2010 03:20:19 +0000
reviewersneil
bugs346725
Bug 346725 - DOM Inspector menu bar keyboard navigation issue (eliminate empty children of the menubar), r=neil
resources/content/inspector.js
resources/content/toolboxOverlay.xul
--- a/resources/content/inspector.js
+++ b/resources/content/inspector.js
@@ -101,16 +101,28 @@ function InspectorApp_initialize()
   }
   inspector.initialize(initNode, initURI);
 
   // Disables the Mac Specific VK_BACK for delete key for non-mac systems
   if (!/Mac/.test(navigator.platform)) {
     document.getElementById("keyEditDeleteMac").setAttribute("disabled",
                                                              "true");
   }
+
+  // Get rid of any menus that we expose as overlay points for integration
+  // with several applications but aren't of use with the one hosting us here.
+  var menubar = document.getElementById("mbrInspectorMain");
+  var kid = menubar.firstChild;
+  while (kid) {
+    let nextSibling = kid.nextSibling;
+    if (!kid.hasChildNodes()) {
+      menubar.removeChild(kid);
+    }
+    kid = nextSibling;
+  }
 }
 
 function InspectorApp_destroy()
 {
   inspector.destroy();
 }
 
 //////////////////////////////////////////////////////////////////////////////
--- a/resources/content/toolboxOverlay.xul
+++ b/resources/content/toolboxOverlay.xul
@@ -23,20 +23,20 @@
           accesskey="&mnSearch.accesskey;">
       <menupopup id="mppSearch"/>
     </menu>
 
     <menu id="mnView" label="&mnView.label;" accesskey="&mnView.accesskey;">
       <menupopup id="mppView"/>
     </menu>
 
-    <menu id="tasksMenu"/> <!-- Seamonkey -->
-    <menu id="windowMenu"/> <!-- Firefox-mac -->
-    <menupopup id="menu_ToolsPopup"/> <!-- Firefox-mac -->
-    <menu id="menu_Help"/> <!-- Seamonkey -->
+    <menu id="tasksMenu"/> <!-- SeaMonkey -->
+    <menu id="windowMenu"/> <!-- Firefox-mac, SeaMonkey -->
+    <menupopup id="menu_ToolsPopup"/> <!-- Mac magic -->
+    <menu id="menu_Help"/> <!-- SeaMonkey -->
     <menu id="helpMenu"/>  <!-- Firefox -->
 
   </menubar>
 
   <toolbar id="tbInspectorPrimary" class="chromeclass-toolbar">
 
     <hbox id="bxURLBar" flex="1">
       <toolbarbutton id="btnSelecting" type="checkbox"