Changeset 86295 in webkit
- Timestamp:
- May 11, 2011 5:54:08 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r86292 r86295 1 2011-05-11 Jia Pu <jpu@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Autocorrection persists after deleting and retyping the same word at same location. 6 https://bugs.webkit.org/show_bug.cgi?id=60555 7 <rdar://problem/9373915> 8 9 See WebCore/ChangeLog for detail. 10 11 * platform/mac-leopard/Skipped: 12 * platform/mac-snowleopard/Skipped: 13 * platform/mac/editing/spelling/delete-autocorrected-word-2-expected.png: Added. 14 * platform/mac/editing/spelling/delete-autocorrected-word-2-expected.txt: Added. 15 * platform/mac/editing/spelling/delete-autocorrected-word-2.html: Added. 16 1 17 2011-05-11 Kent Tamura <tkent@chromium.org> 2 18 -
trunk/LayoutTests/platform/mac-leopard/Skipped
r85306 r86295 119 119 platform/mac/editing/spelling/click-autocorrected-word.html 120 120 platform/mac/editing/spelling/delete-autocorrected-word-1.html 121 platform/mac/editing/spelling/delete-autocorrected-word-2.html 121 122 platform/mac/editing/spelling/delete-into-autocorrected-word.html 122 123 platform/mac/editing/spelling/delete-into-misspelled-word.html -
trunk/LayoutTests/platform/mac-snowleopard/Skipped
r84959 r86295 141 141 platform/mac/editing/spelling/click-autocorrected-word.html 142 142 platform/mac/editing/spelling/delete-autocorrected-word-1.html 143 platform/mac/editing/spelling/delete-autocorrected-word-2.html 143 144 platform/mac/editing/spelling/delete-into-autocorrected-word.html 144 145 platform/mac/editing/spelling/delete-into-misspelled-word.html -
trunk/Source/WebCore/ChangeLog
r86293 r86295 1 2011-05-11 Jia Pu <jpu@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Autocorrection persists after deleting and retyping the same word at same location. 6 https://bugs.webkit.org/show_bug.cgi?id=60555 7 <rdar://problem/9373915> 8 9 This patch intends to alleviate the issue of repetitively applying the same autocorrection 10 when user delete and retype the same word at the same location. This scenario is especially 11 common when autocorrection modifies the first letter of the word. 12 13 This patch consists following major changes: 14 1. Added a new marker type, DeletedAutocorrection. This marker is added to the whitespace that 15 precedes a deleted autocorrection. If the user later types the same original word at after 16 this whitespace, the autocorrection will not be applied again. 17 2. In DeleteSelectionCommand, added code to notify SpellingCorrectionController about the 18 autocorrection that has just been deleted. 19 3. In Editor and SpellingCorrectionController, added code to apply the marker and to suppress 20 autocorrection when necessary. 21 4. The change in CompositeEditCommand::replaceTextInNode is necessary for preserving markers. 22 Otherwise, we will loose the DeletedAutocorrection on the whitespace, when inserting text 23 after the whitespace. 24 25 Test: platform/mac/editing/spelling/delete-autocorrected-word-2.html 26 27 * dom/DocumentMarker.h: Added new marker type DeletedAutocorrection. 28 (WebCore::DocumentMarker::AllMarkers::AllMarkers): 29 * dom/DocumentMarkerController.cpp: 30 (WebCore::DocumentMarkerController::markersInRange): Support querying multiple marker types. 31 * dom/DocumentMarkerController.h: 32 * editing/CompositeEditCommand.cpp: 33 (WebCore::CompositeEditCommand::replaceTextInNodeAndPreserveMarkers): 34 (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring): 35 (WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit): 36 * editing/CompositeEditCommand.h: 37 * editing/DeleteSelectionCommand.cpp: 38 (WebCore::DeleteSelectionCommand::DeleteSelectionCommand): 39 (WebCore::DeleteSelectionCommand::fixupWhitespace): 40 (WebCore::DeleteSelectionCommand::originalStringForAutocorrectionAtBeginningOfSelection): Extracting 41 the original string if we are deleting an autocorrection. 42 (WebCore::DeleteSelectionCommand::doApply): Notify editor about the deleted autocorrection and its position. 43 * editing/DeleteSelectionCommand.h: 44 * editing/Editor.cpp: 45 (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Moved all logic of determining 46 when to suppress an autocorrection into SpellingCorrectionController. 47 (WebCore::Editor::deletedAutocorrectionAtPosition): 48 * editing/Editor.h: 49 * editing/InsertParagraphSeparatorCommand.cpp: 50 (WebCore::InsertParagraphSeparatorCommand::doApply): 51 * editing/SpellingCorrectionController.cpp: 52 (WebCore::SpellingCorrectionController::respondToAppliedEditing): 53 (WebCore::SpellingCorrectionController::deletedAutocorrectionAtPosition): 54 (WebCore::SpellingCorrectionController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand): 55 (WebCore::SpellingCorrectionController::processMarkersOnTextToBeReplacedByResult): 56 * editing/SpellingCorrectionController.h: 57 (WebCore::SpellingCorrectionController::UNLESS_ENABLED): 58 * editing/visible_units.cpp: 59 (WebCore::isStartOfWord): 60 * editing/visible_units.h: 61 * manual-tests/autocorrection/spell-checking-after-reversion.html: 62 1 63 2011-05-11 Dan Bernstein <mitz@apple.com> 2 64 -
trunk/Source/WebCore/dom/DocumentMarker.h
r85118 r86295 55 55 // On some platforms, this prevents the text from being spellchecked again. 56 56 SpellCheckingExemption = 1 << 7, 57 // This marker indicates user has deleted an autocorrection starting at the end of the 58 // range that bears this marker. In some platforms, if the user later inserts the same original 59 // word again at this position, it will not be autocorrected again. The description of this 60 // marker is the original word before autocorrection was applied. 61 DeletedAutocorrection = 1 << 8 57 62 }; 58 63 … … 76 81 public: 77 82 AllMarkers() 78 : MarkerTypes(Spelling | Grammar | TextMatch | Replacement | CorrectionIndicator | RejectedCorrection | Autocorrected | SpellCheckingExemption )83 : MarkerTypes(Spelling | Grammar | TextMatch | Replacement | CorrectionIndicator | RejectedCorrection | Autocorrected | SpellCheckingExemption | DeletedAutocorrection) 79 84 { 80 85 } -
trunk/Source/WebCore/dom/DocumentMarkerController.cpp
r85118 r86295 294 294 } 295 295 296 Vector<DocumentMarker> DocumentMarkerController::markersInRange(Range* range, DocumentMarker::MarkerType markerType)297 { 298 if (!possiblyHasMarkers(markerType ))296 Vector<DocumentMarker> DocumentMarkerController::markersInRange(Range* range, DocumentMarker::MarkerTypes markerTypes) 297 { 298 if (!possiblyHasMarkers(markerTypes)) 299 299 return Vector<DocumentMarker>(); 300 300 … … 311 311 Vector<DocumentMarker>::const_iterator end = markers.end(); 312 312 for (Vector<DocumentMarker>::const_iterator it = markers.begin(); it != end; ++it) { 313 if ( markerType != it->type)313 if (!markerTypes.contains(it->type)) 314 314 continue; 315 315 if (node == startContainer && it->endOffset <= static_cast<unsigned>(range->startOffset())) -
trunk/Source/WebCore/dom/DocumentMarkerController.h
r85118 r86295 71 71 DocumentMarker* markerContainingPoint(const IntPoint&, DocumentMarker::MarkerType); 72 72 Vector<DocumentMarker> markersForNode(Node*); 73 Vector<DocumentMarker> markersInRange(Range*, DocumentMarker::MarkerType );73 Vector<DocumentMarker> markersInRange(Range*, DocumentMarker::MarkerTypes); 74 74 Vector<IntRect> renderedRectsForMarkers(DocumentMarker::MarkerType); 75 75 void clearDescriptionOnMarkersIntersectingRange(Range*, DocumentMarker::MarkerTypes); -
trunk/Source/WebCore/editing/CompositeEditCommand.cpp
r83322 r86295 33 33 #include "Document.h" 34 34 #include "DocumentFragment.h" 35 #include "DocumentMarkerController.h" 35 36 #include "EditorInsertAction.h" 36 37 #include "Frame.h" … … 341 342 } 342 343 344 void CompositeEditCommand::replaceTextInNodePreservingMarkers(PassRefPtr<Text> prpNode, unsigned offset, unsigned count, const String& replacementText) 345 { 346 RefPtr<Text> node(prpNode); 347 DocumentMarkerController* markerController = document()->markers(); 348 Vector<DocumentMarker> markers = markerController->markersInRange(Range::create(document(), node, offset, node, offset + count).get(), DocumentMarker::AllMarkers()); 349 replaceTextInNode(node, offset, count, replacementText); 350 RefPtr<Range> newRange = Range::create(document(), node, offset, node, offset + replacementText.length()); 351 for (size_t i = 0; i < markers.size(); ++i) 352 markerController->addMarker(newRange.get(), markers[i].type, markers[i].description); 353 } 354 343 355 Position CompositeEditCommand::positionOutsideTabSpan(const Position& pos) 344 356 { … … 476 488 477 489 if (string != rebalancedString) 478 replaceTextInNode (textNode, upstream, length, rebalancedString);490 replaceTextInNodePreservingMarkers(textNode, upstream, length, rebalancedString); 479 491 } 480 492 … … 502 514 503 515 if (isCollapsibleWhitespace(previousVisiblePos.characterAfter()) && previous.deprecatedNode()->isTextNode() && !previous.deprecatedNode()->hasTagName(brTag)) 504 replaceTextInNode (static_cast<Text*>(previous.deprecatedNode()), previous.deprecatedEditingOffset(), 1, nonBreakingSpaceString());516 replaceTextInNodePreservingMarkers(static_cast<Text*>(previous.deprecatedNode()), previous.deprecatedEditingOffset(), 1, nonBreakingSpaceString()); 505 517 if (isCollapsibleWhitespace(visiblePos.characterAfter()) && position.deprecatedNode()->isTextNode() && !position.deprecatedNode()->hasTagName(brTag)) 506 replaceTextInNode (static_cast<Text*>(position.deprecatedNode()), position.deprecatedEditingOffset(), 1, nonBreakingSpaceString());518 replaceTextInNodePreservingMarkers(static_cast<Text*>(position.deprecatedNode()), position.deprecatedEditingOffset(), 1, nonBreakingSpaceString()); 507 519 } 508 520 -
trunk/Source/WebCore/editing/CompositeEditCommand.h
r81185 r86295 84 84 void prune(PassRefPtr<Node>); 85 85 void replaceTextInNode(PassRefPtr<Text>, unsigned offset, unsigned count, const String& replacementText); 86 void replaceTextInNodePreservingMarkers(PassRefPtr<Text>, unsigned offset, unsigned count, const String& replacementText); 86 87 Position positionOutsideTabSpan(const Position&); 87 88 void setNodeAttribute(PassRefPtr<Element>, const QualifiedName& attribute, const AtomicString& value); -
trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp
r83247 r86295 29 29 #include "Document.h" 30 30 #include "DocumentFragment.h" 31 #include "DocumentMarkerController.h" 31 32 #include "EditingBoundary.h" 32 33 #include "Editor.h" … … 69 70 70 71 DeleteSelectionCommand::DeleteSelectionCommand(Document *document, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements) 71 : CompositeEditCommand(document) ,72 m_hasSelectionToDelete(false),73 m_smartDelete(smartDelete),74 m_mergeBlocksAfterDelete(mergeBlocksAfterDelete),75 m_needPlaceholder(false),76 m_replace(replace),77 m_expandForSpecialElements(expandForSpecialElements),78 m_pruneStartBlockIfNecessary(false),79 m_startsAtEmptyLine(false),80 m_startBlock(0),81 m_endBlock(0),82 m_typingStyle(0),83 72 : CompositeEditCommand(document) 73 , m_hasSelectionToDelete(false) 74 , m_smartDelete(smartDelete) 75 , m_mergeBlocksAfterDelete(mergeBlocksAfterDelete) 76 , m_needPlaceholder(false) 77 , m_replace(replace) 78 , m_expandForSpecialElements(expandForSpecialElements) 79 , m_pruneStartBlockIfNecessary(false) 80 , m_startsAtEmptyLine(false) 81 , m_startBlock(0) 82 , m_endBlock(0) 83 , m_typingStyle(0) 84 , m_deleteIntoBlockquoteStyle(0) 84 85 { 85 86 } 86 87 87 88 DeleteSelectionCommand::DeleteSelectionCommand(const VisibleSelection& selection, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements) 88 : CompositeEditCommand(selection.start().anchorNode()->document()) ,89 m_hasSelectionToDelete(true),90 m_smartDelete(smartDelete),91 m_mergeBlocksAfterDelete(mergeBlocksAfterDelete),92 m_needPlaceholder(false),93 m_replace(replace),94 m_expandForSpecialElements(expandForSpecialElements),95 m_pruneStartBlockIfNecessary(false),96 m_startsAtEmptyLine(false),97 m_selectionToDelete(selection),98 m_startBlock(0),99 m_endBlock(0),100 m_typingStyle(0),101 89 : CompositeEditCommand(selection.start().anchorNode()->document()) 90 , m_hasSelectionToDelete(true) 91 , m_smartDelete(smartDelete) 92 , m_mergeBlocksAfterDelete(mergeBlocksAfterDelete) 93 , m_needPlaceholder(false) 94 , m_replace(replace) 95 , m_expandForSpecialElements(expandForSpecialElements) 96 , m_pruneStartBlockIfNecessary(false) 97 , m_startsAtEmptyLine(false) 98 , m_selectionToDelete(selection) 99 , m_startBlock(0) 100 , m_endBlock(0) 101 , m_typingStyle(0) 102 , m_deleteIntoBlockquoteStyle(0) 102 103 { 103 104 } … … 556 557 Text* textNode = static_cast<Text*>(m_leadingWhitespace.deprecatedNode()); 557 558 ASSERT(!textNode->renderer() || textNode->renderer()->style()->collapseWhiteSpace()); 558 replaceTextInNode (textNode, m_leadingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());559 replaceTextInNodePreservingMarkers(textNode, m_leadingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString()); 559 560 } 560 561 if (m_trailingWhitespace.isNotNull() && !m_trailingWhitespace.isRenderedCharacter() && m_trailingWhitespace.deprecatedNode()->isTextNode()) { 561 562 Text* textNode = static_cast<Text*>(m_trailingWhitespace.deprecatedNode()); 562 563 ASSERT(!textNode->renderer() ||textNode->renderer()->style()->collapseWhiteSpace()); 563 replaceTextInNode (textNode, m_trailingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());564 replaceTextInNodePreservingMarkers(textNode, m_trailingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString()); 564 565 } 565 566 } … … 744 745 m_trailingWhitespace.clear(); 745 746 } 747 748 String DeleteSelectionCommand::originalStringForAutocorrectionAtBeginningOfSelection() 749 { 750 if (!m_selectionToDelete.isRange()) 751 return String(); 752 753 VisiblePosition startOfSelection = m_selectionToDelete.start(); 754 if (!isStartOfWord(startOfSelection)) 755 return String(); 756 757 RefPtr<Range> rangeOfFirstCharacter = Range::create(document(), startOfSelection.deepEquivalent(), startOfSelection.next().deepEquivalent()); 758 Vector<DocumentMarker> markers = document()->markers()->markersInRange(rangeOfFirstCharacter.get(), DocumentMarker::Autocorrected); 759 for (size_t i = 0; i < markers.size(); ++i) { 760 const DocumentMarker& marker = markers[i]; 761 int startOffset = marker.startOffset; 762 if (startOffset == startOfSelection.deepEquivalent().offsetInContainerNode()) 763 return marker.description; 764 } 765 return String(); 766 } 746 767 747 768 void DeleteSelectionCommand::doApply() … … 754 775 if (!m_selectionToDelete.isNonOrphanedRange()) 755 776 return; 777 778 String originalString = originalStringForAutocorrectionAtBeginningOfSelection(); 756 779 757 780 // If the deletion is occurring in a text field, and we're not deleting to replace the selection, then let the frame call across the bridge to notify the form delegate. … … 816 839 817 840 calculateTypingStyleAfterDelete(); 818 841 842 if (!originalString.isEmpty()) { 843 if (Frame* frame = document()->frame()) 844 frame->editor()->deletedAutocorrectionAtPosition(m_endingPosition, originalString); 845 } 846 819 847 setEndingSelection(VisibleSelection(m_endingPosition, affinity)); 820 848 clearTransientState(); -
trunk/Source/WebCore/editing/DeleteSelectionCommand.h
r71469 r86295 69 69 virtual void deleteTextFromNode(PassRefPtr<Text>, unsigned, unsigned); 70 70 71 // This function provides access to original string after the correction has been deleted. 72 String originalStringForAutocorrectionAtBeginningOfSelection(); 73 71 74 bool m_hasSelectionToDelete; 72 75 bool m_smartDelete; -
trunk/Source/WebCore/editing/Editor.cpp
r86132 r86295 2230 2230 continue; 2231 2231 2232 if (!(shouldPerformReplacement || shouldShowCorrectionPanel) || !doReplacement) 2233 continue; 2234 2232 2235 String replacedString = plainText(rangeToReplace.get()); 2233 2234 // Don't correct spelling in an already-corrected word. 2235 DocumentMarkerController* markers = m_frame->document()->markers(); 2236 if (markers->hasMarkers(rangeToReplace.get(), DocumentMarker::Replacement)) { 2237 doReplacement = false; 2238 if (result->type == TextCheckingTypeCorrection) 2239 m_spellingCorrector->recordSpellcheckerResponseForModifiedCorrection(rangeToReplace.get(), replacedString, result->replacement); 2240 } else if (markers->hasMarkers(rangeToReplace.get(), DocumentMarker::RejectedCorrection)) 2241 doReplacement = false; 2242 2243 if (!(shouldPerformReplacement || shouldShowCorrectionPanel) || !doReplacement) 2236 bool existingMarkersPermitReplacement = m_spellingCorrector->processMarkersOnTextToBeReplacedByResult(result, rangeToReplace.get(), replacedString); 2237 if (!existingMarkersPermitReplacement) 2244 2238 continue; 2245 2239 … … 2425 2419 document->markers()->removeMarkers(wordRange.get(), DocumentMarker::Spelling | DocumentMarker::CorrectionIndicator | DocumentMarker::SpellCheckingExemption, DocumentMarkerController::RemovePartiallyOverlappingMarker); 2426 2420 document->markers()->clearDescriptionOnMarkersIntersectingRange(wordRange.get(), DocumentMarker::Replacement); 2421 } 2422 2423 void Editor::deletedAutocorrectionAtPosition(const Position& position, const String& originalString) 2424 { 2425 m_spellingCorrector->deletedAutocorrectionAtPosition(position, originalString); 2427 2426 } 2428 2427 -
trunk/Source/WebCore/editing/Editor.h
r86135 r86295 385 385 bool selectionStartHasMarkerFor(DocumentMarker::MarkerType, int from, int length) const; 386 386 void updateMarkersForWordsAffectedByEditing(bool onlyHandleWordsContainingSelection); 387 void deletedAutocorrectionAtPosition(const Position&, const String& originalString); 387 388 388 389 private: -
trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp
r83247 r86295 313 313 Text* textNode = static_cast<Text*>(leadingWhitespace.deprecatedNode()); 314 314 ASSERT(!textNode->renderer() || textNode->renderer()->style()->collapseWhiteSpace()); 315 replaceTextInNode (textNode, leadingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());315 replaceTextInNodePreservingMarkers(textNode, leadingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString()); 316 316 } 317 317 -
trunk/Source/WebCore/editing/SpellingCorrectionController.cpp
r85864 r86295 430 430 if (command->isTopLevelCommand() && !command->shouldRetainAutocorrectionIndicator()) 431 431 m_frame->document()->markers()->removeMarkers(DocumentMarker::CorrectionIndicator); 432 433 markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand(command); 434 m_originalStringForLastDeletedAutocorrection = String(); 432 435 } 433 436 … … 503 506 } 504 507 508 void SpellingCorrectionController::deletedAutocorrectionAtPosition(const Position& position, const String& originalString) 509 { 510 m_originalStringForLastDeletedAutocorrection = originalString; 511 m_positionForLastDeletedAutocorrection = position; 512 } 513 514 void SpellingCorrectionController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand(EditCommand* command) 515 { 516 Position endOfSelection = command->endingSelection().end(); 517 if (endOfSelection != m_positionForLastDeletedAutocorrection) 518 return; 519 520 Position precedingCharacterPosition = endOfSelection.previous(); 521 if (endOfSelection == precedingCharacterPosition) 522 return; 523 524 RefPtr<Range> precedingCharacterRange = Range::create(m_frame->document(), precedingCharacterPosition, endOfSelection); 525 String string = plainText(precedingCharacterRange.get()); 526 if (string.isEmpty() || !isWhitespace(string[string.length() - 1])) 527 return; 528 529 // Mark this whitespace to indicate we have deleted an autocorrection following this 530 // whitespace. So if the user types the same original word again at this position, we 531 // won't autocorrect it again. 532 m_frame->document()->markers()->addMarker(precedingCharacterRange.get(), DocumentMarker::DeletedAutocorrection, m_originalStringForLastDeletedAutocorrection); 533 } 534 535 bool SpellingCorrectionController::processMarkersOnTextToBeReplacedByResult(const TextCheckingResult* result, Range* rangeToBeReplaced, const String& stringToBeReplaced) 536 { 537 DocumentMarkerController* markerController = m_frame->document()->markers(); 538 if (markerController->hasMarkers(rangeToBeReplaced, DocumentMarker::Replacement)) { 539 if (result->type == TextCheckingTypeCorrection) 540 recordSpellcheckerResponseForModifiedCorrection(rangeToBeReplaced, stringToBeReplaced, result->replacement); 541 return false; 542 } 543 544 if (markerController->hasMarkers(rangeToBeReplaced, DocumentMarker::RejectedCorrection)) 545 return false; 546 547 Position beginningOfRange = rangeToBeReplaced->startPosition(); 548 Position precedingCharacterPosition = beginningOfRange.previous(); 549 RefPtr<Range> precedingCharacterRange = Range::create(m_frame->document(), precedingCharacterPosition, beginningOfRange); 550 551 Vector<DocumentMarker> markers = markerController->markersInRange(precedingCharacterRange.get(), DocumentMarker::DeletedAutocorrection); 552 553 for (size_t i = 0; i < markers.size(); ++i) { 554 if (markers[i].description == stringToBeReplaced) 555 return false; 556 } 557 558 return true; 559 } 560 505 561 #endif 506 562 -
trunk/Source/WebCore/editing/SpellingCorrectionController.h
r85036 r86295 67 67 }; 68 68 69 struct TextCheckingResult; 70 69 71 enum ReasonForDismissingCorrectionPanel { 70 72 ReasonForDismissingCorrectionPanelCancelled = 0, … … 118 120 void recordSpellcheckerResponseForModifiedCorrection(Range* rangeOfCorrection, const String& corrected, const String& correction) UNLESS_ENABLED({ UNUSED_PARAM(rangeOfCorrection); UNUSED_PARAM(corrected); UNUSED_PARAM(correction); }) 119 121 122 // This function returns false if the replacement should not be carried out. 123 bool processMarkersOnTextToBeReplacedByResult(const TextCheckingResult*, Range* rangeToBeReplaced, const String& stringToBeReplaced) UNLESS_ENABLED({ UNUSED_PARAM(rangeToBeReplaced); UNUSED_PARAM(stringToBeReplaced); return true; }); 124 void deletedAutocorrectionAtPosition(const Position&, const String& originalString) UNLESS_ENABLED({ UNUSED_PARAM(originalString); }) 125 120 126 #if SUPPORT_AUTOCORRECTION_PANEL 121 127 private: … … 131 137 TextCheckerClient* textChecker(); 132 138 FloatRect windowRectForRange(const Range*) const; 139 void markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand(EditCommand*); 133 140 134 141 EditorClient* m_client; … … 138 145 CorrectionPanelInfo m_correctionPanelInfo; 139 146 bool m_correctionPanelIsDismissedByEditor; 147 148 String m_originalStringForLastDeletedAutocorrection; 149 Position m_positionForLastDeletedAutocorrection; 140 150 #endif 141 151 }; -
trunk/Source/WebCore/editing/visible_units.cpp
r84710 r86295 314 314 } 315 315 316 bool isStartOfWord(const VisiblePosition& p) 317 { 318 return p.isNotNull() && p == startOfWord(p, RightWordIfOnBoundary); 319 } 320 316 321 // --------- 317 322 -
trunk/Source/WebCore/editing/visible_units.h
r82588 r86295 45 45 VisiblePosition rightWordPosition(const VisiblePosition&); 46 46 VisiblePosition leftWordPosition(const VisiblePosition&); 47 bool isStartOfWord(const VisiblePosition&); 47 48 48 49 // sentences -
trunk/Source/WebCore/manual-tests/autocorrection/spell-checking-after-reversion.html
r77577 r86295 35 35 <li>After seeing the correction panel, press space to accept the correction.</li> 36 36 <li>Press delete key to bring up reversion bubble.</li> 37 <li>Press ESCkey to accept the reversion suggestion.</li>37 <li>Press down arrow followed by return key to accept the reversion suggestion.</li> 38 38 <li>Press space key again, and verify that the word "cylindr" IS NOT marked as misspelled.</li> 39 39 <li>Press delete key twice.</li>
Note: See TracChangeset
for help on using the changeset viewer.