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
--- 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
@@ -1607,18 +1607,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;
}