Bug 707039. (Bv1) XPFE autocomplete.xml: Rename resultsPopup to popup. r=neil.
authorSerge Gautherie <sgautherie.bz@free.fr>
Thu, 05 Jan 2012 04:07:19 +0100
changeset 84991 34cbeb81ea8e86d6dc8dd3584bfd25e7d81cb83f
parent 84990 5af79a8f877e7dea6aadb587694cee15c9aadb74
child 84992 314cab6ecbe347e0e2149a8bc477646b85426735
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil
bugs707039
milestone12.0a1
Bug 707039. (Bv1) XPFE autocomplete.xml: Rename resultsPopup to popup. r=neil. DONTBUILD (NPOMCB).
xpfe/components/autocomplete/resources/content/autocomplete.xml
--- a/xpfe/components/autocomplete/resources/content/autocomplete.xml
+++ b/xpfe/components/autocomplete/resources/content/autocomplete.xml
@@ -59,18 +59,18 @@
         
         // initialize the search sessions
         if (this.hasAttribute("autocompletesearch"))
           this.initAutoCompleteSearch();
         if (this.hasAttribute("searchSessions"))
           this.initSearchSessions();
         
         // hack to work around lack of bottom-up constructor calling
-        if ("initialize" in this.resultsPopup)
-          this.resultsPopup.initialize();
+        if ("initialize" in this.popup)
+          this.popup.initialize();
       ]]></constructor>
 
       <destructor><![CDATA[
         this.clearResults(false);
         window.top.removeEventListener("DOMMenuBarActive", this.mMenuBarListener, true);
       ]]></destructor>
       
       <!-- =================== PUBLIC PROPERTIES =================== -->
@@ -168,17 +168,17 @@
                 onset="this.setAttribute('highlightnonmatches', val); return val;"
                 onget="return this.getAttribute('highlightnonmatches') == 'true';"/>
 
       <!-- toggles a second column in the results list which contains
            the string in the comment field of each autocomplete result -->
       <property name="showCommentColumn"
                 onget="return this.getAttribute('showcommentcolumn') == 'true';">
         <setter><![CDATA[
-          this.resultsPopup.showCommentColumn = val;
+          this.popup.showCommentColumn = val;
           this.setAttribute('showcommentcolumn', val); return val;
         ]]></setter>
       </property>
 
                 
       <!-- option for completing to the default result whenever the user hits
            enter or the textbox loses focus -->
       <property name="forceComplete"
@@ -227,17 +227,17 @@
       <!-- state which indicates a search is currently happening -->
       <field name="isSearching">false</field>
 
       <!-- state which indicates a search timeout is current waiting -->
       <property name="isWaiting" 
                 onget="return this.mAutoCompleteTimer != 0;"/>
 
       <!-- reference to the results popup element -->
-      <field name="resultsPopup"><![CDATA[
+      <field name="popup"><![CDATA[
         document.getAnonymousElementByAttribute(this, "anonid", "popup");
       ]]></field>
 
       <!-- nsIAccessibleProvider --> 
       <property name="accessibleType" readonly="true">
         <getter>
           <![CDATA[
             // Will be exposed as nsIAccessible::ROLE_AUTOCOMPLETE
@@ -776,17 +776,17 @@
         <parameter name="aForceComplete"/>
         <parameter name="aFireTextCommand"/>
         <parameter name="aTriggeringEvent"/>
         <body><![CDATA[
           this.mFinishAfterSearch = false;
           this.mFireAfterSearch = false;
           if (this.mNeedToFinish && !this.disableAutoComplete) {
             // set textbox value to either override value, or default search result 
-            var val = this.resultsPopup.overrideValue;
+            var val = this.popup.overrideValue;
             if (val) {
               this.setTextValue(val);
               this.mNeedToFinish = false;
             } else if (this.mTransientValue || 
                        !(this.forceComplete ||
                         (aForceComplete &&
                          this.mDefaultMatchFilled &&
                          this.mNeedToComplete))) {
@@ -849,28 +849,28 @@
         ]]></body>
       </method>
 
       <!--  when the user clicks an entry in the autocomplete popup -->
       <method name="onResultClick">
         <body><![CDATA[
          // set textbox value to either override value, or the clicked result
           var errItem=null;
-          var val = this.resultsPopup.overrideValue;
+          var val = this.popup.overrideValue;
             if (val)
               this.setTextValue(val);
-          else if (this.resultsPopup.selectedIndex != -1) {
-            if (this.getSessionStatusAt(this.resultsPopup.selectedIndex) ==
+          else if (this.popup.selectedIndex != -1) {
+            if (this.getSessionStatusAt(this.popup.selectedIndex) ==
                 Components.interfaces.nsIAutoCompleteStatus.failureItems) {
               this.setTextValue(this.currentSearchString);
               this.mTransientValue = true;
-              errItem = this.getResultAt(this.resultsPopup.selectedIndex);
+              errItem = this.getResultAt(this.popup.selectedIndex);
             } else { 
               this.setTextValue(this.getResultValueAt(
-                                             this.resultsPopup.selectedIndex));
+                                             this.popup.selectedIndex));
             }
           }
 
           if (!this.noMatch)
             this.autoComplete();
 
           this.mNeedToFinish = false;
           this.mNeedToComplete = false;
@@ -933,17 +933,17 @@
 
           this.userAction = "typing";
           this.mFinishAfterSearch = false;
           this.mNeedToFinish = true;
           this.mTransientValue = false;
           this.mNeedToComplete = true;
           var str = this.value;
           this.currentSearchString = str;
-          this.resultsPopup.clearSelection();
+          this.popup.clearSelection();
           
           this.mAutoCompleteTimer = setTimeout(this.callListener, this.timeout, this, "startLookup");
         ]]></body>
       </method>
 
       <!--  -->
       <method name="processKeyPress">
         <parameter name="aEvent"/>
@@ -963,20 +963,20 @@
                 }
               } 
               break;              
               
             case KeyEvent.DOM_VK_RETURN:
 
               // if this is a failure item, save it for fireErrorCommand
               var errItem = null;
-              if (this.resultsPopup.selectedIndex != -1 && 
-                  this.getSessionStatusAt(this.resultsPopup.selectedIndex) ==
+              if (this.popup.selectedIndex != -1 && 
+                  this.getSessionStatusAt(this.popup.selectedIndex) ==
                   Components.interfaces.nsIAutoCompleteStatus.failureItems) {
-                errItem = this.getResultAt(this.resultsPopup.selectedIndex);
+                errItem = this.getResultAt(this.popup.selectedIndex);
               }
 
               killEvent = this.mMenuOpen;
               this.finishAutoComplete(true, true, aEvent);
               this.closePopup();
               if (errItem) {
                   this._fireEvent("errorcommand", errItem);
               }
@@ -1080,17 +1080,17 @@
             this.userAction = "scrolling";
             this.mNeedToComplete = false;
             
             var reverse = k == KeyEvent.DOM_VK_TAB && aEvent.shiftKey ||
                           k == KeyEvent.DOM_VK_UP ||
                           k == KeyEvent.DOM_VK_PAGE_UP;
             var page = k == KeyEvent.DOM_VK_PAGE_UP ||
                        k == KeyEvent.DOM_VK_PAGE_DOWN;
-            var selected = this.resultsPopup.selectBy(reverse, page);
+            var selected = this.popup.selectBy(reverse, page);
           
             // determine which value to place in the textbox
             this.ignoreInputEvent = true;
             if (selected != -1) {
               if (this.getSessionStatusAt(selected) == 
                   Components.interfaces.nsIAutoCompleteStatus.failureItems) { 
                 if (this.currentSearchString)
                   this.setTextValue(this.currentSearchString);
@@ -1166,53 +1166,53 @@
 
       <!--  -->
       <method name="openPopup">
         <body><![CDATA[
           if (!this.mMenuOpen && this.focused &&
                (this.getResultCount() >= this.minResultsForPopup
                 || this.mFailureItems)) {
             var w = this.boxObject.width;
-            if (w != this.resultsPopup.boxObject.width)
-              this.resultsPopup.setAttribute("width", w);
-            this.resultsPopup.showPopup(this, -1, -1, "popup", "bottomleft", "topleft");
+            if (w != this.popup.boxObject.width)
+              this.popup.setAttribute("width", w);
+            this.popup.showPopup(this, -1, -1, "popup", "bottomleft", "topleft");
             this.mMenuOpen = true;
           }
         ]]></body>
       </method>
 
       <!--  -->
       <method name="closePopup">
         <body><![CDATA[
-          if (this.resultsPopup && this.mMenuOpen) {
-            this.resultsPopup.hidePopup();
+          if (this.popup && this.mMenuOpen) {
+            this.popup.hidePopup();
             this.mMenuOpen = false;
           }
         ]]></body>
       </method>
 
       <!--  -->
       <method name="addResultElements">
         <parameter name="aResults"/>
         <parameter name="aOldResults"/>
         <body><![CDATA[
           if (this.focused && this.showPopup) {
             this.view.replaceResults(aResults, aOldResults);
-            this.resultsPopup.adjustHeight();
+            this.popup.adjustHeight();
           }
         ]]></body>
       </method>
 
       <!--  -->
       <method name="clearResultElements">
         <parameter name="aInvalidate"/>
         <body><![CDATA[
           this.view.clearResults();
           if (aInvalidate)
-            this.resultsPopup.adjustHeight();
+            this.popup.adjustHeight();
 
           this.noMatch = true;
         ]]></body>
       </method>
 
       <!--  -->
       <method name="setTextValue">
         <parameter name="aValue"/>
@@ -1691,37 +1691,37 @@
         this.clearSelection();
         this.input = null;
       </handler>
     </handlers>
   </binding>
 
   <binding id="autocomplete-treebody">
     <implementation>
-      <field name="resultsPopup">document.getBindingParent(this);</field>
+      <field name="popup">document.getBindingParent(this);</field>
 
       <field name="mLastMoveTime">Date.now()</field>
     </implementation>
     
     <handlers>
-      <handler event="mouseout" action="this.resultsPopup.selectedIndex = -1;"/>
+      <handler event="mouseout" action="this.popup.selectedIndex = -1;"/>
 
       <handler event="mouseup"><![CDATA[
         var rc = this.parentNode.treeBoxObject.getRowAt(event.clientX, event.clientY);
         if (rc != -1) {
-          this.resultsPopup.selectedIndex = rc;
-          this.resultsPopup.view.handleEnter(true);
+          this.popup.selectedIndex = rc;
+          this.popup.view.handleEnter(true);
         }
       ]]></handler>
 
       <handler event="mousemove"><![CDATA[
         if (Date.now() - this.mLastMoveTime > 30) {
           var rc = this.parentNode.treeBoxObject.getRowAt(event.clientX, event.clientY);
-          if (rc != -1 && rc != this.resultsPopup.selectedIndex) 
-            this.resultsPopup.selectedIndex = rc;
+          if (rc != -1 && rc != this.popup.selectedIndex) 
+            this.popup.selectedIndex = rc;
           this.mLastMoveTime = Date.now();
         }
       ]]></handler>
     </handlers>
   </binding>
 
   <binding id="autocomplete-history-popup"
            extends="chrome://global/content/bindings/popup.xml#popup-scrollbars">