зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1704875 - For now, keep synthesizing events on menus if a mouse button is set. r=robwu
This capability is used by browser_ext_menus_capture_secondary_click.js, which checks that the mouse button is correctly propagated when clicking menu items. Once bug 1704879 is fixed and activateItem supports specifying a mouse button, we can revert this patch again. Differential Revision: https://phabricator.services.mozilla.com/D111901
This commit is contained in:
Родитель
06db1fec76
Коммит
6278623835
|
@ -509,7 +509,12 @@ async function closeExtensionContextMenu(itemToSelect, modifiers = {}) {
|
|||
"popuphidden"
|
||||
);
|
||||
if (itemToSelect) {
|
||||
itemToSelect.closest("menupopup").activateItem(itemToSelect, modifiers);
|
||||
if ("button" in modifiers) {
|
||||
// Bug 1704879: activateItem does not currently support button
|
||||
EventUtils.synthesizeMouseAtCenter(itemToSelect, modifiers);
|
||||
} else {
|
||||
itemToSelect.closest("menupopup").activateItem(itemToSelect, modifiers);
|
||||
}
|
||||
} else {
|
||||
contentAreaContextMenu.hidePopup();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче