Changeset 80405 in webkit
- Timestamp:
- Mar 4, 2011, 9:20:23 PM (14 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r80404 r80405 1 2011-03-04 Jia Pu <jpu@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Those checking in Editor::removeSpellAndCorrectionMarkersFromWordsToBeEdited() should be done with VisiblePosition::isNull(). 6 https://bugs.webkit.org/show_bug.cgi?id=55731 7 8 No new tests. There's no behavioral change. 9 10 This patch improved clarity and readability of Editor::removeSpellAndCorrectionMarkersFromWordsToBeEdited(). 11 12 * editing/Editor.cpp: 13 (WebCore::Editor::removeSpellAndCorrectionMarkersFromWordsToBeEdited): 14 1 15 2011-03-04 John Bauman <jbauman@chromium.org> 2 16 -
trunk/Source/WebCore/editing/Editor.cpp
r80226 r80405 2691 2691 VisiblePosition endOfLastWord = endOfWord(endOfSelection, RightWordIfOnBoundary); 2692 2692 2693 // This can be the case if the end of selection is at the end of document. 2694 if (endOfLastWord.deepEquivalent().anchorType() != Position::PositionIsOffsetInAnchor) { 2695 startOfLastWord = startOfWord(frame()->selection()->selection().start(), LeftWordIfOnBoundary); 2696 endOfLastWord = endOfWord(frame()->selection()->selection().start(), LeftWordIfOnBoundary); 2693 if (startOfFirstWord.isNull()) { 2694 startOfFirstWord = startOfWord(startOfSelection, RightWordIfOnBoundary); 2695 endOfFirstWord = endOfWord(startOfSelection, RightWordIfOnBoundary); 2696 } 2697 2698 if (endOfLastWord.isNull()) { 2699 startOfLastWord = startOfWord(endOfSelection, LeftWordIfOnBoundary); 2700 endOfLastWord = endOfWord(endOfSelection, LeftWordIfOnBoundary); 2697 2701 } 2698 2702 … … 2701 2705 if (doNotRemoveIfSelectionAtWordBoundary && endOfFirstWord == startOfSelection) { 2702 2706 startOfFirstWord = nextWordPosition(startOfFirstWord); 2703 if (startOfFirstWord.isNull() || startOfFirstWord == endOfSelection)2704 return;2705 2707 endOfFirstWord = endOfWord(startOfFirstWord, RightWordIfOnBoundary); 2706 if ( endOfFirstWord.deepEquivalent().anchorType() != Position::PositionIsOffsetInAnchor)2708 if (startOfFirstWord == endOfSelection) 2707 2709 return; 2708 2710 } … … 2713 2715 startOfLastWord = previousWordPosition(startOfLastWord); 2714 2716 endOfLastWord = endOfWord(startOfLastWord, RightWordIfOnBoundary); 2715 if (endOfLastWord == startOf FirstWord)2717 if (endOfLastWord == startOfSelection) 2716 2718 return; 2717 2719 } 2720 2721 if (startOfFirstWord.isNull() || endOfFirstWord.isNull() || startOfLastWord.isNull() || endOfLastWord.isNull()) 2722 return; 2718 2723 2719 2724 // Now we remove markers on everything between startOfFirstWord and endOfLastWord.
Note:
See TracChangeset
for help on using the changeset viewer.