зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1515265: Call stopPropagation() and preventDefault() at all places where handle contextmenu event and show the popup. r=jdescottes
Depends on D17457 Differential Revision: https://phabricator.services.mozilla.com/D17458 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
2da37d4512
Коммит
5c08fb9ef5
|
@ -695,6 +695,10 @@ CssComputedView.prototype = {
|
|||
* Context menu handler.
|
||||
*/
|
||||
_onContextMenu: function(event) {
|
||||
// Call stopPropagation() and preventDefault() here so that avoid to show default
|
||||
// context menu in about:devtools-toolbox. See Bug 1515265.
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
this.contextMenu.show(event);
|
||||
},
|
||||
|
||||
|
|
|
@ -1213,6 +1213,10 @@ InplaceEditor.prototype = {
|
|||
|
||||
_onContextMenu: function(event) {
|
||||
if (this.contextMenu) {
|
||||
// Call stopPropagation() and preventDefault() here so that avoid to show default
|
||||
// context menu in about:devtools-toolbox. See Bug 1515265.
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
this.contextMenu(event);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -416,6 +416,10 @@ SideMenuWidget.prototype = {
|
|||
node = node.parentNode;
|
||||
}
|
||||
|
||||
// Call stopPropagation() and preventDefault() here so that avoid to show default
|
||||
// context menu in about:devtools-toolbox. See Bug 1515265.
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
this._contextMenu.openPopupAtScreen(e.screenX, e.screenY, true);
|
||||
},
|
||||
|
||||
|
|
|
@ -127,6 +127,10 @@ TreeWidget.prototype = {
|
|||
this.root = new TreeItem(this.document);
|
||||
if (this.contextMenuId) {
|
||||
this.root.children.addEventListener("contextmenu", (event) => {
|
||||
// Call stopPropagation() and preventDefault() here so that avoid to show default
|
||||
// context menu in about:devtools-toolbox. See Bug 1515265.
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
const menu = this.document.getElementById(this.contextMenuId);
|
||||
menu.openPopupAtScreen(event.screenX, event.screenY, true);
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче