Bug 494169 Tweak xpfe autocomplete to track toolkit change and pass tests from bug 494410 r=mcsmurf
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Sat, 13 Jun 2009 00:48:41 +0100
changeset 29581 c4cd5cc4d356f7dbb8db0a467570b98c263c9e48
parent 29580 96e297d08b3fcc01ba93c929de23d6436846c615
child 29582 480ff1057204795fb9ef05e9517ed7be12cc1ba7
push id2108
push userclokep@gmail.com
push dateMon, 22 Jan 2018 17:53:55 +0000
treeherdercomm-beta@c44930d8ad9b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcsmurf
bugs494169, 494410
Bug 494169 Tweak xpfe autocomplete to track toolkit change and pass tests from bug 494410 r=mcsmurf
suite/common/autocomplete/resources/content/autocomplete.xml
--- a/suite/common/autocomplete/resources/content/autocomplete.xml
+++ b/suite/common/autocomplete/resources/content/autocomplete.xml
@@ -776,19 +776,20 @@
           this.mFireAfterSearch = false;
           if (this.mNeedToFinish && !this.disableAutoComplete) {
             // set textbox value to either override value, or default search result 
             var val = this.resultsPopup.overrideValue;
             if (val) {
               this.setTextValue(val);
               this.mNeedToFinish = false;
             } else if (this.mTransientValue || 
-                       !(this.forceComplete || this.mDefaultMatchFilled) ||
-                       !(this.forceComplete || aForceComplete) ||
-                       !(this.mNeedToComplete || aForceComplete)) {
+                       !(this.forceComplete ||
+                        (aForceComplete &&
+                         this.mDefaultMatchFilled &&
+                         this.mNeedToComplete))) {
               this.mNeedToFinish = false;
             } else if (this.isWaiting) {
               // if the user typed, the search results are out of date, so let
               // the search finish, and tell it to come back here when it's done
               this.mFinishAfterSearch = true;
               this.mFireAfterSearch = aFireTextCommand;
               return;
             } else {
@@ -921,16 +922,17 @@
           this.stopLookup();
           // stop the queued up lookup on a timer
           this.clearTimer();
 
           if (this.disableAutoComplete)
             return;
 
           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.mAutoCompleteTimer = setTimeout(this.callListener, this.timeout, this, "startLookup");
@@ -979,17 +981,19 @@
               this.clearTimer();
               killEvent = this.mMenuOpen;
               this.undoAutoComplete();
               this.closeResultPopup();
               break;
   
             case KeyEvent.DOM_VK_LEFT:
             case KeyEvent.DOM_VK_RIGHT:
-              this.finishAutoComplete(false, false, aEvent);
+            case KeyEvent.DOM_VK_HOME:
+            case KeyEvent.DOM_VK_END:
+              this.finishAutoComplete(true, false, aEvent);
               this.clearTimer();
               this.closeResultPopup();
               break;
 
             case KeyEvent.DOM_VK_DOWN:
               if (!aEvent.altKey) {
                 this.clearTimer();
                 killEvent = this.keyNavigation(aEvent);