Bug 1388832 - Fix right-click on searchbar when in overflow menu. r=jaws
authorSam Foster <sfoster@mozilla.com>
Tue, 19 Sep 2017 15:40:56 -0700
changeset 431625 72881ce767fcf80e51724c86371312e1b97d1897
parent 431624 bac4881560bfff4e2d06a63aa5663c68d6cac881
child 431626 5340cb842af889e483abed2ee2edc0aeb9327ea3
push id7785
push userryanvm@gmail.com
push dateThu, 21 Sep 2017 13:39:55 +0000
treeherdermozilla-beta@06d4034a8a03 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1388832
milestone57.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 1388832 - Fix right-click on searchbar when in overflow menu. r=jaws * Swap margins for paddings around the searchbar when in a menu. Elements that could precede and follow the searchbar all have margin: 0, and define top/bottom padding as 4px, so this seems reasonable * Harden the loop that looks up a matching ancestor - break before we hit the document MozReview-Commit-ID: LuniL3gdLWR
browser/base/content/browser.js
browser/themes/shared/customizableui/panelUI.inc.css
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -5425,17 +5425,18 @@ function onViewToolbarsPopupShowing(aEve
   // triggerNode can be a nested child element of a toolbaritem.
   let toolbarItem = popup.triggerNode;
 
   if (toolbarItem && toolbarItem.localName == "toolbarpaletteitem") {
     toolbarItem = toolbarItem.firstChild;
   } else if (toolbarItem && toolbarItem.localName != "toolbar") {
     while (toolbarItem && toolbarItem.parentNode) {
       let parent = toolbarItem.parentNode;
-      if ((parent.classList && parent.classList.contains("customization-target")) ||
+      if (parent.nodeType !== Node.ELEMENT_NODE ||
+          (parent.classList && parent.classList.contains("customization-target")) ||
           parent.getAttribute("overflowfortoolbar") || // Needs to work in the overflow list as well.
           parent.localName == "toolbarpaletteitem" ||
           parent.localName == "toolbar")
         break;
       toolbarItem = parent;
     }
   } else {
     toolbarItem = null;
--- a/browser/themes/shared/customizableui/panelUI.inc.css
+++ b/browser/themes/shared/customizableui/panelUI.inc.css
@@ -1617,18 +1617,18 @@ toolbarpaletteitem[place="palette"] > .t
 #bookmarks-menu-button[cui-areatype="menu-panel"] > .toolbarbutton-menu-dropmarker,
 #bookmarks-menu-button[overflowedItem] > .toolbarbutton-menu-dropmarker,
 toolbarpaletteitem[place="palette"] > .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker,
 #bookmarks-menu-button[cui-areatype="menu-panel"] > .toolbarbutton-menubutton-dropmarker {
   display: none;
 }
 
 #search-container[cui-areatype="menu-panel"] {
-  margin-top: 6px;
-  margin-bottom: 6px;
+  padding-top: 6px;
+  padding-bottom: 6px;
 }
 
 toolbarpaletteitem[place="palette"] > #search-container {
   min-width: 7em;
   width: 7em;
   min-height: 37px;
 }