Changeset 163848 in webkit
- Timestamp:
- Feb 10, 2014 6:12:42 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r163844 r163848 1 2014-02-10 Anders Carlsson <andersca@apple.com> 2 3 Remove a couple of deprecatedCharacters() from WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=128569 5 6 Reviewed by Andreas Kling. 7 8 * Shared/APIString.h: 9 * UIProcess/TextChecker.h: 10 * UIProcess/WebPageProxy.cpp: 11 (WebKit::WebPageProxy::checkTextOfParagraph): 12 (WebKit::WebPageProxy::checkSpellingOfString): 13 (WebKit::WebPageProxy::checkGrammarOfString): 14 * UIProcess/mac/TextCheckerMac.mm: 15 (WebKit::TextChecker::checkTextOfParagraph): 16 (WebKit::TextChecker::checkSpellingOfString): 17 (WebKit::TextChecker::checkGrammarOfString): 18 1 19 2014-02-10 Filip Pizlo <fpizlo@apple.com> 2 20 -
trunk/Source/WebKit2/Shared/APIString.h
r162158 r163848 79 79 size_t getUTF8CString(char* buffer, size_t bufferSize) 80 80 { 81 if (!bufferSize )81 if (!bufferSize || m_string.isEmpty()) 82 82 return 0; 83 char* p = buffer; 84 const UChar* d = m_string.deprecatedCharacters(); 85 WTF::Unicode::ConversionResult result = WTF::Unicode::convertUTF16ToUTF8(&d, d + m_string.length(), &p, p + bufferSize - 1, /* strict */ true); 86 *p++ = '\0'; 83 char* destination = buffer; 84 85 WTF::Unicode::ConversionResult result; 86 if (m_string.is8Bit()) { 87 const LChar* source = m_string.characters8(); 88 result = WTF::Unicode::convertLatin1ToUTF8(&source, source + m_string.length(), &destination, destination + bufferSize - 1); 89 } else { 90 const UChar* source = m_string.characters16(); 91 result = WTF::Unicode::convertUTF16ToUTF8(&source, source + m_string.length(), &destination, destination + bufferSize - 1, /* strict */ true); 92 } 93 94 *destination++ = '\0'; 87 95 if (result != WTF::Unicode::conversionOK && result != WTF::Unicode::targetExhausted) 88 96 return 0; 89 return p- buffer;97 return destination - buffer; 90 98 } 91 99 -
trunk/Source/WebKit2/UIProcess/TextChecker.h
r149476 r163848 68 68 static void closeSpellDocumentWithTag(int64_t); 69 69 #if USE(UNIFIED_TEXT_CHECKING) 70 static Vector<WebCore::TextCheckingResult> checkTextOfParagraph(int64_t spellDocumentTag, const UChar* text, int length, uint64_t checkingTypes);70 static Vector<WebCore::TextCheckingResult> checkTextOfParagraph(int64_t spellDocumentTag, StringView, uint64_t checkingTypes); 71 71 #endif 72 static void checkSpellingOfString(int64_t spellDocumentTag, const UChar* text, uint32_t length, int32_t& misspellingLocation, int32_t& misspellingLength);73 static void checkGrammarOfString(int64_t spellDocumentTag, const UChar* text, uint32_t length, Vector<WebCore::GrammarDetail>&, int32_t& badGrammarLocation, int32_t& badGrammarLength);72 static void checkSpellingOfString(int64_t spellDocumentTag, StringView, int32_t& misspellingLocation, int32_t& misspellingLength); 73 static void checkGrammarOfString(int64_t spellDocumentTag, StringView, Vector<WebCore::GrammarDetail>&, int32_t& badGrammarLocation, int32_t& badGrammarLength); 74 74 static bool spellingUIIsShowing(); 75 75 static void toggleSpellingUIIsShowing(); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r163836 r163848 3434 3434 void WebPageProxy::checkTextOfParagraph(const String& text, uint64_t checkingTypes, Vector<TextCheckingResult>& results) 3435 3435 { 3436 results = TextChecker::checkTextOfParagraph(spellDocumentTag(), text .deprecatedCharacters(), text.length(), checkingTypes);3436 results = TextChecker::checkTextOfParagraph(spellDocumentTag(), text, checkingTypes); 3437 3437 } 3438 3438 #endif … … 3440 3440 void WebPageProxy::checkSpellingOfString(const String& text, int32_t& misspellingLocation, int32_t& misspellingLength) 3441 3441 { 3442 TextChecker::checkSpellingOfString(spellDocumentTag(), text .deprecatedCharacters(), text.length(), misspellingLocation, misspellingLength);3442 TextChecker::checkSpellingOfString(spellDocumentTag(), text, misspellingLocation, misspellingLength); 3443 3443 } 3444 3444 3445 3445 void WebPageProxy::checkGrammarOfString(const String& text, Vector<GrammarDetail>& grammarDetails, int32_t& badGrammarLocation, int32_t& badGrammarLength) 3446 3446 { 3447 TextChecker::checkGrammarOfString(spellDocumentTag(), text .deprecatedCharacters(), text.length(), grammarDetails, badGrammarLocation, badGrammarLength);3447 TextChecker::checkGrammarOfString(spellDocumentTag(), text, grammarDetails, badGrammarLocation, badGrammarLength); 3448 3448 } 3449 3449 -
trunk/Source/WebKit2/UIProcess/mac/TextCheckerMac.mm
r162505 r163848 29 29 #import "TextCheckerState.h" 30 30 #import <WebCore/NotImplemented.h> 31 #import <wtf/text/StringView.h> 31 32 #import <wtf/RetainPtr.h> 32 33 … … 294 295 #if USE(UNIFIED_TEXT_CHECKING) 295 296 296 Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(int64_t spellDocumentTag, const UChar* text, int length, uint64_t checkingTypes)297 Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(int64_t spellDocumentTag, StringView stringView, uint64_t checkingTypes) 297 298 { 298 299 Vector<TextCheckingResult> results; 299 300 300 RetainPtr<NSString> textString = adoptNS([[NSString alloc] initWithCharactersNoCopy:const_cast<UChar*>(text) length:length freeWhenDone:NO]);301 NSArray *incomingResults = [[NSSpellChecker sharedSpellChecker] checkString:textString 302 range:NSMakeRange(0, length)301 auto textString = stringView.createNSStringWithoutCopying(); 302 NSArray *incomingResults = [[NSSpellChecker sharedSpellChecker] checkString:textString.get() 303 range:NSMakeRange(0, stringView.length()) 303 304 types:checkingTypes | NSTextCheckingTypeOrthography 304 305 options:nil … … 383 384 #endif 384 385 385 void TextChecker::checkSpellingOfString(int64_t, const UChar*, uint32_t, int32_t&, int32_t&)386 void TextChecker::checkSpellingOfString(int64_t, StringView, int32_t&, int32_t&) 386 387 { 387 388 // Mac uses checkTextOfParagraph instead. … … 389 390 } 390 391 391 void TextChecker::checkGrammarOfString(int64_t, const UChar*, uint32_t, Vector<WebCore::GrammarDetail>&, int32_t&, int32_t&)392 void TextChecker::checkGrammarOfString(int64_t, StringView, Vector<WebCore::GrammarDetail>&, int32_t&, int32_t&) 392 393 { 393 394 // Mac uses checkTextOfParagraph instead.
Note: See TracChangeset
for help on using the changeset viewer.