Bug 1053898 - Update inspector to prevent context-menu on slotted elements;r=bgrins
MozReview-Commit-ID: loWAiRBT18
--- a/devtools/client/inspector/inspector.js
+++ b/devtools/client/inspector/inspector.js
@@ -1366,16 +1366,21 @@ Inspector.prototype = {
this._openMenu({
screenX: e.screenX,
screenY: e.screenY,
target: e.target,
});
},
_openMenu: function({ target, screenX = 0, screenY = 0 } = { }) {
+ if (this.selection.isSlotted()) {
+ // Slotted elements should not show any context menu.
+ return null;
+ }
+
let markupContainer = this.markup.getContainer(this.selection.nodeFront);
this.contextMenuTarget = target;
this.nodeMenuTriggerInfo = markupContainer &&
markupContainer.editor.getInfoAtNode(target);
let isSelectionElement = this.selection.isElementNode() &&
!this.selection.isPseudoElementNode();