2011-04-06 Jia Pu <jpu@apple.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Apr 2011 16:09:28 +0000 (16:09 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Apr 2011 16:09:28 +0000 (16:09 +0000)
commitba9efca7c66dca02100f7ea0a655bd195033afb6
treefc563ea14ab1ab2a9ff0090ab2fac3c26bb6819a
parente498177de46887c8df75f623f8e6ad7ffef55825
2011-04-06  Jia Pu  <jpu@apple.com>

        Reviewed by Darin Adler.

        [Mac] WebCore need to notify AppKit spell checker after user has modified autocorrected text.
        https://bugs.webkit.org/show_bug.cgi?id=57665
        <rdar://problem/7350477>

        We need to track how user modified an autocorrected word. If he changed it back to original
        text, we want to record AutocorrectionReverted response. And if he changed it to something
        else, we want to record AutocorrectionEdited response.

        To achieve this, we need to distringuish between text replacement caused by autocorrection
        from that due to other causes, such as reversion, text substitution, etc. So we added a new
        marker type "Autocorrected". We also need to be able to check for correction, even when we
        don't intend to actually carry out replacement. For this, we introduced a new TextCheckingOption
        value, "CheckForCorrection".

        We also added DocumentMarkerController::markersInRange() to retrieve a vector of markers in
        specified range, and of specified type.

        * dom/DocumentMarker.h:
        * dom/DocumentMarkerController.cpp:
        (WebCore::DocumentMarkerController::markersInRange):
        (WebCore::DocumentMarkerController::hasMarkers):
        * dom/DocumentMarkerController.h:
        * editing/Editor.cpp:
        (WebCore::markerTypesForAutocorrection):
        (WebCore::markersHaveIdenticalDescription):
        (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
        (WebCore::Editor::recordSpellcheckerResponseForModifiedCorrection):
        (WebCore::Editor::changeBackToReplacedString):
        (WebCore::Editor::markMisspellingsAndBadGrammar):
        (WebCore::Editor::applyCorrectionPanelInfo):
        (WebCore::Editor::unappliedSpellCorrection):
        (WebCore::Editor::textCheckingTypeMaskFor):
        * editing/Editor.h:
        * editing/SpellingCorrectionCommand.cpp:
        (WebCore::SpellingCorrectionCommand::doApply):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/dom/DocumentMarker.h
Source/WebCore/dom/DocumentMarkerController.cpp
Source/WebCore/dom/DocumentMarkerController.h
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/Editor.h
Source/WebCore/editing/SpellingCorrectionCommand.cpp