Bug 1410821 - Call startSearch again when the new search string could not hit the cached result. r=mak
MozReview-Commit-ID: 1AJutt4IA0E
--- 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) {