Bug 1523384 - fix double constructor in "searchvalue" binding. r=darktrojan
authoraceman <acelists@atlas.sk>
Mon, 11 Mar 2019 16:57:00 +0100
changeset 32318 706bbea02e7dca0de00183d752fb29c1eff7fad9
parent 32317 9f651d2726f2238eb10d2868ed31f24383fb935c
child 32319 510df913e2d93fd479fea5d7722791f3581a6bcd
push idunknown
push userunknown
push dateunknown
reviewersdarktrojan
bugs1523384
Bug 1523384 - fix double constructor in "searchvalue" binding. r=darktrojan
mail/base/content/mailWidgets.xml
--- a/mail/base/content/mailWidgets.xml
+++ b/mail/base/content/mailWidgets.xml
@@ -1449,26 +1449,16 @@
                         class="search-value-menuitem"/>
         </xul:menupopup>
       </xul:menulist>
       <xul:textbox flex="1" class="search-value-textbox" xbl:inherits="disabled"
                    type="number"/>
       <xul:hbox flex="1" class="search-value-custom" xbl:inherits="disabled"/>
     </content>
     <implementation>
-      <constructor>
-        <![CDATA[
-          // Force initialization of the menulist custom elements first.
-          let items = this.menulist.getElementsByTagNameNS(this.menulist.namespaceURI, "menulist");
-          for (let item of items) {
-            customElements.upgrade(item);
-          }
-        ]]>
-      </constructor>
-
       <field name="internalOperator">null</field>
       <field name="internalAttribute">null</field>
       <field name="internalValue">null</field>
       <property name="opParentValue" onget="return this.internalOperator;">
         <setter>
           <![CDATA[
             // noop if we're not changing it
             if (this.internalOperator == val)
@@ -1754,16 +1744,18 @@
             for (var i = 0; i < len; i++) {
               var node = children[i];
               var stringTag = node.getAttribute("stringTag");
               if (stringTag) {
                 var attr = (node.tagName == "label") ? "value" : "label";
                 node.setAttribute(attr, bundle.GetStringFromName(stringTag));
               }
             }
+            // Force initialization of the menulist custom element.
+            customElements.upgrade(parentNode);
           ]]>
         </body>
       </method>
       <method name="initialize">
         <parameter name="menulist"/>
         <parameter name="bundle"/>
         <body>
           <![CDATA[