Changeset 83492 in webkit
- Timestamp:
- Apr 11, 2011 1:56:32 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r83487 r83492 1 2011-04-11 Jia Pu <jpu@apple.com> 2 3 Reviewed by Adele Peterson. 4 5 Shouldn't carry out autocorrection when start typing a new word 6 https://bugs.webkit.org/show_bug.cgi?id=58241 7 <rdar://problem/9264736> 8 9 See WebCore/ChangeLog for detail. 10 11 * platform/mac-leopard/Skipped: 12 * platform/mac-snowleopard/Skipped: 13 * platform/mac-tiger/Skipped: 14 * platform/mac/editing/spelling/autocorrection-at-beginning-of-word-1-expected.checksum: Added. 15 * platform/mac/editing/spelling/autocorrection-at-beginning-of-word-1-expected.png: Added. 16 * platform/mac/editing/spelling/autocorrection-at-beginning-of-word-1-expected.txt: Added. 17 * platform/mac/editing/spelling/autocorrection-at-beginning-of-word-1.html: Added. 18 * platform/mac/editing/spelling/autocorrection-at-beginning-of-word-2-expected.checksum: Added. 19 * platform/mac/editing/spelling/autocorrection-at-beginning-of-word-2-expected.png: Added. 20 * platform/mac/editing/spelling/autocorrection-at-beginning-of-word-2-expected.txt: Added. 21 * platform/mac/editing/spelling/autocorrection-at-beginning-of-word-2.html: Added. 22 1 23 2011-04-11 Ryosuke Niwa <rniwa@webkit.org> 2 24 -
trunk/LayoutTests/platform/mac-leopard/Skipped
r83465 r83492 110 110 111 111 # Disable spelling tests for autocorrection panel 112 platform/mac/editing/spelling/autocorrection-at-beginning-of-word-1.html 113 platform/mac/editing/spelling/autocorrection-at-beginning-of-word-2.html 112 114 platform/mac/editing/spelling/autocorrection-contraction.html 113 115 platform/mac/editing/spelling/autocorrection-delete.html -
trunk/LayoutTests/platform/mac-snowleopard/Skipped
r83214 r83492 132 132 133 133 # Disable spelling tests for autocorrection panel 134 platform/mac/editing/spelling/autocorrection-at-beginning-of-word-1.html 135 platform/mac/editing/spelling/autocorrection-at-beginning-of-word-2.html 134 136 platform/mac/editing/spelling/autocorrection-contraction.html 135 137 platform/mac/editing/spelling/autocorrection-delete.html -
trunk/LayoutTests/platform/mac-tiger/Skipped
r80023 r83492 214 214 215 215 # Disable spelling tests for autocorrection panel 216 platform/mac/editing/spelling/autocorrection-at-beginning-of-word-1.html 217 platform/mac/editing/spelling/autocorrection-at-beginning-of-word-2.html 216 218 platform/mac/editing/spelling/autocorrection-contraction.html 217 219 platform/mac/editing/spelling/autocorrection-delete.html -
trunk/Source/WebCore/ChangeLog
r83491 r83492 1 2011-04-11 Jia Pu <jpu@apple.com> 2 3 Reviewed by Adele Peterson. 4 5 Shouldn't carry out autocorrection when start typing a new word 6 https://bugs.webkit.org/show_bug.cgi?id=58241 7 <rdar://problem/9264736> 8 9 Tests: platform/mac/editing/spelling/autocorrection-at-beginning-of-word-1.html 10 platform/mac/editing/spelling/autocorrection-at-beginning-of-word-2.html 11 12 In TypingCommand::markMisspellingsAfterTyping(), we want to call Editor::markMisspellingsAfterTypingToWord() 13 only when the typing command is an insertion command, and preceding word contains at least one non-whitespace 14 character. 15 16 * editing/Editor.cpp: 17 (WebCore::Editor::markMisspellingsAfterTypingToWord): 18 * editing/Editor.h: 19 * editing/TypingCommand.cpp: 20 (WebCore::TypingCommand::markMisspellingsAfterTyping): 21 1 22 2011-04-11 Vsevolod Vlasov <vsevik@chromium.org> 2 23 -
trunk/Source/WebCore/editing/Editor.cpp
r83347 r83492 1970 1970 } 1971 1971 1972 void Editor::markMisspellingsAfterTypingToWord(const VisiblePosition &wordStart, const VisibleSelection& selectionAfterTyping )1972 void Editor::markMisspellingsAfterTypingToWord(const VisiblePosition &wordStart, const VisibleSelection& selectionAfterTyping, bool doReplacement) 1973 1973 { 1974 1974 #if USE(UNIFIED_TEXT_CHECKING) … … 1980 1980 1981 1981 #if USE(AUTOMATIC_TEXT_REPLACEMENT) 1982 if (isAutomaticQuoteSubstitutionEnabled() 1983 || isAutomaticLinkDetectionEnabled() 1984 || isAutomaticDashSubstitutionEnabled() 1985 || isAutomaticTextReplacementEnabled() 1986 || ((textCheckingOptions & MarkSpelling) && isAutomaticSpellingCorrectionEnabled())) 1982 if (doReplacement 1983 && (isAutomaticQuoteSubstitutionEnabled() 1984 || isAutomaticLinkDetectionEnabled() 1985 || isAutomaticDashSubstitutionEnabled() 1986 || isAutomaticTextReplacementEnabled() 1987 || ((textCheckingOptions & MarkSpelling) && isAutomaticSpellingCorrectionEnabled()))) 1987 1988 textCheckingOptions |= PerformReplacement; 1988 1989 #endif -
trunk/Source/WebCore/editing/Editor.h
r83344 r83492 220 220 bool isSpellCheckingEnabledInFocusedNode() const; 221 221 bool isSpellCheckingEnabledFor(Node*) const; 222 void markMisspellingsAfterTypingToWord(const VisiblePosition &wordStart, const VisibleSelection& selectionAfterTyping );222 void markMisspellingsAfterTypingToWord(const VisiblePosition &wordStart, const VisibleSelection& selectionAfterTyping, bool doReplacement); 223 223 void markMisspellings(const VisibleSelection&, RefPtr<Range>& firstMisspellingRange); 224 224 void markBadGrammar(const VisibleSelection&); -
trunk/Source/WebCore/editing/TypingCommand.cpp
r83344 r83492 40 40 #include "RenderObject.h" 41 41 #include "SelectionController.h" 42 #include "TextIterator.h" 42 43 #include "VisiblePosition.h" 43 44 #include "htmlediting.h" … … 341 342 VisiblePosition p1 = startOfWord(previous, LeftWordIfOnBoundary); 342 343 VisiblePosition p2 = startOfWord(start, LeftWordIfOnBoundary); 343 if (p1 != p2) 344 document()->frame()->editor()->markMisspellingsAfterTypingToWord(p1, endingSelection()); 345 else if (commandType == TypingCommand::InsertText) 344 if (p1 != p2) { 345 RefPtr<Range> range = makeRange(p1, p2); 346 String strippedPreviousWord; 347 if (range && (commandType == TypingCommand::InsertText || commandType == TypingCommand::InsertLineBreak || commandType == TypingCommand::InsertParagraphSeparator || commandType == TypingCommand::InsertParagraphSeparatorInQuotedContent)) 348 strippedPreviousWord = plainText(range.get()).stripWhiteSpace(); 349 document()->frame()->editor()->markMisspellingsAfterTypingToWord(p1, endingSelection(), !strippedPreviousWord.isEmpty()); 350 } else if (commandType == TypingCommand::InsertText) 346 351 document()->frame()->editor()->startCorrectionPanelTimer(); 347 352 }
Note: See TracChangeset
for help on using the changeset viewer.