[Webkit-unassigned] [Bug 24953] Add automatic spell correction support in WebKit

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 13 19:46:28 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=24953





------- Comment #16 from justin.garcia at apple.com  2009-05-13 19:46 PDT -------
                 // Remember first-encountered misspelling and its offset
                 if (!firstMisspelling) {
-                    firstMisspellingOffset = currentChunkOffset +
misspellingLocation;
-                    firstMisspelling = String(chars + misspellingLocation,
misspellingLength);
+                    firstMisspellingOffset = currentChunkOffset +
misspellingLocation;                  
                 }

I think you should move all of this...

                 // Mark this instance if we're marking all instances.
Otherwise bail out because we found the first one.
                 if (!markAll)
                     break;

-                // Compute range of misspelled word
+                // Compute range of misspelled word                
+
                 RefPtr<Range> misspellingRange =
TextIterator::subrange(searchRange, currentChunkOffset + misspellingLocation,
misspellingLength);
-                
+
+                // Remember first encountered misspelling range.
+                if (!firstMisspelling) {
+                  firstMisspelling = String(chars + misspellingLocation,
misspellingLength);
+                  firstMisspellingRange = misspellingRange;
+                }

to here.


Also, this is not new with your patch (but it's relevant)...I am perplexed by
the placement of:

if (!markAll)
    break;

It seems to break before we mark the misspelling.  Shouldn't it break after?


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list