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
* Replace the loop that looks for an appropriate trigger node to use element.closest. A click on the outside a toolbarbutton/item was climbing to the document node and throwing as it has no getAttribute method.

MozReview-Commit-ID: LuniL3gdLWR

--HG--
extra : rebase_source : b6f6cfa84b0d388c63bb3feea71100a38e26bb60
This commit is contained in:
Sam Foster 2017-09-19 15:40:56 -07:00
Родитель 767b21fb24
Коммит 1849b01e89
2 изменённых файлов: 4 добавлений и 11 удалений

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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 {