Changeset 96568 in webkit
- Timestamp:
- Oct 3, 2011 8:10:54 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r96566 r96568 1 2011-10-03 Shinya Kawanaka <shinyak@google.com> 2 3 Should call checkTextOfParagraph() indirectly to make unifying spell-checking code path easy. 4 https://bugs.webkit.org/show_bug.cgi?id=69241 5 6 Reviewed by Ryosuke Niwa. 7 8 WebCore has two different code paths for spell-checking: 9 1) checkTextOfParagraph() for Snow Leopard or later 10 2) checkSpellingOfString() for checkGrammarOfString() for other platforms. 11 12 At the first step, this patch introduces an indirect wrapper to call 13 checkTextOfParagraph() in Snow Leopard or later. This is intended to make it easy to 14 introduce a function for mimicing checkTextOfParagraph() in Chromium platform or 15 other non-SL or non-Lion platform. 16 17 No new tests because this patch does not change a behavior. 18 19 * accessibility/AccessibilityObject.cpp: 20 (WebCore::AccessibilityObject::hasMisspelling): Calling checkTextOfParagraph() indirectly. 21 * accessibility/mac/WebAccessibilityObjectWrapper.mm: 22 (AXAttributeStringSetSpelling): ditto. 23 * editing/Editor.cpp: 24 (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): ditto. 25 * editing/TextCheckingHelper.cpp: 26 (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): ditto. 27 (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange): ditto. 28 (WebCore::checkTextOfParagraph): Added. 29 * editing/TextCheckingHelper.h: 30 1 31 2011-10-03 Darin Adler <darin@apple.com> 2 32 -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r96520 r96568 292 292 #if USE(UNIFIED_TEXT_CHECKING) 293 293 Vector<TextCheckingResult> results; 294 textChecker->checkTextOfParagraph(chars, charsLength, TextCheckingTypeSpelling, results);294 checkTextOfParagraph(textChecker, chars, charsLength, TextCheckingTypeSpelling, results); 295 295 if (!results.isEmpty()) 296 296 isMisspelled = true; -
trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm
r95906 r96568 695 695 // checkTextOfParagraph is the only spelling/grammar checker implemented in WK1 and WK2 696 696 Vector<TextCheckingResult> results; 697 check er->checkTextOfParagraph(chars, charLength, TextCheckingTypeSpelling, results);697 checkTextOfParagraph(checker, chars, charLength, TextCheckingTypeSpelling, results); 698 698 699 699 size_t size = results.size(); -
trunk/Source/WebCore/editing/Editor.cpp
r95244 r96568 2143 2143 Vector<TextCheckingResult> results; 2144 2144 if (shouldMarkGrammar) 2145 textChecker()->checkTextOfParagraph(grammarParagraph.textCharacters(), grammarParagraph.textLength(),2145 checkTextOfParagraph(textChecker(), grammarParagraph.textCharacters(), grammarParagraph.textLength(), 2146 2146 resolveTextCheckingTypeMask(textCheckingOptions), results); 2147 2147 else 2148 textChecker()->checkTextOfParagraph(spellingParagraph.textCharacters(), spellingParagraph.textLength(),2148 checkTextOfParagraph(textChecker(), spellingParagraph.textCharacters(), spellingParagraph.textLength(), 2149 2149 resolveTextCheckingTypeMask(textCheckingOptions), results); 2150 2150 -
trunk/Source/WebCore/editing/TextCheckingHelper.cpp
r95901 r96568 277 277 Vector<TextCheckingResult> results; 278 278 TextCheckingTypeMask checkingTypes = checkGrammar ? (TextCheckingTypeSpelling | TextCheckingTypeGrammar) : TextCheckingTypeSpelling; 279 m_client->textChecker()->checkTextOfParagraph(paragraphString.characters(), paragraphString.length(), checkingTypes, results);279 checkTextOfParagraph(m_client->textChecker(), paragraphString.characters(), paragraphString.length(), checkingTypes, results); 280 280 281 281 for (unsigned i = 0; i < results.size(); i++) { … … 527 527 Vector<TextCheckingResult> results; 528 528 TextCheckingTypeMask checkingTypes = checkGrammar ? (TextCheckingTypeSpelling | TextCheckingTypeGrammar) : TextCheckingTypeSpelling; 529 m_client->textChecker()->checkTextOfParagraph(paragraph.textCharacters(), paragraph.textLength(), checkingTypes, results);529 checkTextOfParagraph(m_client->textChecker(), paragraph.textCharacters(), paragraph.textLength(), checkingTypes, results); 530 530 531 531 for (unsigned i = 0; i < results.size(); i++) { … … 591 591 } 592 592 593 } 593 void checkTextOfParagraph(TextCheckerClient* client, const UChar* text, int length, 594 TextCheckingTypeMask checkingTypes, Vector<TextCheckingResult>& results) 595 { 596 #if USE(UNIFIED_TEXT_CHECKING) 597 client->checkTextOfParagraph(text, length, checkingTypes, results); 598 #else 599 // Should implement later to unify unified spell-checking code path and 600 // legacy spell-checking code path. 601 ASSERT_NOT_REACHED(); 602 UNUSED_PARAM(client); 603 UNUSED_PARAM(text); 604 UNUSED_PARAM(length); 605 UNUSED_PARAM(checkingTypes); 606 UNUSED_PARAM(results); 607 #endif 608 } 609 610 } -
trunk/Source/WebCore/editing/TextCheckingHelper.h
r95901 r96568 93 93 }; 94 94 95 void checkTextOfParagraph(TextCheckerClient*, const UChar* text, int length, 96 TextCheckingTypeMask checkingTypes, Vector<TextCheckingResult>& results); 97 95 98 } // namespace WebCore 96 99
Note: See TracChangeset
for help on using the changeset viewer.