Bug 747668. (Bv1) Port |Bug 418712 - nsIAutoCompleteInput should fire an event when a search begins| to SeaMonkey. r=neil.
authorSerge Gautherie <sgautherie.bz@free.fr>
Mon, 23 Apr 2012 01:28:55 +0200
changeset 95417 f4d242fc253498c472f52c88833cd935486c0eba
parent 95416 989503f680bcebc83c21cd963e0ab19bab9773b0
child 95418 bd9cdcd353e63ea3a1a0e22e937a1c180480aa64
child 95421 133c3b95125fc89138885f6ee4cd46d35739ea4f
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil
bugs747668, 418712
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 747668. (Bv1) Port |Bug 418712 - nsIAutoCompleteInput should fire an event when a search begins| to SeaMonkey. r=neil. DONTBUILD (a=npotb).
xpfe/components/autocomplete/resources/content/autocomplete.xml
--- a/xpfe/components/autocomplete/resources/content/autocomplete.xml
+++ b/xpfe/components/autocomplete/resources/content/autocomplete.xml
@@ -134,16 +134,22 @@
         ]]></setter>
       </property>
 
       <!-- number of milliseconds after a keystroke before a search begins -->
       <property name="timeout"
                 onset="this.setAttribute('timeout', val); return val;"
                 onget="return parseInt(this.getAttribute('timeout')) || 0;"/>
 
+      <method name="onSearchBegin">
+        <body><![CDATA[
+          this._fireEvent("searchbegin");
+        ]]></body>
+      </method>
+
       <!-- =================== nsIDOMXULMenuListElement =================== -->
 
       <property name="editable" readonly="true"
                 onget="return true;" />
 
       <property name="crop"
                 onset="this.setAttribute('crop', val); return val;"
                 onget="return this.getAttribute('crop');"/>
@@ -655,16 +661,19 @@
           }
 
           this.isSearching = true;
           this.mFirstReturn = true;
           this.mSessionReturns = this.sessionCount;
           this.mFailureItems = 0;
           this.mDefaultMatchFilled = false; // clear out our prefill state.
 
+          // Notify the input that the search is beginning.
+          this.onSearchBegin();
+
           // tell each session to start searching...
           for (var name in this.mSessions)
             try {
               this.mSessions[name].onStartLookup(str, this.mLastResults[name], this.mListeners[name]);
             } catch (e) {
               --this.mSessionReturns;
               this.searchFailed();
             }