Changeset 229994 in webkit
- Timestamp:
- Mar 27, 2018 3:10:41 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r229983 r229994 1 2018-03-27 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [GTK] Layout test editing/deleting/delete-surrogatepair.html crashing with CRITICAL **: enchant_dict_check: assertion 'g_utf8_validate(word, len, NULL)' failed 4 https://bugs.webkit.org/show_bug.cgi?id=176799 5 6 Reviewed by Carlos Garcia Campos. 7 8 * platform/gtk/TestExpectations: Unmarked editing/deleting/delete-surrogatepair.html. 9 1 10 2018-03-23 Antoine Quint <graouts@apple.com> 2 11 -
trunk/LayoutTests/platform/gtk/TestExpectations
r229887 r229994 1258 1258 webkit.org/b/175575 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/ready-states/autoplay-with-slow-text-tracks.html [ Crash Pass ] 1259 1259 1260 webkit.org/b/176799 editing/deleting/delete-surrogatepair.html [ Crash ]1261 1262 1260 webkit.org/b/176801 fast/mediastream/apply-constraints-audio.html [ Crash ] 1263 1261 webkit.org/b/176801 fast/mediastream/argument-types.html [ Crash Pass ] -
trunk/Source/WebCore/ChangeLog
r229992 r229994 1 2018-03-27 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [GTK] Layout test editing/deleting/delete-surrogatepair.html crashing with CRITICAL **: enchant_dict_check: assertion 'g_utf8_validate(word, len, NULL)' failed 4 https://bugs.webkit.org/show_bug.cgi?id=176799 5 6 Reviewed by Carlos Garcia Campos. 7 8 The length of a surrogate-pair UTF-16 character is 2 even though 9 the number of characters is 1. An incorrect string length was 10 passed to enchant_dict_check if the string contains a 11 surrogate-pair character because the length was calculated by 12 applying UTF-16 character position to UTF-8 string. 13 14 No new tests (Covered by existing tests). 15 16 * platform/text/enchant/TextCheckerEnchant.cpp: 17 (WebCore::TextCheckerEnchant::checkSpellingOfWord): Changed the 18 type of an argument `word` from CString to String. Convert a 19 substring of the argument into UTF-8. 20 (WebCore::TextCheckerEnchant::checkSpellingOfString): Pass the 21 original UTF-16 string to checkSpellingOfWord instead of a 22 converted UTF-8 string. 23 * platform/text/enchant/TextCheckerEnchant.h: Changed the type of 24 an argument `word` from CString to String. 25 1 26 2018-03-26 Ms2ger <Ms2ger@igalia.com> 2 27 -
trunk/Source/WebCore/platform/text/enchant/TextCheckerEnchant.cpp
r222130 r229994 65 65 } 66 66 67 void TextCheckerEnchant::checkSpellingOfWord(const CString& word, int start, int end, int& misspellingLocation, int& misspellingLength) 68 { 69 const char* string = word.data(); 70 char* startPtr = g_utf8_offset_to_pointer(string, start); 71 int numberOfBytes = static_cast<int>(g_utf8_offset_to_pointer(string, end) - startPtr); 67 void TextCheckerEnchant::checkSpellingOfWord(const String& word, int start, int end, int& misspellingLocation, int& misspellingLength) 68 { 69 CString string = word.substring(start, end - start).utf8(); 72 70 73 71 for (auto& dictionary : m_enchantDictionaries) { 74 if (!enchant_dict_check(dictionary, st artPtr, numberOfBytes)) {72 if (!enchant_dict_check(dictionary, string.data(), string.length())) { 75 73 // Stop checking, this word is ok in at least one dict. 76 74 misspellingLocation = -1; … … 97 95 return; 98 96 99 CString utf8String = string.utf8();100 97 int start = ubrk_first(iter); 101 98 for (int end = ubrk_next(iter); end != UBRK_DONE; end = ubrk_next(iter)) { 102 99 if (isWordTextBreak(iter)) { 103 checkSpellingOfWord( utf8String, start, end, misspellingLocation, misspellingLength);100 checkSpellingOfWord(string, start, end, misspellingLocation, misspellingLength); 104 101 // Stop checking the next words If the current word is misspelled, to do not overwrite its misspelled location and length. 105 102 if (misspellingLength) -
trunk/Source/WebCore/platform/text/enchant/TextCheckerEnchant.h
r175070 r229994 49 49 private: 50 50 void freeEnchantBrokerDictionaries(); 51 void checkSpellingOfWord(const CString&, int start, int end, int& misspellingLocation, int& misspellingLength);51 void checkSpellingOfWord(const String&, int start, int end, int& misspellingLocation, int& misspellingLength); 52 52 53 53 EnchantBroker* m_broker;
Note: See TracChangeset
for help on using the changeset viewer.