Changeset 141471 in webkit
- Timestamp:
- Jan 31, 2013 12:58:51 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r141469 r141471 1 2013-01-31 Rouslan Solomakhin <rouslan@chromium.org> 2 3 [Chromium] Expect spellcheck to work for exactly-selected multi-word misspellings 4 https://bugs.webkit.org/show_bug.cgi?id=108498 5 6 Reviewed by Tony Chang. 7 8 * platform/chromium/TestExpectations: Update spellcheck tests expectations. 9 1 10 2013-01-31 Jessie Berlin <jberlin@apple.com> 2 11 -
trunk/LayoutTests/platform/chromium/TestExpectations
r141456 r141471 4358 4358 4359 4359 # Spellchecker behavior tests. 4360 webkit.org/b/108370 editing/spelling/spelling-double-clicked-word.html [ Skip ] 4361 webkit.org/b/108370 editing/spelling/spelling-double-clicked-word-with-underscores.html [ Skip ] 4362 webkit.org/b/108370 editing/spelling/spelling-exactly-selected-multiple-words.html [ Skip ] 4363 webkit.org/b/108370 editing/spelling/spelling-exactly-selected-word.html [ Skip ] 4364 webkit.org/b/108370 editing/spelling/spelling-multiword-selection.html [ Skip ] 4365 webkit.org/b/108370 editing/spelling/spelling-should-select-multiple-words.html [ Skip ] 4366 webkit.org/b/108370 editing/spelling/spelling-should-select-single-word.html [ Skip ] 4367 webkit.org/b/108370 editing/spelling/spelling-subword-selection.html [ Skip ] 4368 webkit.org/b/108370 editing/spelling/spelling-with-punctuation-selection.html [ Skip ] 4369 webkit.org/b/108370 editing/spelling/spelling-with-underscore-selection.html [ Skip ] 4370 webkit.org/b/108370 editing/spelling/spelling-with-whitespace-selection.html [ Skip ] 4360 webkit.org/b/108370 editing/spelling/spelling-double-clicked-word.html [ Failure ] 4361 webkit.org/b/108370 editing/spelling/spelling-double-clicked-word-with-underscores.html [ Failure ] 4362 webkit.org/b/108370 editing/spelling/spelling-should-select-multiple-words.html [ Failure ] 4363 webkit.org/b/108370 editing/spelling/spelling-with-punctuation-selection.html [ Failure ] 4364 webkit.org/b/108370 editing/spelling/spelling-with-underscore-selection.html [ Failure ] 4365 webkit.org/b/108370 editing/spelling/spelling-with-whitespace-selection.html [ Failure ] 4371 4366 4372 4367 webkit.org/b/108424 media/video-error-does-not-exist.html [ Failure Crash ] -
trunk/Tools/ChangeLog
r141467 r141471 1 2013-01-31 Rouslan Solomakhin <rouslan@chromium.org> 2 3 [Chromium] Add two-word misspelling to mock spellchecker 4 https://bugs.webkit.org/show_bug.cgi?id=108498 5 6 Reviewed by Tony Chang. 7 8 Some layout tests verify spellcheck behavior when multiple words are 9 marked as a single misspelling. This change adds a two-word misspelling 10 'upper case' to the mock spellchecker used by layout tests. 11 12 * DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.cpp: 13 (MockSpellCheck::spellCheckWord): Modified to handle spaces in misspellings. 14 (MockSpellCheck::initializeIfNeeded): Modified to use a vector instead of a hash table. 15 * DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.h: 16 (MockSpellCheck): Changed misspellings container from hash table to vector. 17 1 18 2013-01-31 Simon Hausmann <simon.hausmann@digia.com> 2 19 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.cpp
r140396 r141471 59 59 // Convert to a String because we store String instances in 60 60 // m_misspelledWords and WebString has no find(). 61 WTF::String stringText(text.data(), text.length());61 String stringText(text.data(), text.length()); 62 62 int skippedLength = 0; 63 63 … … 70 70 // If the given string doesn't include any ASCII characters, we can treat the 71 71 // string as valid one. 72 // Unfortunately, This implementation splits a contraction, i.e. "isn't" is73 // split into two pieces "isn" and "t". This is OK because webkit tests74 // don't have misspelled contractions.75 72 int wordOffset = stringText.find(isASCIIAlpha); 76 73 if (wordOffset == -1) 77 74 return true; 78 int wordEnd = stringText.find(isNotASCIIAlpha, wordOffset); 79 int wordLength = wordEnd == -1 ? static_cast<int>(stringText.length()) - wordOffset : wordEnd - wordOffset; 75 int maxWordLength = static_cast<int>(stringText.length()) - wordOffset; 76 int wordLength; 77 String word; 80 78 81 79 // Look up our misspelled-word table to check if the extracted word is a … … 84 82 // (See the comment in MockSpellCheck::initializeIfNeeded() why we use a 85 83 // misspelled-word table.) 86 WTF::String word = stringText.substring(wordOffset, wordLength); 87 if (m_misspelledWords.contains(word)) { 88 *misspelledOffset = wordOffset + skippedLength; 89 *misspelledLength = wordLength; 84 for (int i = 0; i < m_misspelledWords.size(); ++i) { 85 wordLength = static_cast<int>(m_misspelledWords.at(i).length()) > maxWordLength ? maxWordLength : static_cast<int>(m_misspelledWords.at(i).length()); 86 word = stringText.substring(wordOffset, wordLength); 87 if (word == m_misspelledWords.at(i) && (static_cast<int>(stringText.length()) == wordOffset + wordLength || isNotASCIIAlpha(stringText[wordOffset + wordLength]))) { 88 *misspelledOffset = wordOffset + skippedLength; 89 *misspelledLength = wordLength; 90 break; 91 } 92 } 93 94 if (*misspelledLength > 0) 90 95 break; 91 } 96 97 int wordEnd = stringText.find(isNotASCIIAlpha, wordOffset); 98 wordLength = wordEnd == -1 ? static_cast<int>(stringText.length()) - wordOffset : wordEnd - wordOffset; 92 99 93 100 ASSERT(0 < wordOffset + wordLength); … … 152 159 "qwertyuiopasd", 153 160 "qwertyuiopasdf", 161 "upper case", 154 162 "wellcome" 155 163 }; … … 157 165 m_misspelledWords.clear(); 158 166 for (size_t i = 0; i < arraysize(misspelledWords); ++i) 159 m_misspelledWords.a dd(WTF::String::fromUTF8(misspelledWords[i]), false);167 m_misspelledWords.append(String::fromUTF8(misspelledWords[i])); 160 168 161 169 // Mark as initialized to prevent this object from being initialized twice -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/MockSpellCheck.h
r140621 r141471 34 34 #include "Platform/chromium/public/WebString.h" 35 35 #include "Platform/chromium/public/WebVector.h" 36 #include <wtf/HashMap.h> 37 #include <wtf/text/StringHash.h> 36 #include <wtf/Vector.h> 38 37 #include <wtf/text/WTFString.h> 39 38 … … 72 71 73 72 // A table that consists of misspelled words. 74 HashMap<WTF::String, bool> m_misspelledWords;73 Vector<String> m_misspelledWords; 75 74 76 75 // A flag representing whether or not this object is initialized.
Note: See TracChangeset
for help on using the changeset viewer.