Bug 500977 - xpfe's autocomplete.xml should not depend on bug 232598. r=neil
authorDão Gottwald <dao@mozilla.com>
Sun, 28 Jun 2009 21:21:35 +0200
changeset 22674 480ff1057204795fb9ef05e9517ed7be12cc1ba7
parent 22673 c4cd5cc4d356f7dbb8db0a467570b98c263c9e48
child 22675 0d857a5c72d29a4507f5a85e7e741b84d11cd306
push id13793
push userfrgrahl@gmx.net
push dateMon, 27 Nov 2017 16:30:48 +0000
treeherdercomm-central@85eb5dd6d56a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil
bugs500977, 232598
Bug 500977 - xpfe's autocomplete.xml should not depend on bug 232598. r=neil
suite/common/autocomplete/resources/content/autocomplete.xml
--- a/suite/common/autocomplete/resources/content/autocomplete.xml
+++ b/suite/common/autocomplete/resources/content/autocomplete.xml
@@ -87,21 +87,21 @@
           return val;
         ]]></setter>
       </property>
   
       <property name="focused"
                 onget="return this.getAttribute('focused') == 'true';"/>
 
       <!-- space-delimited string of search session types to use -->
-      <property name="searchSessions" readonly="true" onget="return this.getAttribute('searchSessions')"/>
+      <property name="searchSessions" readonly="true" onget="return this.getAttribute('searchSessions') || ''"/>
 
       <method name="initSearchSessions">
         <body><![CDATA[
-          var list = this.getAttribute("searchSessions").split(" ");
+          var list = this.searchSessions.split(" ");
           for (var i = 0; i < list.length; i++) {
             var name = list[i];
             var contractid = "@mozilla.org/autocompleteSession;1?type=" + name;
             if (contractid in Components.classes) {
               try {
                 var session =
                   Components.classes[contractid].getService(Components.interfaces.nsIAutoCompleteSession);
                 this.addSession(session, name);
@@ -309,17 +309,17 @@
 
       <field name="mAutoCompleteSession"><![CDATA[
         var session = function(aSession) { this.session = aSession };
         session.prototype = {
           session: null,
           param: this,
           onStartLookup: function(aSearchString, aPreviousSearchResult, aListener) {
             this.session.startSearch(aSearchString,
-                         this.param.getAttribute("autocompletesearchparam"),
+                         this.param.getAttribute("autocompletesearchparam") || "",
                          aPreviousSearchResult && aPreviousSearchResult.lastResult,
                          aListener);
           },
           onStopLookup: function() {
             this.session.stopSearch();
           },
           onAutoComplete: function() {
           }
@@ -1247,17 +1247,17 @@
 
       <!-- ::::::::::::: miscellaneous ::::::::::::: -->
 
       <!--  -->
       <method name="ifSetAttribute">
         <parameter name="aAttr"/>
         <parameter name="aVal"/>
         <body><![CDATA[
-          if (this.getAttribute(aAttr) == "")
+          if (!this.hasAttribute(aAttr))
             this.setAttribute(aAttr, aVal);
         ]]></body>
       </method>
 
       <!--  -->
       <method name="clearTimer">
         <parameter name=""/>
         <body><![CDATA[