Bug 717111 - Plain text editor context menu broken (regression from bug 702019). r+a=IanN
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Fri, 20 Jan 2012 23:52:20 +0000
changeset 10120 ed09e1575902553d5cd654fef10f92955b1142ce
parent 10119 d27f4570cdce5d99b01eeff525c6f5f3d9c1f6b6
child 10121 da70672b466aa1ce1c30a8f0d939c03d81826f9b
push idunknown
push userunknown
push dateunknown
bugs717111, 702019
Bug 717111 - Plain text editor context menu broken (regression from bug 702019). r+a=IanN
suite/common/contentAreaContextOverlay.xul
suite/common/nsContextMenu.js
--- a/suite/common/contentAreaContextOverlay.xul
+++ b/suite/common/contentAreaContextOverlay.xul
@@ -56,17 +56,17 @@
 
   <popupset id="contentAreaContextSet">
     <!-- This is a generic context menu for a content area. It contains
          each and every possible menu choice.  The appropriate items are
          hidden/shown upon display, based on what the user has clicked-on.
      -->
     <menupopup id="contentAreaContextMenu"
                pagemenu="start"
-               onpopupshowing="if (event.target != this) return true; gContextMenu = new nsContextMenu(this, gBrowser, event.shiftKey); return gContextMenu.shouldDisplay;"
+               onpopupshowing="if (event.target != this) return true; gContextMenu = new nsContextMenu(this, null, event.shiftKey); return gContextMenu.shouldDisplay;"
                onpopuphiding="if (event.target == this) gContextMenu = null;">
       <menuseparator id="page-menu-separator"/>
       <menuitem id="popupwindow-reject"
                 label="&popupWindowRejectCmd.label;"
                 accesskey="&popupWindowRejectCmd.accesskey;"
                 oncommand="gContextMenu.rejectPopupWindows(event.shiftKey);"/>
       <menuitem id="popupwindow-allow"
                 label="&popupWindowAllowCmd.label;"
--- a/suite/common/nsContextMenu.js
+++ b/suite/common/nsContextMenu.js
@@ -70,17 +70,18 @@ nsContextMenu.prototype = {
     // Get contextual info.
     this.setTarget(document.popupNode, document.popupRangeParent,
                    document.popupRangeOffset);
 
     if (!this.shouldDisplay)
       return;
 
     this.hasPageMenu = false;
-    if (!aIsShift && aXulMenu.hasAttribute("pagemenu"))
+    if (!aIsShift && this.browser.docShell.allowJavascript &&
+        Services.prefs.getBoolPref("javascript.enabled"))
       this.hasPageMenu = PageMenu.maybeBuildAndAttachMenu(this.target,
                                                           aXulMenu);
 
     this.isTextSelected = this.isTextSelection();
     this.isContentSelected = this.isContentSelection();
 
     this.initPopupURL();