diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 7bff68841b90..e27f0f9c5515 100755 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -5428,15 +5428,8 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) { 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")) || - parent.getAttribute("overflowfortoolbar") || // Needs to work in the overflow list as well. - parent.localName == "toolbarpaletteitem" || - parent.localName == "toolbar") - break; - toolbarItem = parent; - } + toolbarItem = toolbarItem.closest( + ".customization-target, [overflowfortoolbar], toolbarpaletteitem, toolbar"); } else { toolbarItem = null; } diff --git a/browser/themes/shared/customizableui/panelUI.inc.css b/browser/themes/shared/customizableui/panelUI.inc.css index 2e2529aa7522..f8cb77f6e4f0 100644 --- a/browser/themes/shared/customizableui/panelUI.inc.css +++ b/browser/themes/shared/customizableui/panelUI.inc.css @@ -1622,8 +1622,8 @@ toolbarpaletteitem[place="palette"] > .toolbarbutton-1 > .toolbarbutton-menubutt } #search-container[cui-areatype="menu-panel"] { - margin-top: 6px; - margin-bottom: 6px; + padding-top: 6px; + padding-bottom: 6px; } toolbarpaletteitem[place="palette"] > #search-container {