Bug 1550827 - Fix debugger XUL popup creation logic r=jlast
authorJulian Descottes <jdescottes@mozilla.com>
Sun, 12 May 2019 18:51:09 +0000
changeset 535437 3a4913c11d873988958f0ecae58ab4ec90265884
parent 535432 4b3945b758896f5153e61a1b84a2b3614a98021a
child 535438 b6f4ce748f196ca35e952bf6d85975d92d2b847a
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1550827
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1550827 - Fix debugger XUL popup creation logic r=jlast Differential Revision: https://phabricator.services.mozilla.com/D30741
devtools/client/debugger/dist/vendors.js
--- a/devtools/client/debugger/dist/vendors.js
+++ b/devtools/client/debugger/dist/vendors.js
@@ -1429,37 +1429,37 @@ module.exports = {
   workerHandler
 };
 
 /***/ }),
 
 /***/ 15:
 /***/ (function(module, exports) {
 
-var g;
-
-// This works in non-strict mode
-g = (function() {
-	return this;
-})();
-
-try {
-	// This works if eval is allowed (see CSP)
-	g = g || Function("return this")() || (1,eval)("this");
-} catch(e) {
-	// This works if the window reference is available
-	if(typeof window === "object")
-		g = window;
-}
-
-// g can still be undefined, but nothing to do about it...
-// We return undefined, instead of nothing here, so it's
-// easier to handle this case. if(!global) { ...}
-
-module.exports = g;
+var g;
+
+// This works in non-strict mode
+g = (function() {
+	return this;
+})();
+
+try {
+	// This works if eval is allowed (see CSP)
+	g = g || Function("return this")() || (1,eval)("this");
+} catch(e) {
+	// This works if the window reference is available
+	if(typeof window === "object")
+		g = window;
+}
+
+// g can still be undefined, but nothing to do about it...
+// We return undefined, instead of nothing here, so it's
+// easier to handle this case. if(!global) { ...}
+
+module.exports = g;
 
 
 /***/ }),
 
 /***/ 183:
 /***/ (function(module, exports, __webpack_require__) {
 
 "use strict";
@@ -1851,38 +1851,38 @@ TabPanels.defaultProps = {
   className: null
 };
 
 /***/ }),
 
 /***/ 22:
 /***/ (function(module, exports) {
 
-module.exports = function(module) {
-	if(!module.webpackPolyfill) {
-		module.deprecate = function() {};
-		module.paths = [];
-		// module.parent = undefined by default
-		if(!module.children) module.children = [];
-		Object.defineProperty(module, "loaded", {
-			enumerable: true,
-			get: function() {
-				return module.l;
-			}
-		});
-		Object.defineProperty(module, "id", {
-			enumerable: true,
-			get: function() {
-				return module.i;
-			}
-		});
-		module.webpackPolyfill = 1;
-	}
-	return module;
-};
+module.exports = function(module) {
+	if(!module.webpackPolyfill) {
+		module.deprecate = function() {};
+		module.paths = [];
+		// module.parent = undefined by default
+		if(!module.children) module.children = [];
+		Object.defineProperty(module, "loaded", {
+			enumerable: true,
+			get: function() {
+				return module.l;
+			}
+		});
+		Object.defineProperty(module, "id", {
+			enumerable: true,
+			get: function() {
+				return module.i;
+			}
+		});
+		module.webpackPolyfill = 1;
+	}
+	return module;
+};
 
 
 /***/ }),
 
 /***/ 35:
 /***/ (function(module, exports) {
 
 // shim for using process in browser
@@ -2820,57 +2820,61 @@ Menu.prototype.popup = function (screenX
     }
   });
 
   popupset.appendChild(popup);
   popup.openPopupAtScreen(screenX, screenY, true);
 };
 
 Menu.prototype.createPopup = function (doc) {
-  return doc.createElement("menupopup");
+  const popup = doc.createXULElement("menupopup");
+  popup.setAttribute("menu-api", "true");
+  popup.setAttribute("consumeoutsideclicks", "false");
+  popup.setAttribute("incontentshell", "false");
+  return popup;
 };
 
 Menu.prototype._createMenuItems = function (parent) {
   let doc = parent.ownerDocument;
   this.menuitems.forEach(item => {
     if (!item.visible) {
       return;
     }
 
     if (item.submenu) {
-      let menupopup = doc.createElement("menupopup");
+      let menupopup = doc.createXULElement("menupopup");
       item.submenu._createMenuItems(menupopup);
 
-      let menuitem = doc.createElement("menuitem");
+      let menuitem = doc.createXULElement("menuitem");
       menuitem.setAttribute("label", item.label);
       if (!inToolbox()) {
         menuitem.textContent = item.label;
       }
 
-      let menu = doc.createElement("menu");
+      let menu = doc.createXULElement("menu");
       menu.appendChild(menuitem);
       menu.appendChild(menupopup);
       if (item.disabled) {
         menu.setAttribute("disabled", "true");
       }
       if (item.accesskey) {
         menu.setAttribute("accesskey", item.accesskey);
       }
       if (item.id) {
         menu.id = item.id;
       }
       if (item.accelerator) {
         menuitem.setAttribute("acceltext", formatKeyShortcut(item.accelerator));
       }
       parent.appendChild(menu);
     } else if (item.type === "separator") {
-      let menusep = doc.createElement("menuseparator");
+      let menusep = doc.createXULElement("menuseparator");
       parent.appendChild(menusep);
     } else {
-      let menuitem = doc.createElement("menuitem");
+      let menuitem = doc.createXULElement("menuitem");
       menuitem.setAttribute("label", item.label);
 
       if (!inToolbox()) {
         menuitem.textContent = item.label;
       }
 
       menuitem.addEventListener("command", () => item.click());