Bug 1341019 - Fix undef item variable in _onChanged(). r=standard8 draft
authorRay Lin <ralin@mozilla.com>
Mon, 20 Feb 2017 21:55:37 +0800
changeset 489018 6cb932ff080beaf034a763b5cb31812fc2e4dab6
parent 489001 69d2cf007cdc13cf2bd33370b1732d4f969fd9af
child 546918 fd00d8ba6f376de26878f1d3f630766798f464de
push id46733
push userbmo:ralin@mozilla.com
push dateFri, 24 Feb 2017 08:57:51 +0000
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>