Changeset 68243 in webkit
- Timestamp:
- Sep 24, 2010 1:44:24 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r68242 r68243 1 2010-09-24 Jia Pu <jpu@apple.com> 2 3 Reviewed by Shinichiro Hamaji. 4 5 Need to remove autocorrection underlines in current line when newline is entered. 6 https://bugs.webkit.org/show_bug.cgi?id=45709 7 <rdar://problem/8335576> 8 9 This change affects only Mac OSX build. 10 11 * dom/DocumentMarker.h: Added "CorrectionIndicator" to indicate the words on which we need 12 to draw autocorrection underline. We cannot use existing "Replacement" for this purpose, 13 since it is not meant to be removed once it is added. But we need to remove all autocorrection 14 underlines when a line break or paragraph separator is inserted, which is the behavior in 15 NSTextView. Hence we need a separate marker value for drawing autocorrection underline. 16 17 * editing/Editor.cpp: 18 (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Add "CorrectionIndicator" when 19 autocorrection takes place. 20 (WebCore::Editor::changeSelectionAfterCommand): Remove "CorrectionIndicator" markers if the 21 command results in inserting paragraph separator. 22 23 * rendering/InlineTextBox.cpp: 24 (WebCore::textCheckingLineStyleForMarkerType): Use "CorrectionIndicator" marker instead of 25 "Replacement" to draw autocorrection underline. 26 (WebCore::InlineTextBox::paintDocumentMarkers): Ditto. 27 1 28 2010-09-24 Eric Uhrhane <ericu@chromium.org> 2 29 -
trunk/WebCore/dom/DocumentMarker.h
r66643 r68243 41 41 TextMatch, 42 42 Replacement, 43 CorrectionIndicator, 43 44 RejectedCorrection 44 45 }; -
trunk/WebCore/editing/Editor.cpp
r68103 r68243 2742 2742 RefPtr<Range> replacedRange = TextIterator::subrange(paragraphRange.get(), resultLocation, replacementLength); 2743 2743 replacedRange->startContainer()->document()->markers()->addMarker(replacedRange.get(), DocumentMarker::Replacement, replacedString); 2744 replacedRange->startContainer()->document()->markers()->addMarker(replacedRange.get(), DocumentMarker::CorrectionIndicator); 2744 2745 } 2745 2746 } … … 3122 3123 if (newSelection.start().isOrphan() || newSelection.end().isOrphan()) 3123 3124 return; 3125 3126 #if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 3127 // Check to see if the command introduced paragraph separator. If it did, we remove existing autocorrection underlines. 3128 // This is in consistency with the behavior in AppKit 3129 if (!inSameParagraph(m_frame->selection()->selection().visibleStart(), newSelection.visibleEnd())) 3130 m_frame->document()->markers()->removeMarkers(DocumentMarker::CorrectionIndicator); 3131 #endif 3124 3132 3125 3133 // If there is no selection change, don't bother sending shouldChangeSelection, but still call setSelection, -
trunk/WebCore/rendering/InlineTextBox.cpp
r68177 r68243 776 776 case DocumentMarker::Grammar: 777 777 return GraphicsContext::TextCheckingGrammarLineStyle; 778 case DocumentMarker:: Replacement:778 case DocumentMarker::CorrectionIndicator: 779 779 return GraphicsContext::TextCheckingReplacementLineStyle; 780 780 default: … … 914 914 case DocumentMarker::Spelling: 915 915 case DocumentMarker::Replacement: 916 case DocumentMarker::CorrectionIndicator: 916 917 case DocumentMarker::RejectedCorrection: 917 918 if (background) … … 947 948 paintTextMatchMarker(pt, tx, ty, marker, style, font); 948 949 break; 949 case DocumentMarker:: Replacement:950 case DocumentMarker::CorrectionIndicator: 950 951 computeRectForReplacementMarker(tx, ty, marker, style, font); 951 952 paintSpellingOrGrammarMarker(pt, tx, ty, marker, style, font, false); 952 953 break; 954 case DocumentMarker::Replacement: 953 955 case DocumentMarker::RejectedCorrection: 954 956 break;
Note: See TracChangeset
for help on using the changeset viewer.