Changeset 87117 in webkit
- Timestamp:
- May 23, 2011 6:58:41 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r87115 r87117 1 2011-05-22 MORITA Hajime <morrita@google.com> 2 3 Reviewed by Ryosuke Niwa. 4 5 SUPPORT_AUTOCORRECTION_PANEL should be USE(AUTOCORRECTION_PANEL) 6 https://bugs.webkit.org/show_bug.cgi?id=61181 7 8 - Removed SUPPORT_AUTOCORRECTION_PANEL and REMOVE_MARKERS_UPON_EDITING from SpellingCorrectionController.h 9 - Define WTF_USE_UNIFIED_TEXT_CHECKING and WTF_USE_AUTOMATIC_TEXT_REPLACEMENT at TextChecking.h 10 11 No new tests. Just renaming a compilation conditional. 12 13 * editing/Editor.cpp: 14 (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): 15 * editing/SpellingCorrectionCommand.cpp: 16 (WebCore::SpellingCorrectionCommand::doApply): 17 * editing/SpellingCorrectionController.cpp: 18 * editing/SpellingCorrectionController.h: 19 (WebCore::SpellingCorrectionController::shouldRemoveMarkersUponEditing): 20 * loader/EmptyClients.h: 21 * page/EditorClient.h: 22 * platform/text/TextChecking.h: 23 1 24 2011-05-23 Sheriff Bot <webkit.review.bot@gmail.com> 2 25 -
trunk/Source/WebCore/editing/Editor.cpp
r87082 r87117 2222 2222 2223 2223 if (shouldShowCorrectionPanel) { 2224 ASSERT(SUPPORT_AUTOCORRECTION_PANEL); 2224 #if !USE(AUTOCORRECTION_PANEL) 2225 ASSERT_NOT_REACHED(); 2226 #endif 2225 2227 // shouldShowCorrectionPanel can be true only when the panel is available. 2226 2228 if (resultLocation + resultLength == spellingRangeEndOffset) { -
trunk/Source/WebCore/editing/SpellingCorrectionCommand.cpp
r86325 r87117 38 38 namespace WebCore { 39 39 40 #if SUPPORT_AUTOCORRECTION_PANEL40 #if USE(AUTOCORRECTION_PANEL) 41 41 // On Mac OS X, we use this command to keep track of user undoing a correction for the first time. 42 42 // This information is needed by spell checking service to update user specific data. … … 97 97 98 98 applyCommandToComposite(SetSelectionCommand::create(m_selectionToBeCorrected, FrameSelection::SpellCorrectionTriggered | FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle)); 99 #if SUPPORT_AUTOCORRECTION_PANEL99 #if USE(AUTOCORRECTION_PANEL) 100 100 applyCommandToComposite(SpellingCorrectionRecordUndoCommand::create(document(), m_corrected, m_correction)); 101 101 #endif -
trunk/Source/WebCore/editing/SpellingCorrectionController.cpp
r86847 r87117 49 49 using namespace WTF; 50 50 51 #if SUPPORT_AUTOCORRECTION_PANEL51 #if USE(AUTOCORRECTION_PANEL) 52 52 53 53 static const Vector<DocumentMarker::MarkerType>& markerTypesForAutocorrection() -
trunk/Source/WebCore/editing/SpellingCorrectionController.h
r86813 r87117 26 26 #ifndef SpellingCorrectionController_h 27 27 #define SpellingCorrectionController_h 28 29 #if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)30 // Some platforms provide UI for suggesting autocorrection.31 #define SUPPORT_AUTOCORRECTION_PANEL 132 // Some platforms use spelling and autocorrection markers to provide visual cue.33 // On such platform, if word with marker is edited, we need to remove the marker.34 #define REMOVE_MARKERS_UPON_EDITING 135 #else36 #define SUPPORT_AUTOCORRECTION_PANEL 037 #define REMOVE_MARKERS_UPON_EDITING 038 #endif // #if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)39 28 40 29 #include "DocumentMarker.h" … … 74 63 }; 75 64 76 #if SUPPORT_AUTOCORRECTION_PANEL65 #if USE(AUTOCORRECTION_PANEL) 77 66 #define UNLESS_ENABLED(functionBody) ; 78 67 #else … … 111 100 bool isSpellingMarkerAllowed(PassRefPtr<Range> misspellingRange) const UNLESS_ENABLED({ UNUSED_PARAM(misspellingRange); return true; }) 112 101 bool isAutomaticSpellingCorrectionEnabled() UNLESS_ENABLED({ return false; }) 113 bool shouldRemoveMarkersUponEditing() { return REMOVE_MARKERS_UPON_EDITING; }102 bool shouldRemoveMarkersUponEditing(); 114 103 115 104 void correctionPanelTimerFired(Timer<SpellingCorrectionController>*) UNLESS_ENABLED({}) … … 123 112 void deletedAutocorrectionAtPosition(const Position&, const String& originalString) UNLESS_ENABLED({ UNUSED_PARAM(originalString); }) 124 113 125 #if SUPPORT_AUTOCORRECTION_PANEL114 #if USE(AUTOCORRECTION_PANEL) 126 115 private: 127 116 void recordAutocorrectionResponseReversed(const String& replacedString, const String& replacementString); … … 152 141 #undef UNLESS_ENABLED 153 142 143 inline bool SpellingCorrectionController::shouldRemoveMarkersUponEditing() 144 { 145 #if USE(MARKER_REMOVAL_UPON_EDITING) 146 return true; 147 #else 148 return false; 149 #endif 150 } 151 154 152 } // namespace WebCore 155 153 -
trunk/Source/WebCore/loader/EmptyClients.h
r86988 r87117 517 517 TextCheckerClient* textChecker() { return &m_textCheckerClient; } 518 518 519 #if SUPPORT_AUTOCORRECTION_PANEL519 #if USE(AUTOCORRECTION_PANEL) 520 520 virtual void showCorrectionPanel(CorrectionPanelInfo::PanelType, const FloatRect&, const String&, const String&, const Vector<String>&) { } 521 521 virtual void dismissCorrectionPanel(ReasonForDismissingCorrectionPanel) { } -
trunk/Source/WebCore/page/EditorClient.h
r86451 r87117 156 156 }; 157 157 158 #if SUPPORT_AUTOCORRECTION_PANEL158 #if USE(AUTOCORRECTION_PANEL) 159 159 virtual void showCorrectionPanel(CorrectionPanelInfo::PanelType, const FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacmentString, const Vector<String>& alternativeReplacementStrings) = 0; 160 160 virtual void dismissCorrectionPanel(ReasonForDismissingCorrectionPanel) = 0; -
trunk/Source/WebCore/platform/text/TextChecking.h
r86520 r87117 41 41 #endif 42 42 43 #if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 44 // Some platforms provide UI for suggesting autocorrection. 45 #define WTF_USE_AUTOCORRECTION_PANEL 1 46 // Some platforms use spelling and autocorrection markers to provide visual cue. 47 // On such platform, if word with marker is edited, we need to remove the marker. 48 #define WTF_USE_MARKER_REMOVAL_UPON_EDITING 1 49 #endif // #if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 50 43 51 enum TextCheckingType { 44 52 TextCheckingTypeSpelling = 1 << 1,
Note: See TracChangeset
for help on using the changeset viewer.