RESOLVED FIXED 24108
Adopt new text checking API for spelling and grammar checking in SnowLeopard
https://bugs.webkit.org/show_bug.cgi?id=24108
Summary Adopt new text checking API for spelling and grammar checking in SnowLeopard
Justin Garcia
Reported 2009-02-23 15:20:08 PST
In place of current, separate calls for spelling and grammar checking, it is now possible to make a single call that will do both, more efficiently and more correctly. This will be necessary for us to maintain consistent spelling and grammar checking between Mail and TextEdit in Snow Leopard. <rdar://problem/6088051>
Attachments
doug's patch (31.62 KB, patch)
2009-03-01 15:08 PST, Justin Garcia
justin.garcia: review+
Justin Garcia
Comment 1 2009-03-01 15:08:03 PST
Created attachment 28153 [details] doug's patch
Justin Garcia
Comment 2 2009-03-04 13:24:27 PST
in Frame::respondToChangedSelection why did you remove the call to: editor()->markMisspellings(oldAdjacentWords);
Douglas Davidson
Comment 3 2009-03-04 13:40:40 PST
The idea here is to replace the two calls to markMisspellings and markBadGrammar with a single call to markMisspellingsAndBadGrammar, with a bool markGrammar argument to indicate whether it should mark spelling only or spelling and grammar. The reason for this is that the new text checking will check both at once, and should check both at once wherever possible to save a round trip to the checker. There are two cases in Frame::respondToChangedSelection. If grammar checking is disabled (the else clause) then the markGrammar argument is always false. If grammar checking is enabled, then we always want to check spelling, but we also want to check grammar if and only if the new selection is in a different sentence from the old one. Before this change, that was done by calling markBadGrammar only if oldSelectedSentence != newSelectedSentence. After the change, that is done by making the markGrammar argument true only if oldSelectedSentence != newSelectedSentence.
Justin Garcia
Comment 4 2009-03-04 13:43:20 PST
Oops I didn't see the else clause my mistake.
Justin Garcia
Comment 5 2009-03-04 13:52:12 PST
Comment on attachment 28153 [details] doug's patch looks good
Justin Garcia
Comment 6 2009-03-06 12:11:13 PST
Note You need to log in before you can comment on or make changes to this bug.