Merge the last green PGO changeset from mozilla-inbound to mozilla-central; a=merge
authorPhil Ringnalda <philringnalda@gmail.com>
Sun, 22 Apr 2012 15:37:28 -0700
changeset 92102 03d6eed81646a0010c3ffacee20210ccdaaa7eb9
parent 92101 ce9fff905894b2d253c4d9cb496e286f6f801d6a (current diff)
parent 92094 4bd6c048e63a22a8807f5aa39d2014dfa84708fc (diff)
child 92103 989503f680bcebc83c21cd963e0ab19bab9773b0
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersmerge
milestone14.0a1
Merge the last green PGO changeset from mozilla-inbound to mozilla-central; a=merge
--- a/xpfe/components/autocomplete/resources/content/autocomplete.xml
+++ b/xpfe/components/autocomplete/resources/content/autocomplete.xml
@@ -72,32 +72,121 @@
           this.popup.initialize();
       ]]></constructor>
 
       <destructor><![CDATA[
         this.clearResults(false);
         window.top.removeEventListener("DOMMenuBarActive", this.mMenuBarListener, true);
         this.mInputElt.controllers.removeController(this.mPasteController);
       ]]></destructor>
-      
+
+      <!-- =================== nsIAccessibleProvider =================== -->
+
+      <property name="accessibleType" readonly="true">
+        <getter>
+          <![CDATA[
+            // Will be exposed as nsIAccessible::ROLE_AUTOCOMPLETE
+            return Components.interfaces.nsIAccessibleProvider.XULCombobox;
+          ]]>
+        </getter>
+      </property>
+
+      <!-- =================== nsIAutoCompleteInput =================== -->
+      <!-- XXX: This implementation is currently incomplete. -->
+
+      <!-- reference to the results popup element -->
+      <field name="popup"><![CDATA[
+        document.getAnonymousElementByAttribute(this, "anonid", "popup");
+      ]]></field>
+
+      <!-- option to turn off autocomplete -->
+      <property name="disableAutoComplete"
+                onset="this.setAttribute('disableautocomplete', val); return val;"
+                onget="return this.getAttribute('disableautocomplete') == 'true';"/>
+
+      <!-- if the resulting match string is not at the beginning of the typed string,
+           this will optionally autofill like this "bar |>> foobar|" -->
+      <property name="completeDefaultIndex"
+                onset="this.setAttribute('completedefaultindex', val); return val;"
+                onget="return this.getAttribute('completedefaultindex') == 'true';"/>
+
+      <!-- option for completing to the default result whenever the user hits
+           enter or the textbox loses focus -->
+      <property name="forceComplete"
+                onset="this.setAttribute('forcecomplete', val); return val;"
+                onget="return this.getAttribute('forcecomplete') == 'true';"/>
+
+      <property name="minResultsForPopup"
+                onset="this.setAttribute('minresultsforpopup', val); return val;"
+                onget="var t = this.getAttribute('minresultsforpopup'); return t ? parseInt(t) : 1;"/>
+
+      <!-- maximum number of rows to display -->
+      <property name="maxRows"
+                onset="this.setAttribute('maxrows', val); return val;"
+                onget="return parseInt(this.getAttribute('maxrows')) || 0;"/>
+
+      <!-- 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.popup.showCommentColumn = val;
+          this.setAttribute('showcommentcolumn', val);
+          return val;
+        ]]></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;"/>
+
+      <!-- =================== nsIDOMXULMenuListElement =================== -->
+
+      <property name="editable" readonly="true"
+                onget="return true;" />
+
+      <property name="crop"
+                onset="this.setAttribute('crop', val); return val;"
+                onget="return this.getAttribute('crop');"/>
+
+      <property name="label" readonly="true"
+                onget="return this.mInputElt.value;"/>
+
+      <property name="open"
+                onget="return this.getAttribute('open') == 'true';">
+        <setter>
+          <![CDATA[
+            var historyPopup = document.getAnonymousElementByAttribute(this, "anonid", "historydropmarker");
+            if (val) {
+              this.setAttribute('open', true);
+              historyPopup.showPopup();
+            } else {
+              this.removeAttribute('open');
+              historyPopup.hidePopup();
+            }
+          ]]>
+        </setter>
+      </property>
+
       <!-- =================== PUBLIC PROPERTIES =================== -->
 
       <property name="value"
                 onget="return this.mInputElt.value;">
         <setter><![CDATA[
           this.ignoreInputEvent = true;
           this.mInputElt.value = val;
           this.ignoreInputEvent = false;
           var event = document.createEvent('Events');
           event.initEvent('ValueChange', true, true);
           this.mInputElt.dispatchEvent(event);
           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') || ''"/>
 
       <method name="initSearchSessions">
         <body><![CDATA[
@@ -140,157 +229,70 @@
             }
           }
         ]]></body>
       </method>
 
       <!-- the number of sessions currently in use -->
       <field name="sessionCount">0</field>
 
-      <!-- number of milliseconds after a keystroke before a search begins -->
-      <property name="timeout"
-                onset="this.setAttribute('timeout', val); return val;"
-                onget="var t = parseInt(this.getAttribute('timeout')); return t ? t : 0;"/>
-
       <!-- number of milliseconds after a paste before a search begins -->
       <property name="pasteTimeout"
                 onset="this.setAttribute('pastetimeout', val); return val;"
                 onget="var t = parseInt(this.getAttribute('pastetimeout')); return t ? t : 0;"/>
 
-      <!-- maximum number of rows to display -->
-      <property name="maxRows"
-                onset="this.setAttribute('maxrows', val); return val;"
-                onget="var t = parseInt(this.getAttribute('maxrows')); return t ? t : 0;"/>
-
       <!-- option for filling the textbox with the best match while typing 
            and selecting the difference -->
       <property name="autoFill"
                 onset="this.setAttribute('autofill', val); return val;"
                 onget="return this.getAttribute('autofill') == 'true';"/>
 
-      <!-- if the resulting match string is not at the beginning of the typed string,
-           this will optionally autofill like this "bar |>> foobar|" -->
-      <property name="completeDefaultIndex"
-                onset="this.setAttribute('completedefaultindex', val); return val;"
-                onget="return this.getAttribute('completedefaultindex') == 'true';"/>
-
       <!--  if this attribute is set, allow different style for 
             non auto-completed lines -->
       <property name="highlightNonMatches"
                 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.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"
-                onset="this.setAttribute('forcecomplete', val); return val;"
-                onget="return this.getAttribute('forcecomplete') == 'true';"/>
-
       <!-- option to show the popup containing the results -->
       <property name="showPopup"
                 onset="this.setAttribute('showpopup', val); return val;"
                 onget="return this.getAttribute('showpopup') == 'true';"/>
 
       <!-- option to allow scrolling through the list via the tab key, rather than
            tab moving focus out of the textbox -->
       <property name="tabScrolling"
                 onset="return this.setAttribute('tabscrolling', val); return val;"
                 onget="return this.getAttribute('tabscrolling') == 'true';"/>
 
-      <!-- option to turn off autocomplete -->
-      <property name="disableAutoComplete"
-                onset="this.setAttribute('disableautocomplete', val); return val;"
-                onget="return this.getAttribute('disableautocomplete') == 'true';"/>
-
       <!-- option to completely ignore any blur events while  
            searches are still going on.  This is useful so that nothing
            gets autopicked if the window is required to lose focus for
            some reason (eg in LDAP autocomplete, another window may be
            brought up so that the user can enter a password to authenticate
            to an LDAP server).  -->
       <property name="ignoreBlurWhileSearching"
                 onset="this.setAttribute('ignoreblurwhilesearching', val); return val;"
                 onget="return this.getAttribute('ignoreblurwhilesearching') == 'true';"/>
 
-      <property name="minResultsForPopup"
-                onset="this.setAttribute('minresultsforpopup', val); return val;"
-                onget="var t = this.getAttribute('minresultsforpopup'); return t ? parseInt(t) : 1;"/>
-      
       <!-- state which indicates the current action being performed by the user.
            Possible values are : none, typing, scrolling -->
       <property name="userAction"
                 onset="this.setAttribute('userAction', val); return val;"
                 onget="return this.getAttribute('userAction');"/>
-      
+
       <!-- state which indicates if the last search had no matches -->
       <field name="noMatch">true</field>
 
       <!-- 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="popup"><![CDATA[
-        document.getAnonymousElementByAttribute(this, "anonid", "popup");
-      ]]></field>
-
-      <!-- nsIAccessibleProvider --> 
-      <property name="accessibleType" readonly="true">
-        <getter>
-          <![CDATA[
-            // Will be exposed as nsIAccessible::ROLE_AUTOCOMPLETE
-            return Components.interfaces.nsIAccessibleProvider.XULCombobox;
-          ]]>
-        </getter>
-      </property>
-
-      <!-- nsIDOMXULMenuListElement properties -->
-
-      <property name="editable" readonly="true" onget="return true;" />  
-
-      <property name="crop" onset="this.setAttribute('crop',val); return val;"
-                            onget="return this.getAttribute('crop');"/>
-
-      <property name="label" readonly="true" onget="return this.mInputElt.value;"/>
-
-      <property name="open">
-        <getter>
-          <![CDATA[
-            return this.getAttribute('open') == 'true';
-          ]]>
-        </getter>
-        <setter>
-          <![CDATA[
-            var historyPopup = document.getAnonymousElementByAttribute(this, "anonid", "historydropmarker");
-            if (val) {
-              this.setAttribute('open',true); 
-              historyPopup.showPopup();
-            }
-            else {
-              this.removeAttribute('open');
-              historyPopup.hidePopup();
-            }
-          ]]>
-        </setter>
-      </property>
-
       <!-- =================== PRIVATE PROPERTIES =================== -->
 
       <field name="mSessions">({})</field>
       <field name="mListeners">({})</field>
       <field name="mLastResults">({})</field>
       <field name="mLastStatus">({})</field>
       <field name="mLastKeyCode">null</field>
       <field name="mAutoCompleteTimer">0</field>
@@ -505,17 +507,17 @@
       </method>
 
       <!-- get the total number of results overall -->
       <method name="getResultCount">
         <body><![CDATA[
           return this.view.rowCount;
         ]]></body>
       </method>
-      
+
       <!-- get a session object by index -->
       <method name="getSession">
         <parameter name="aIndex"/>
         <body><![CDATA[
           var idx = 0;
           for (var name in this.mSessions) {
             if (idx == aIndex)
               return this.mSessions[name];
@@ -603,17 +605,17 @@
         <parameter name="aInvalidate"/>
         <body><![CDATA[
           this.clearResultData();
           this.clearResultElements(aInvalidate);
         ]]></body>
       </method>
 
       <!-- =================== PRIVATE METHODS =================== -->
-  
+
       <!-- ::::::::::::: session searching ::::::::::::: -->
 
       <!--  -->
       <method name="callListener">
         <parameter name="me"/>
         <parameter name="aAction"/>
         <body><![CDATA[
           // bail if the binding was detached or the element removed from
@@ -1488,34 +1490,34 @@
                action="this.userAction = 'typing';"/>
 
       <handler event="blur" phase="capturing"
                action="if ( !(this.ignoreBlurWhileSearching &amp;&amp; this.isSearching) ) {this.userAction = 'none'; this.finishAutoComplete(false, false, event);}"/>
 
       <handler event="mousedown" phase="capturing"
                action="if ( !this.mMenuOpen ) this.finishAutoComplete(false, false, event);"/>
     </handlers>
-  </binding> 
+  </binding>
 
   <binding id="autocomplete-result-popup" extends="chrome://global/content/bindings/popup.xml#popup">
     <resources>
       <stylesheet src="chrome://global/content/autocomplete.css"/>
       <stylesheet src="chrome://global/skin/autocomplete.css"/>
     </resources>
 
     <content ignorekeys="true" level="top">
       <xul:tree anonid="tree" class="autocomplete-tree plain" flex="1">
         <xul:treecols anonid="treecols">
           <xul:treecol class="autocomplete-treecol" id="treecolAutoCompleteValue" flex="2"/>
           <xul:treecol class="autocomplete-treecol" id="treecolAutoCompleteComment" flex="1" hidden="true"/>
         </xul:treecols>
         <xul:treechildren anonid="treebody" class="autocomplete-treebody"/>
       </xul:tree>
     </content>
-    
+
     <implementation implements="nsIAutoCompletePopup">
       <constructor><![CDATA[
         if (this.textbox && this.textbox.view)
           this.initialize();
       ]]></constructor>
 
       <destructor><![CDATA[
         if (this.view)
@@ -1735,17 +1737,17 @@
   </binding>
 
   <binding id="autocomplete-treebody">
     <implementation>
       <field name="popup">document.getBindingParent(this);</field>
 
       <field name="mLastMoveTime">Date.now()</field>
     </implementation>
-    
+
     <handlers>
       <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.popup.selectedIndex = rc;
           this.popup.view.handleEnter(true);
@@ -1764,17 +1766,17 @@
   </binding>
 
   <binding id="autocomplete-history-popup"
            extends="chrome://global/content/bindings/popup.xml#popup-scrollbars">
     <resources>
       <stylesheet src="chrome://global/content/autocomplete.css"/>
       <stylesheet src="chrome://global/skin/autocomplete.css"/>
     </resources>
-    
+
     <implementation>
       <method name="removeOpenAttribute">
         <parameter name="parentNode"/>
         <body><![CDATA[
           parentNode.removeAttribute("open");
         ]]></body>
       </method>
     </implementation>
@@ -1782,30 +1784,30 @@
     <handlers>
       <handler event="popuphiding"><![CDATA[
         setTimeout(this.removeOpenAttribute, 0, this.parentNode);
       ]]></handler>
     </handlers>
   </binding>
 
   <binding id="history-dropmarker" extends="chrome://global/content/bindings/general.xml#dropmarker">
-      
+
     <implementation>
       <method name="showPopup">
         <body><![CDATA[
           var textbox = document.getBindingParent(this);
           var kids = textbox.getElementsByClassName("autocomplete-history-popup");
           if (kids.item(0) && textbox.getAttribute("open") != "true") { // Open history popup
             kids[0].showPopup(textbox, -1, -1, "popup", "bottomleft", "topleft");
             textbox.setAttribute("open", "true");
           }
         ]]></body>
       </method>
     </implementation>
-    
+
     <handlers>
       <handler event="mousedown"><![CDATA[
         this.showPopup();
       ]]></handler>
     </handlers>
   </binding>
 
 </bindings>