mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 975719 - Australis - right clicking an empty bit of toolbar shouldn't cause errors, r=jaws
This commit is contained in:
parent
e3ab70f7af
commit
7e3a78ee6f
@ -4243,7 +4243,7 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) {
|
||||
|
||||
if (toolbarItem && toolbarItem.localName == "toolbarpaletteitem") {
|
||||
toolbarItem = toolbarItem.firstChild;
|
||||
} else {
|
||||
} else if (toolbarItem && toolbarItem.localName != "toolbar") {
|
||||
while (toolbarItem && toolbarItem.parentNode) {
|
||||
let parent = toolbarItem.parentNode;
|
||||
if ((parent.classList && parent.classList.contains("customization-target")) ||
|
||||
@ -4253,6 +4253,8 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) {
|
||||
break;
|
||||
toolbarItem = parent;
|
||||
}
|
||||
} else {
|
||||
toolbarItem = null;
|
||||
}
|
||||
|
||||
// Right-clicking on an empty part of the tabstrip will exit
|
||||
|
@ -35,6 +35,41 @@ add_task(function() {
|
||||
yield hiddenPromise;
|
||||
});
|
||||
|
||||
// Right-click on an empty bit of extra toolbar should
|
||||
// show a context menu with moving options disabled,
|
||||
// and a toggle option for the extra toolbar
|
||||
add_task(function() {
|
||||
let contextMenu = document.getElementById("toolbar-context-menu");
|
||||
let shownPromise = contextMenuShown(contextMenu);
|
||||
let toolbar = createToolbarWithPlacements("880164_empty_toolbar", []);
|
||||
toolbar.setAttribute("context", "toolbar-context-menu");
|
||||
toolbar.setAttribute("toolbarname", "Fancy Toolbar for Context Menu");
|
||||
EventUtils.synthesizeMouseAtCenter(toolbar, {type: "contextmenu", button: 2 });
|
||||
yield shownPromise;
|
||||
|
||||
let expectedEntries = [
|
||||
[".customize-context-moveToPanel", false],
|
||||
[".customize-context-removeFromToolbar", false],
|
||||
["---"]
|
||||
];
|
||||
if (!isOSX) {
|
||||
expectedEntries.push(["#toggle_toolbar-menubar", true]);
|
||||
}
|
||||
expectedEntries.push(
|
||||
["#toggle_PersonalToolbar", true],
|
||||
["#toggle_880164_empty_toolbar", true],
|
||||
["---"],
|
||||
[".viewCustomizeToolbar", true]
|
||||
);
|
||||
checkContextMenu(contextMenu, expectedEntries);
|
||||
|
||||
let hiddenPromise = contextMenuHidden(contextMenu);
|
||||
contextMenu.hidePopup();
|
||||
yield hiddenPromise;
|
||||
removeCustomToolbars();
|
||||
});
|
||||
|
||||
|
||||
// Right-click on the urlbar-container should
|
||||
// show a context menu with disabled options to move it.
|
||||
add_task(function() {
|
||||
|
Loading…
Reference in New Issue
Block a user