Bug 1410821 - Call startSearch again when the new search string could not hit the cached result. r=mak
authorRay Lin <ralin@mozilla.com>
Fri, 03 Nov 2017 15:22:45 +0800
changeset 444326 c58e3a20c6f151a1f45c593bf0b342cd9262d98c
parent 444325 4be8afd896458fae76dc2eacf813a5eaa26db483
child 444327 4c25a8edd5db8f8f2bfbbe51f1050ef48d495659
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1410821
milestone58.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 1410821 - Call startSearch again when the new search string could not hit the cached result. r=mak MozReview-Commit-ID: 1AJutt4IA0E
toolkit/components/autocomplete/nsAutoCompleteController.cpp
--- a/toolkit/components/autocomplete/nsAutoCompleteController.cpp
+++ b/toolkit/components/autocomplete/nsAutoCompleteController.cpp
@@ -557,18 +557,21 @@ nsAutoCompleteController::HandleKeyNavig
         input->GetTextValue(text);
         input->GetSelectionStart(&start);
         input->GetSelectionEnd(&end);
         if (start != end || end < (int32_t)text.Length())
           *_retval = false;
       }
 #endif
       if (*_retval) {
+        nsAutoString oldSearchString;
         // Open the popup if there has been a previous search, or else kick off a new search
-        if (!mResults.IsEmpty()) {
+        if (!mResults.IsEmpty() &&
+            NS_SUCCEEDED(mResults[0]->GetSearchString(oldSearchString)) &&
+            oldSearchString.Equals(mSearchString, nsCaseInsensitiveStringComparator())) {
           if (mRowCount) {
             OpenPopup();
           }
         } else {
           // Stop all searches in case they are async.
           StopSearch();
 
           if (!mInput) {