Bug 1341019 - Fix undef item variable in _onChanged(). r=standard8
authorRay Lin <ralin@mozilla.com>
Mon, 20 Feb 2017 21:55:37 +0800
changeset 373719 f7d197ff438ef92df51eacd93a731c41d9928612
parent 373718 652362fc7c1be1dee748f936593f61800da62777
child 373720 bf5321028381ba70172df0bacc3c0a713901bf71
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstandard8
bugs1341019
milestone54.0a1
Bug 1341019 - Fix undef item variable in _onChanged(). r=standard8 MozReview-Commit-ID: 1WrioG5O0Np
toolkit/content/widgets/autocomplete.xml
--- a/toolkit/content/widgets/autocomplete.xml
+++ b/toolkit/content/widgets/autocomplete.xml
@@ -1369,20 +1369,20 @@ extends="chrome://global/content/binding
               item.collapsed = false;
             } else {
               // set the class at the end so we can use the attributes
               // in the xbl constructor
               item.className = "autocomplete-richlistitem";
               this.richlistbox.appendChild(item);
             }
 
-            if (typeof item.onChanged == "function") {
+            if (typeof item._onChanged == "function") {
               // The binding may have not been applied yet.
               setTimeout(() => {
-                item.onChanged();
+                item._onChanged();
               }, 0);
             }
 
             this._currentIndex++;
           }
 
           if (typeof this.onResultsAdded == "function")
             this.onResultsAdded();
@@ -2042,20 +2042,21 @@ extends="chrome://global/content/binding
           return this._textToSubURI.unEscapeURIForUI("UTF-8", url);
           ]]>
         </body>
       </method>
 
       <method name="_onChanged">
         <body>
           <![CDATA[
-            let iconChanged = item.adjustSiteIconStart(this.popup._siteIconStart);
+            let popup = this.parentNode.parentNode;
+            let iconChanged = this.adjustSiteIconStart(popup._siteIconStart);
 
             if (iconChanged) {
-              item.handleOverUnderflow();
+              this.handleOverUnderflow();
             }
           ]]>
         </body>
       </method>
 
 
       <method name="_reuseAcItem">
         <body>