Bug 1557979 - Port bug 1505909: Replace use of buildAndAddToPopup(). rs=bustage-fix
authorJorg K <jorgk@jorgk.com>
Sun, 09 Jun 2019 00:49:51 +0200
changeset 35805 6e3ad4974173c6c96e493bbaf746750162fcc3e4
parent 35804 e5ed77a2a024206e348ebc9ea509d95cee64382b
child 35806 8980d7fbb2580cd41ec71f5f8245abd849b42a7a
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersbustage-fix
bugs1557979, 1505909
Bug 1557979 - Port bug 1505909: Replace use of buildAndAddToPopup(). rs=bustage-fix
mail/base/content/msgMail3PaneWindow.js
mail/base/content/nsContextMenu.js
--- a/mail/base/content/msgMail3PaneWindow.js
+++ b/mail/base/content/msgMail3PaneWindow.js
@@ -1454,17 +1454,18 @@ function ThreadPaneOnDrop(aEvent) {
  *
  * @param menuPopup the menupopup element
  * @param event the event responsible for showing the popup
  */
 function InitPageMenu(menuPopup, event) {
   if (event.target != menuPopup)
     return;
 
-  PageMenuParent.buildAndAddToPopup(menuPopup.triggerNode, menuPopup);
+  let menuObject = PageMenuParent.maybeBuild(menuPopup.triggerNode);
+  PageMenuParent.addToPopup(menuObject, null, menuPopup);
 
   if (menuPopup.children.length == 0)
     event.preventDefault();
 }
 
 var TabsInTitlebar = {
   init() {
     this._readPref();
--- a/mail/base/content/nsContextMenu.js
+++ b/mail/base/content/nsContextMenu.js
@@ -76,18 +76,18 @@ nsContextMenu.prototype = {
       this.shouldDisplay = false;
       return;
     }
 
     this.isContentSelected = this.isContentSelection();
 
     this.hasPageMenu = false;
     if (!aIsShift) {
-      this.hasPageMenu = PageMenuParent.buildAndAddToPopup(this.target,
-                                                           aPopup);
+      let menuObject = PageMenuParent.maybeBuild(this.target);
+      PageMenuParent.addToPopup(menuObject, null, aPopup);
 
       let subject = {
         menu: aPopup,
         tab: document.getElementById("tabmail") ?
              document.getElementById("tabmail").currentTabInfo : undefined,
         isContentSelected: this.isContentSelected,
         inFrame: this.inFrame,
         isTextSelected: this.isTextSelected,