Bug 1584122 - Fix "no template detection" in MozRuleactiontargetForwardto, take 3. r=pmorris a=jorgk
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Thu, 03 Oct 2019 15:46:34 +0200
changeset 36686 47ae0b1a94434a05537a440ca3e94dc8fe4507d5
parent 36685 c0aec565926568e418d44e269083e373b8a2b6de
child 36687 ce699666af457239c2cf9848e2d9608176eaad34
push id394
push userclokep@gmail.com
push dateMon, 21 Oct 2019 20:22:01 +0000
reviewerspmorris, jorgk
bugs1584122
Bug 1584122 - Fix "no template detection" in MozRuleactiontargetForwardto, take 3. r=pmorris a=jorgk Ported one more hunk from https://hg.mozilla.org/comm-central/rev/aab0650cbf1d
mailnews/base/search/content/searchWidgets.js
--- a/mailnews/base/search/content/searchWidgets.js
+++ b/mailnews/base/search/content/searchWidgets.js
@@ -100,25 +100,24 @@
       const menuPopup = document.createXULElement("menupopup");
 
       menulist.classList.add("ruleactionitem");
       menulist.setAttribute("flex", "1");
       menulist.appendChild(menuPopup);
 
       this.appendChild(menulist);
 
-      document
-        .getAnonymousElementByAttribute(
-          this.closest(".ruleaction"),
-          "is",
-          "ruleactiontype-menulist"
-        )
-        .getTemplates(true, menulist);
-
-      updateParentNode(this.closest(".ruleaction"));
+      let ruleaction = this.closest(".ruleaction");
+      let raMenulist = ruleaction.querySelector(
+        '[is="ruleactiontype-menulist"]'
+      );
+      for (let { label, value } of raMenulist.findTemplates()) {
+        menulist.appendItem(label, value);
+      }
+      updateParentNode(ruleaction);
     }
   }
 
   class MozRuleactiontargetForwardto extends MozXULElement {
     connectedCallback() {
       const textbox = document.createXULElement("textbox");
 
       textbox.classList.add("ruleactionitem");