Bug 1463860 - Don't play a beep when the find string is not find when Whole Word matching is enabled; it simply beeps too much. r?ehsan draft bug-1463860
authorMike de Boer <mdeboer@mozilla.com>
Fri, 13 Jul 2018 13:25:02 +0200
changeset 817725 83aecdb2656b372b7b7bb35014f9f35e22043872
parent 817669 e951f4ad123aa87d1d392c286db14cabb41a8560
push id116149
push usermdeboer@mozilla.com
push dateFri, 13 Jul 2018 11:25:45 +0000
reviewersehsan
bugs1463860
milestone63.0a1
Bug 1463860 - Don't play a beep when the find string is not find when Whole Word matching is enabled; it simply beeps too much. r?ehsan MozReview-Commit-ID: S6dvbV5Q5d
toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
--- a/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
+++ b/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
@@ -1125,18 +1125,18 @@ nsTypeAheadFind::Find(const nsAString& a
         RefPtr<nsRange> startFindRange = selection->GetRangeAt(0);
         if (startFindRange) {
           mStartFindRange = startFindRange->CloneRange();
         }
       }
     }
   }
   else {
-    // Error sound
-    if (mTypeAheadBuffer.Length() > mLastFindLength)
+    // Error sound, except when whole word matching is ON.
+    if (!mEntireWord && mTypeAheadBuffer.Length() > mLastFindLength)
       PlayNotFoundSound();
   }
 
   SaveFind();
   return NS_OK;
 }
 
 void