Bug 755480 - Part 1: Stop looking for a useless dot; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 15 May 2012 16:34:04 -0400
changeset 94272 44731e4787f0ff522a9f54eb145406187a0109b8
parent 94271 7af988cb3ad9642bdacf4eb2eb59dd797417e1a3
child 94273 7b6dd63e140001c87ce43f92706404b28ac53b4e
push id9549
push usereakhgari@mozilla.com
push dateFri, 18 May 2012 00:09:16 +0000
treeherdermozilla-inbound@942b6e232d80 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs755480
milestone15.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 755480 - Part 1: Stop looking for a useless dot; r=roc
extensions/spellcheck/src/mozInlineSpellWordUtil.cpp
--- a/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp
+++ b/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp
@@ -917,19 +917,16 @@ WordSplitState::AdvanceThroughWord()
 PRInt32
 WordSplitState::FindSpecialWord()
 {
   PRInt32 i;
 
   // Search for email addresses. We simply define these as any sequence of
   // characters with an '@' character in the middle. The DOM word is already
   // split on whitepace, so we know that everything to the end is the address
-  //
-  // Also look for periods, this tells us if we want to run the URL finder.
-  bool foundDot = false;
   PRInt32 firstColon = -1;
   for (i = mDOMWordOffset;
        i < PRInt32(mDOMWordText.Length()); i ++) {
     if (mDOMWordText[i] == '@') {
       // only accept this if there are unambiguous word characters (don't bother
       // recursing to disambiguate apostrophes) on each side. This prevents
       // classifying, e.g. "@home" as an email address
 
@@ -939,20 +936,16 @@ WordSplitState::FindSpecialWord()
       // symbol, but when you type another letter "fhsgfh@g" that first word
       // need to be unmarked misspelled. It doesn't do this. it only checks the
       // current position for potentially removing a spelling range.
       if (i > 0 && ClassifyCharacter(i - 1, false) == CHAR_CLASS_WORD &&
           i < (PRInt32)mDOMWordText.Length() - 1 &&
           ClassifyCharacter(i + 1, false) == CHAR_CLASS_WORD)
 
       return mDOMWordText.Length() - mDOMWordOffset;
-    } else if (mDOMWordText[i] == '.' && ! foundDot &&
-        i > 0 && i < (PRInt32)mDOMWordText.Length() - 1) {
-      // we found a period not at the end, we should check harder for URLs
-      foundDot = true;
     } else if (mDOMWordText[i] == ':' && firstColon < 0) {
       firstColon = i;
     }
   }
 
   // If the first colon is followed by a slash, consider it a URL
   // This will catch things like asdf://foo.com
   if (firstColon >= 0 && firstColon < (PRInt32)mDOMWordText.Length() - 1 &&