2011-04-04 MORITA Hajime <morrita@google.com>
authormorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Apr 2011 17:23:34 +0000 (17:23 +0000)
committermorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Apr 2011 17:23:34 +0000 (17:23 +0000)
        Reviewed by Ryosuke Niwa.

        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
        https://bugs.webkit.org/show_bug.cgi?id=56085

        Removed WebCore::SpellCheckingResult and replaced it with TextCheckingResult.
        This change also added TextCheckerClient::requestCheckingOfString() should have
        TextCheckingTypeMask as a parameter to control text checking type.

        * WebCore.exp.in:
        * editing/Editor.cpp:
        (WebCore::Editor::replaceSelectionWithFragment):
        (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
        (WebCore::Editor::textCheckingTypeMaskFor): Extracted from markAllMisspellingsAndBadGrammarInRanges()
        * editing/SpellChecker.cpp:
        (WebCore::SpellChecker::requestCheckingFor): Added a parameter.
        (WebCore::SpellChecker::markAt): Extracted from didCheck(), Added a check for the GrammarDetail object.
        (WebCore::SpellChecker::didCheck):
        * editing/SpellChecker.h:
        * loader/EmptyClients.h:
        (WebCore::EmptyTextCheckerClient::checkTextOfParagraph):
        (WebCore::EmptyTextCheckerClient::requestCheckingOfString):
        * platform/text/TextCheckerClient.h:
2011-04-04  MORITA Hajime  <morrita@google.com>

        Reviewed by Ryosuke Niwa.

        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
        https://bugs.webkit.org/show_bug.cgi?id=56085

        Followed the signature change.

        * src/EditorClientImpl.h:
        * src/EditorClientImpl.cpp:
        * src/WebTextCheckingCompletionImpl.cpp
2011-04-04  MORITA Hajime  <morrita@google.com>

        Reviewed by Ryosuke Niwa.

        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
        https://bugs.webkit.org/show_bug.cgi?id=56085

        * WebCoreSupport/EditorClientEfl.h:
        (WebCore::EditorClientEfl::requestCheckingOfString):
2011-04-04  MORITA Hajime  <morrita@google.com>

        Reviewed by Ryosuke Niwa.

        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
        https://bugs.webkit.org/show_bug.cgi?id=56085

        * WebCoreSupport/TextCheckerClientEnchant.h:
        (WebKit::TextCheckerClientEnchant::requestCheckingOfString):
2011-04-04  MORITA Hajime  <morrita@google.com>

        Reviewed by Ryosuke Niwa.

        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
        https://bugs.webkit.org/show_bug.cgi?id=56085

        * WebCoreSupport/EditorClientHaiku.h:
        (WebCore::EditorClientHaiku::requestCheckingOfString):
2011-04-04  MORITA Hajime  <morrita@google.com>

        Reviewed by Ryosuke Niwa.

        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
        https://bugs.webkit.org/show_bug.cgi?id=56085

        Removed NSTextCheckingResult to SpellCheckingResult convertion, and extracted
        NSTextCheckingResult to TextCheckingResult convertio from checkTextOfParagraph method.
        for requestCheckingOfString method.

        * WebCoreSupport/WebEditorClient.h:
        * WebCoreSupport/WebEditorClient.mm:
        (toCoreTextCheckingResults):
        (WebEditorClient::checkTextOfParagraph):
        (-[WebEditorSpellCheckResponder initWithSender:WebCore::sequence:types:WebCore::results:]):
        (-[WebEditorSpellCheckResponder perform]):
        (WebEditorClient::requestCheckingOfString):
        * WebView/WebFrame.mm:
        (-[WebFrame markersForSelectionStartAsText]):
        * WebView/WebFramePrivate.h:
2011-04-04  MORITA Hajime  <morrita@google.com>

        Reviewed by Ryosuke Niwa.

        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
        https://bugs.webkit.org/show_bug.cgi?id=56085

        * WebCoreSupport/EditorClientQt.h:
        (WebCore::EditorClientQt::requestCheckingOfString):
2011-04-04  MORITA Hajime  <morrita@google.com>

        Reviewed by Ryosuke Niwa.

        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
        https://bugs.webkit.org/show_bug.cgi?id=56085

        * WebCoreSupport/WebEditorClient.h:
        (WebEditorClient::requestCheckingOfString):
2011-04-04  MORITA Hajime  <morrita@google.com>

        Reviewed by Ryosuke Niwa.

        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
        https://bugs.webkit.org/show_bug.cgi?id=56085

        * WebCoreSupport/EditorClientWinCE.h:
        (WebKit::EditorClientWinCE::requestCheckingOfString):
2011-04-04  MORITA Hajime  <morrita@google.com>

        Reviewed by Ryosuke Niwa.

        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
        https://bugs.webkit.org/show_bug.cgi?id=56085

        * WebKitSupport/EditorClientWx.h:
        (WebCore::EditorClientWx::requestCheckingOfString):
2011-04-04  MORITA Hajime  <morrita@google.com>

        Reviewed by Ryosuke Niwa.

        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
        https://bugs.webkit.org/show_bug.cgi?id=56085

        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::WebEditorClient::requestCheckingOfString):
        * WebProcess/WebCoreSupport/WebEditorClient.h:
        * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
        (WebKit::WebEditorClient::checkTextOfParagraph):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@82952 268f45cc-cd09-0410-ab3c-d52691b4dbfc

35 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/Editor.h
Source/WebCore/editing/SpellChecker.cpp
Source/WebCore/editing/SpellChecker.h
Source/WebCore/editing/TextCheckingHelper.cpp
Source/WebCore/loader/EmptyClients.h
Source/WebCore/platform/text/TextCheckerClient.h
Source/WebCore/platform/text/TextChecking.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/EditorClientImpl.cpp
Source/WebKit/chromium/src/EditorClientImpl.h
Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/EditorClientEfl.h
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/TextCheckerClientEnchant.h
Source/WebKit/haiku/ChangeLog
Source/WebKit/haiku/WebCoreSupport/EditorClientHaiku.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebEditorClient.h
Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/EditorClientQt.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebEditorClient.h
Source/WebKit/wince/ChangeLog
Source/WebKit/wince/WebCoreSupport/EditorClientWinCE.h
Source/WebKit/wx/ChangeLog
Source/WebKit/wx/WebKitSupport/EditorClientWx.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm

index 87a7d4f..6982a79 100644 (file)
@@ -1,3 +1,29 @@
+2011-04-04 MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Ryosuke Niwa.
+
+        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
+        https://bugs.webkit.org/show_bug.cgi?id=56085
+        
+        Removed WebCore::SpellCheckingResult and replaced it with TextCheckingResult.
+        This change also added TextCheckerClient::requestCheckingOfString() should have
+        TextCheckingTypeMask as a parameter to control text checking type.
+
+        * WebCore.exp.in:
+        * editing/Editor.cpp:
+        (WebCore::Editor::replaceSelectionWithFragment):
+        (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
+        (WebCore::Editor::textCheckingTypeMaskFor): Extracted from markAllMisspellingsAndBadGrammarInRanges()
+        * editing/SpellChecker.cpp:
+        (WebCore::SpellChecker::requestCheckingFor): Added a parameter.
+        (WebCore::SpellChecker::markAt): Extracted from didCheck(), Added a check for the GrammarDetail object.
+        (WebCore::SpellChecker::didCheck):
+        * editing/SpellChecker.h:
+        * loader/EmptyClients.h:
+        (WebCore::EmptyTextCheckerClient::checkTextOfParagraph):
+        (WebCore::EmptyTextCheckerClient::requestCheckingOfString):
+        * platform/text/TextCheckerClient.h:
+
 2011-04-04  Antti Koivisto  <antti@apple.com>
 
         Reviewed by Sam Weinig.
index 8e41567..e91fe6c 100644 (file)
@@ -293,7 +293,7 @@ __ZN7WebCore12SharedBufferC1EPKci
 __ZN7WebCore12SharedBufferC1EPKhi
 __ZN7WebCore12SharedBufferC1Ev
 __ZN7WebCore12SharedBufferD1Ev
-__ZN7WebCore12SpellChecker8didCheckEiRKN3WTF6VectorINS_19SpellCheckingResultELm0EEE
+__ZN7WebCore12SpellChecker8didCheckEiRKN3WTF6VectorINS_18TextCheckingResultELm0EEE
 __ZN7WebCore12TextEncodingC1ERKN3WTF6StringE
 __ZN7WebCore12TextIterator11rangeLengthEPKNS_5RangeEb
 __ZN7WebCore12TextIterator26rangeFromLocationAndLengthEPNS_7ElementEiib
index 05fa1d8..67f54c4 100644 (file)
@@ -64,7 +64,6 @@
 #include "NodeList.h"
 #include "Page.h"
 #include "Pasteboard.h"
-#include "TextCheckerClient.h"
 #include "TextCheckingHelper.h"
 #include "RemoveFormatCommand.h"
 #include "RenderBlock.h"
@@ -440,7 +439,7 @@ void Editor::replaceSelectionWithFragment(PassRefPtr<DocumentFragment> fragment,
 
     Node* nodeToCheck = m_frame->selection()->rootEditableElement();
     if (m_spellChecker->canCheckAsynchronously(nodeToCheck))
-        m_spellChecker->requestCheckingFor(nodeToCheck);
+        m_spellChecker->requestCheckingFor(textCheckingTypeMaskFor(MarkSpelling | MarkGrammar), nodeToCheck);
 }
 
 void Editor::replaceSelectionWithText(const String& text, bool selectReplacement, bool smartReplace)
@@ -2257,31 +2256,12 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(TextCheckingOptions textCh
     }
 
     Vector<TextCheckingResult> results;
-    uint64_t checkingTypes = 0;
-    if (shouldMarkSpelling)
-        checkingTypes |= TextCheckingTypeSpelling;
     if (shouldMarkGrammar)
-        checkingTypes |= TextCheckingTypeGrammar;
-    if (shouldShowCorrectionPanel)
-        checkingTypes |= TextCheckingTypeCorrection;
-    if (shouldPerformReplacement) {
-#if USE(AUTOMATIC_TEXT_REPLACEMENT)
-        if (isAutomaticLinkDetectionEnabled())
-            checkingTypes |= TextCheckingTypeLink;
-        if (isAutomaticQuoteSubstitutionEnabled())
-            checkingTypes |= TextCheckingTypeQuote;
-        if (isAutomaticDashSubstitutionEnabled())
-            checkingTypes |= TextCheckingTypeDash;
-        if (isAutomaticTextReplacementEnabled())
-            checkingTypes |= TextCheckingTypeReplacement;
-        if (shouldMarkSpelling && isAutomaticSpellingCorrectionEnabled())
-            checkingTypes |= TextCheckingTypeCorrection;
-#endif
-    }
-    if (shouldMarkGrammar)
-        textChecker()->checkTextOfParagraph(grammarParagraph.textCharacters(), grammarParagraph.textLength(), checkingTypes, results);
+        textChecker()->checkTextOfParagraph(grammarParagraph.textCharacters(), grammarParagraph.textLength(), 
+                                            textCheckingTypeMaskFor(textCheckingOptions), results);
     else
-        textChecker()->checkTextOfParagraph(spellingParagraph.textCharacters(), spellingParagraph.textLength(), checkingTypes, results);
+        textChecker()->checkTextOfParagraph(spellingParagraph.textCharacters(), spellingParagraph.textLength(), 
+                                            textCheckingTypeMaskFor(textCheckingOptions), results);
         
 
 #if SUPPORT_AUTOCORRECTION_PANEL
@@ -3604,4 +3584,37 @@ FloatRect Editor::windowRectForRange(const Range* range) const
     return view->contentsToWindow(IntRect(boundingRect));
 }        
 
+TextCheckingTypeMask Editor::textCheckingTypeMaskFor(TextCheckingOptions textCheckingOptions)
+{
+    bool shouldMarkSpelling = textCheckingOptions & MarkSpelling;
+    bool shouldMarkGrammar = textCheckingOptions & MarkGrammar;
+    bool shouldShowCorrectionPanel = textCheckingOptions & ShowCorrectionPanel;
+
+    TextCheckingTypeMask checkingTypes = 0;
+    if (shouldMarkSpelling)
+        checkingTypes |= TextCheckingTypeSpelling;
+    if (shouldMarkGrammar)
+        checkingTypes |= TextCheckingTypeGrammar;
+    if (shouldShowCorrectionPanel)
+        checkingTypes |= TextCheckingTypeCorrection;
+
+#if USE(AUTOMATIC_TEXT_REPLACEMENT)
+    bool shouldPerformReplacement = textCheckingOptions & PerformReplacement;
+    if (shouldPerformReplacement) {
+        if (isAutomaticLinkDetectionEnabled())
+            checkingTypes |= TextCheckingTypeLink;
+        if (isAutomaticQuoteSubstitutionEnabled())
+            checkingTypes |= TextCheckingTypeQuote;
+        if (isAutomaticDashSubstitutionEnabled())
+            checkingTypes |= TextCheckingTypeDash;
+        if (isAutomaticTextReplacementEnabled())
+            checkingTypes |= TextCheckingTypeReplacement;
+        if (shouldMarkSpelling && isAutomaticSpellingCorrectionEnabled())
+            checkingTypes |= TextCheckingTypeCorrection;
+    }
+#endif
+
+    return checkingTypes;
+}
+
 } // namespace WebCore
index dea77c2..7745351 100644 (file)
@@ -223,6 +223,15 @@ public:
     void markMisspellings(const VisibleSelection&, RefPtr<Range>& firstMisspellingRange);
     void markBadGrammar(const VisibleSelection&);
     void markMisspellingsAndBadGrammar(const VisibleSelection& spellingSelection, bool markGrammar, const VisibleSelection& grammarSelection);
+
+    enum TextCheckingOptionFlags {
+        MarkSpelling = 1 << 0,
+        MarkGrammar = 1 << 1,
+        PerformReplacement = 1 << 2,
+        ShowCorrectionPanel = 1 << 3,
+    };
+    typedef unsigned TextCheckingOptions;
+
 #if USE(AUTOMATIC_TEXT_REPLACEMENT)
     void uppercaseWord();
     void lowercaseWord();
@@ -242,14 +251,6 @@ public:
     void toggleAutomaticSpellingCorrection();
 #endif
 
-    enum TextCheckingOptionFlags {
-        MarkSpelling = 1 << 0,
-        MarkGrammar = 1 << 1,
-        PerformReplacement = 1 << 2,
-        ShowCorrectionPanel = 1 << 3,
-    };
-    typedef unsigned TextCheckingOptions;
-
     void markAllMisspellingsAndBadGrammarInRanges(TextCheckingOptions, Range* spellingRange, Range* grammarRange);
     void changeBackToReplacedString(const String& replacedString);
 
@@ -414,6 +415,7 @@ private:
     void writeSelectionToPasteboard(Pasteboard*);
     void revealSelectionAfterEditingOperation();
     void markMisspellingsOrBadGrammar(const VisibleSelection&, bool checkSpelling, RefPtr<Range>& firstMisspellingRange);
+    TextCheckingTypeMask textCheckingTypeMaskFor(TextCheckingOptions);
 
     void selectComposition();
     void confirmComposition(const String&, bool preserveSelection);
index 7988e41..fedcc07 100644 (file)
@@ -100,13 +100,13 @@ bool SpellChecker::isCheckable(Node* node) const
     return node && node->renderer();
 }
 
-void SpellChecker::requestCheckingFor(Node* node)
+void SpellChecker::requestCheckingFor(TextCheckingTypeMask mask, Node* node)
 {
     ASSERT(canCheckAsynchronously(node));
 
     if (!initRequest(node))
         return;
-    m_client->requestCheckingOfString(this, m_requestSequence, m_requestText);
+    m_client->requestCheckingOfString(this, m_requestSequence, mask, m_requestText);
 }
 
 static bool forwardIterator(PositionIterator& iterator, int distance)
@@ -131,7 +131,16 @@ static bool forwardIterator(PositionIterator& iterator, int distance)
     return false;    
 }
 
-void SpellChecker::didCheck(int sequence, const Vector<SpellCheckingResult>& results)
+static DocumentMarker::MarkerType toMarkerType(TextCheckingType type)
+{
+    if (type == TextCheckingTypeSpelling)
+        return DocumentMarker::Spelling;
+    ASSERT(type == TextCheckingTypeGrammar);
+    return DocumentMarker::Grammar;
+}
+
+// Currenntly ignoring TextCheckingResult::details but should be handled. See Bug 56368.
+void SpellChecker::didCheck(int sequence, const Vector<TextCheckingResult>& results)
 {
     if (!isValid(sequence))
         return;
@@ -144,16 +153,16 @@ void SpellChecker::didCheck(int sequence, const Vector<SpellCheckingResult>& res
     int startOffset = 0;
     PositionIterator start = firstPositionInOrBeforeNode(m_requestNode.get());
     for (size_t i = 0; i < results.size(); ++i) {
-        if (results[i].type() != DocumentMarker::Spelling && results[i].type() != DocumentMarker::Grammar)
+        if (results[i].type != TextCheckingTypeSpelling && results[i].type != TextCheckingTypeGrammar)
             continue;
 
         // To avoid moving the position backward, we assume the given results are sorted with
         // startOffset as the ones returned by [NSSpellChecker requestCheckingOfString:].
-        ASSERT(startOffset <= results[i].location());
-        if (!forwardIterator(start, results[i].location() - startOffset))
+        ASSERT(startOffset <= results[i].location);
+        if (!forwardIterator(start, results[i].location - startOffset))
             break;
         PositionIterator end = start;
-        if (!forwardIterator(end, results[i].length()))
+        if (!forwardIterator(end, results[i].length))
             break;
 
         // Users or JavaScript applications may change text while a spell-checker checks its
@@ -163,11 +172,11 @@ void SpellChecker::didCheck(int sequence, const Vector<SpellCheckingResult>& res
         RefPtr<Range> range = Range::create(m_requestNode->document(), start, end);
         // FIXME: Use textContent() compatible string conversion.
         String destination = range->text();
-        String source = m_requestText.substring(results[i].location(), results[i].length());
+        String source = m_requestText.substring(results[i].location, results[i].length);
         if (destination == source)
-            m_requestNode->document()->markers()->addMarker(range.get(), results[i].type());
+            m_requestNode->document()->markers()->addMarker(range.get(), toMarkerType(results[i].type));
 
-        startOffset = results[i].location();
+        startOffset = results[i].location;
     }
 
     clearRequest();
index d3940e5..4bcb89e 100644 (file)
@@ -27,6 +27,7 @@
 #define SpellChecker_h
 
 #include "DocumentMarker.h"
+#include "TextCheckerClient.h"
 #include <wtf/Noncopyable.h>
 
 namespace WebCore {
@@ -35,25 +36,6 @@ class TextCheckerClient;
 class Frame;
 class Node;
 
-class SpellCheckingResult {
-public:
-    explicit SpellCheckingResult(DocumentMarker::MarkerType type = DocumentMarker::Spelling, int location = 0, int length = 0)
-        : m_type(type)
-        , m_location(location)
-        , m_length(length)
-    {
-    }
-
-    DocumentMarker::MarkerType type() const { return m_type; } 
-    int location() const { return m_location; }
-    int length() const { return m_length; }
-
-private:
-    DocumentMarker::MarkerType m_type;
-    int m_location;
-    int m_length;
-};
-
 class SpellChecker {
     WTF_MAKE_NONCOPYABLE(SpellChecker);
 public:
@@ -65,8 +47,8 @@ public:
     bool isBusy() const;
     bool isValid(int sequence) const;
     bool isCheckable(Node*) const;
-    void requestCheckingFor(Node*);
-    void didCheck(int sequence, const Vector<SpellCheckingResult>&);
+    void requestCheckingFor(TextCheckingTypeMask, Node*);
+    void didCheck(int sequence, const Vector<TextCheckingResult>&);
 
 private:
     bool initRequest(Node*);
index 009c807..3912a49 100644 (file)
@@ -274,7 +274,7 @@ String TextCheckingHelper::findFirstMisspellingOrBadGrammar(bool checkGrammar, b
                 unsigned grammarDetailIndex = 0;
                 
                 Vector<TextCheckingResult> results;
-                uint64_t checkingTypes = checkGrammar ? (TextCheckingTypeSpelling | TextCheckingTypeGrammar) : TextCheckingTypeSpelling;
+                TextCheckingTypeMask checkingTypes = checkGrammar ? (TextCheckingTypeSpelling | TextCheckingTypeGrammar) : TextCheckingTypeSpelling;
                 m_client->textChecker()->checkTextOfParagraph(paragraphString.characters(), paragraphString.length(), checkingTypes, results);
                 
                 for (unsigned i = 0; i < results.size(); i++) {
@@ -524,7 +524,7 @@ Vector<String> TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange(bool
         return guesses;
 
     Vector<TextCheckingResult> results;
-    uint64_t checkingTypes = checkGrammar ? (TextCheckingTypeSpelling | TextCheckingTypeGrammar) : TextCheckingTypeSpelling;
+    TextCheckingTypeMask checkingTypes = checkGrammar ? (TextCheckingTypeSpelling | TextCheckingTypeGrammar) : TextCheckingTypeSpelling;
     m_client->textChecker()->checkTextOfParagraph(paragraph.textCharacters(), paragraph.textLength(), checkingTypes, results);
     
     for (unsigned i = 0; i < results.size(); i++) {
index 6acf992..e1a9ffe 100644 (file)
@@ -407,11 +407,11 @@ public:
     virtual void checkGrammarOfString(const UChar*, int, Vector<GrammarDetail>&, int*, int*) { }
 
 #if USE(UNIFIED_TEXT_CHECKING)
-    virtual void checkTextOfParagraph(const UChar*, int, uint64_t, Vector<TextCheckingResult>&) { };
+    virtual void checkTextOfParagraph(const UChar*, int, TextCheckingTypeMask, Vector<TextCheckingResult>&) { };
 #endif
 
     virtual void getGuessesForWord(const String&, const String&, Vector<String>&) { }
-    virtual void requestCheckingOfString(SpellChecker*, int, const String&) { }
+    virtual void requestCheckingOfString(SpellChecker*, int, TextCheckingTypeMask, const String&) { }
 };
 
 class EmptyEditorClient : public EditorClient {
index 8abbed4..d16ade1 100644 (file)
@@ -45,16 +45,6 @@ struct GrammarDetail {
     String userDescription;
 };
 
-enum TextCheckingType {
-    TextCheckingTypeSpelling    = 1 << 1,
-    TextCheckingTypeGrammar     = 1 << 2,
-    TextCheckingTypeLink        = 1 << 5,
-    TextCheckingTypeQuote       = 1 << 6,
-    TextCheckingTypeDash        = 1 << 7,
-    TextCheckingTypeReplacement = 1 << 8,
-    TextCheckingTypeCorrection  = 1 << 9
-};
-
 struct TextCheckingResult {
     TextCheckingType type;
     int location;
@@ -72,15 +62,16 @@ public:
     virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength) = 0;
     virtual String getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord) = 0;
     virtual void checkGrammarOfString(const UChar*, int length, Vector<GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength) = 0;
+
 #if USE(UNIFIED_TEXT_CHECKING)
-    virtual void checkTextOfParagraph(const UChar* text, int length, uint64_t checkingTypes, Vector<TextCheckingResult>& results) = 0;
+    virtual void checkTextOfParagraph(const UChar* text, int length, TextCheckingTypeMask checkingTypes, Vector<TextCheckingResult>& results) = 0;
 #endif
 
     // For spellcheckers that support multiple languages, it's often important to be able to identify the language in order to
     // provide more accurate correction suggestions. Caller can pass in more text in "context" to aid such spellcheckers on language
     // identification. Noramlly it's the text surrounding the "word" for which we are getting correction suggestions.
     virtual void getGuessesForWord(const String& word, const String& context, Vector<String>& guesses) = 0;
-    virtual void requestCheckingOfString(SpellChecker*, int, const String&) = 0;
+    virtual void requestCheckingOfString(SpellChecker*, int, TextCheckingTypeMask, const String&) = 0;
 };
 
 }
index 022fb82..d2040d5 100644 (file)
@@ -42,6 +42,18 @@ namespace WebCore {
 #define WTF_USE_AUTOMATIC_TEXT_REPLACEMENT 1
 #endif
 
+enum TextCheckingType {
+    TextCheckingTypeSpelling    = 1 << 1,
+    TextCheckingTypeGrammar     = 1 << 2,
+    TextCheckingTypeLink        = 1 << 5,
+    TextCheckingTypeQuote       = 1 << 6,
+    TextCheckingTypeDash        = 1 << 7,
+    TextCheckingTypeReplacement = 1 << 8,
+    TextCheckingTypeCorrection  = 1 << 9
+};
+
+typedef unsigned TextCheckingTypeMask;
+
 }
 
 #endif // TextChecking_h
index 15e8c4c..2c2d847 100644 (file)
@@ -1,3 +1,16 @@
+2011-04-04  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Ryosuke Niwa.
+
+        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
+        https://bugs.webkit.org/show_bug.cgi?id=56085
+
+        Followed the signature change.
+        
+        * src/EditorClientImpl.h:
+        * src/EditorClientImpl.cpp:
+        * src/WebTextCheckingCompletionImpl.cpp
+
 2011-04-05  Hans Wennborg  <hans@chromium.org>
 
         Reviewed by Adam Barth
index 6f2231d..3c36c57 100644 (file)
@@ -872,7 +872,7 @@ void EditorClientImpl::checkSpellingOfString(const UChar* text, int length,
         *misspellingLength = spellLength;
 }
 
-void EditorClientImpl::requestCheckingOfString(SpellChecker* sender, int identifier, const String& text)
+void EditorClientImpl::requestCheckingOfString(SpellChecker* sender, int identifier, TextCheckingTypeMask, const String& text)
 {
     if (m_webView->spellCheckClient())
         m_webView->spellCheckClient()->requestCheckingOfText(text, new WebTextCheckingCompletionImpl(identifier, sender));
index b81fb56..2ebc6ea 100644 (file)
@@ -114,7 +114,7 @@ public:
                                    WTF::Vector<WTF::String>& guesses);
     virtual void willSetInputMethodState();
     virtual void setInputMethodState(bool enabled);
-    virtual void requestCheckingOfString(WebCore::SpellChecker*, int, const WTF::String&);
+    virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&);
 
     virtual WebCore::TextCheckerClient* textChecker() { return this; }
 
index b9e5227..f5a6604 100644 (file)
 #include "SpellChecker.h"
 #include "WebTextCheckingResult.h"
 #include "WebVector.h"
+#include <wtf/Assertions.h>
 
 using namespace WebCore;
 
 namespace WebKit {
 
-static Vector<SpellCheckingResult> toCoreResults(const WebVector<WebTextCheckingResult>& results)
+static TextCheckingType toCoreCheckingType(WebTextCheckingResult::Error error)
 {
-    Vector<SpellCheckingResult> coreResults;
-    for (size_t i = 0; i < results.size(); ++i)
-        coreResults.append(SpellCheckingResult(static_cast<DocumentMarker::MarkerType>(results[i].error), results[i].position, results[i].length));
+    if (error == WebTextCheckingResult::ErrorSpelling)
+        return TextCheckingTypeSpelling;
+    ASSERT(error == WebTextCheckingResult::ErrorGrammar);
+    return TextCheckingTypeGrammar;
+}
+
+static Vector<TextCheckingResult> toCoreResults(const WebVector<WebTextCheckingResult>& results)
+{
+    Vector<TextCheckingResult> coreResults;
+    for (size_t i = 0; i < results.size(); ++i) { 
+        TextCheckingResult coreResult;
+        coreResult.type = toCoreCheckingType(results[i].error);
+        coreResult.location = results[i].position;
+        coreResult.length = results[i].length;
+        coreResults.append(coreResult);
+    }
+
     return coreResults;
 }
 
index 4e81fd5..6ad2217 100644 (file)
@@ -1,3 +1,13 @@
+2011-04-04  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Ryosuke Niwa.
+
+        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
+        https://bugs.webkit.org/show_bug.cgi?id=56085
+        
+        * WebCoreSupport/EditorClientEfl.h:
+        (WebCore::EditorClientEfl::requestCheckingOfString):
+
 2011-04-01  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
 
         Reviewed by Kenneth Rohde Christiansen.
index 575a50d..56b3300 100644 (file)
@@ -114,7 +114,7 @@ public:
     virtual void getGuessesForWord(const String& word, const String& context, WTF::Vector<String>& guesses);
     virtual void willSetInputMethodState();
     virtual void setInputMethodState(bool enabled);
-    virtual void requestCheckingOfString(WebCore::SpellChecker*, int, const WTF::String&) {}
+    virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&) {}
     virtual TextCheckerClient* textChecker() { return this; }
 
 private:
index c3dc076..753fffe 100644 (file)
@@ -1,3 +1,13 @@
+2011-04-04  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Ryosuke Niwa.
+
+        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
+        https://bugs.webkit.org/show_bug.cgi?id=56085
+
+        * WebCoreSupport/TextCheckerClientEnchant.h:
+        (WebKit::TextCheckerClientEnchant::requestCheckingOfString):
+
 2011-04-04  Martin Robinson  <mrobinson@igalia.com>
 
         Reviewed by Gustavo Noronha Silva.
index c294a3d..5d93c07 100644 (file)
@@ -49,7 +49,7 @@ class TextCheckerClientEnchant : public WebCore::TextCheckerClient {
         virtual WTF::String getAutoCorrectSuggestionForMisspelledWord(const WTF::String&);
         virtual void checkGrammarOfString(const UChar*, int length, WTF::Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength);
         virtual void getGuessesForWord(const WTF::String& word, const WTF::String& context, WTF::Vector<WTF::String>& guesses);
-        virtual void requestCheckingOfString(WebCore::SpellChecker*, int, const WTF::String&) {}
+        virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&) {}
 
         void updateSpellCheckingLanguage(const char*);
         static void freeSpellCheckingLanguage(gpointer, gpointer);
index 10e537c..6ae3da1 100644 (file)
@@ -1,3 +1,13 @@
+2011-04-04  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Ryosuke Niwa.
+
+        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
+        https://bugs.webkit.org/show_bug.cgi?id=56085
+
+        * WebCoreSupport/EditorClientHaiku.h:
+        (WebCore::EditorClientHaiku::requestCheckingOfString):
+
 2011-04-04  Chang Shu  <cshu@webkit.org>
 
         Reviewed by Ryosuke Niwa.
index bb0d8ac..cc21fcb 100644 (file)
@@ -111,7 +111,7 @@ class EditorClientHaiku : public EditorClient, public TextCheckerClient {
         virtual void getGuessesForWord(const String& word, const String& context, Vector<String>& guesses);
         virtual void willSetInputMethodState();
         virtual void setInputMethodState(bool enabled);
-        virtual void requestCheckingOfString(SpellChecker*, int, const String&) {}
+        virtual void requestCheckingOfString(SpellChecker*, int, WebCore::TextCheckingTypeMask, const String&) {}
         virtual TextCheckerClient* textChecker() { return this; }
 
         bool isEditing() const;
index f077642..2f29bb0 100644 (file)
@@ -1,3 +1,25 @@
+2011-04-04  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Ryosuke Niwa.
+
+        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
+        https://bugs.webkit.org/show_bug.cgi?id=56085
+
+        Removed NSTextCheckingResult to SpellCheckingResult convertion, and extracted
+        NSTextCheckingResult to TextCheckingResult convertio from checkTextOfParagraph method.
+        for requestCheckingOfString method.
+        
+        * WebCoreSupport/WebEditorClient.h:
+        * WebCoreSupport/WebEditorClient.mm:
+        (toCoreTextCheckingResults):
+        (WebEditorClient::checkTextOfParagraph):
+        (-[WebEditorSpellCheckResponder initWithSender:WebCore::sequence:types:WebCore::results:]):
+        (-[WebEditorSpellCheckResponder perform]):
+        (WebEditorClient::requestCheckingOfString):
+        * WebView/WebFrame.mm:
+        (-[WebFrame markersForSelectionStartAsText]):
+        * WebView/WebFramePrivate.h:
+
 2011-04-05  Anders Carlsson  <andersca@apple.com>
 
         Didn't mean to land this.
index 412cb45..0e52102 100644 (file)
@@ -130,7 +130,7 @@ public:
     virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength);
     virtual WTF::String getAutoCorrectSuggestionForMisspelledWord(const WTF::String&);
     virtual void checkGrammarOfString(const UChar*, int length, WTF::Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength);
-    virtual void checkTextOfParagraph(const UChar* text, int length, uint64_t checkingTypes, WTF::Vector<WebCore::TextCheckingResult>& results);
+    virtual void checkTextOfParagraph(const UChar* text, int length, WebCore::TextCheckingTypeMask checkingTypes, WTF::Vector<WebCore::TextCheckingResult>& results);
     virtual void updateSpellingUIWithGrammarString(const WTF::String&, const WebCore::GrammarDetail&);
     virtual void updateSpellingUIWithMisspelledWord(const WTF::String&);
     virtual void showSpellingUI(bool show);
@@ -138,7 +138,7 @@ public:
     virtual void getGuessesForWord(const WTF::String& word, const WTF::String& context, WTF::Vector<WTF::String>& guesses);
     virtual void willSetInputMethodState();
     virtual void setInputMethodState(bool enabled);
-    virtual void requestCheckingOfString(WebCore::SpellChecker*, int, const WTF::String&);
+    virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&);
 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     virtual void showCorrectionPanel(WebCore::CorrectionPanelInfo::PanelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings);
     virtual void dismissCorrectionPanel(WebCore::ReasonForDismissingCorrectionPanel);
index c205ef6..341a28f 100644 (file)
@@ -790,12 +790,11 @@ void WebEditorClient::checkGrammarOfString(const UChar* text, int length, Vector
 #endif
 }
 
-void WebEditorClient::checkTextOfParagraph(const UChar* text, int length, uint64_t checkingTypes, Vector<TextCheckingResult>& results)
-{
 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
-    NSString *textString = [[NSString alloc] initWithCharactersNoCopy:const_cast<UChar*>(text) length:length freeWhenDone:NO];
-    NSArray *incomingResults = [[NSSpellChecker sharedSpellChecker] checkString:textString range:NSMakeRange(0, [textString length]) types:(checkingTypes|NSTextCheckingTypeOrthography) options:nil inSpellDocumentWithTag:spellCheckerDocumentTag() orthography:NULL wordCount:NULL];
-    [textString release];
+static Vector<TextCheckingResult> core(NSArray *incomingResults, TextCheckingTypeMask checkingTypes)
+{
+    Vector<TextCheckingResult> results;
+
     for (NSTextCheckingResult *incomingResult in incomingResults) {
         NSRange resultRange = [incomingResult range];
         NSTextCheckingType resultType = [incomingResult resultType];
@@ -867,6 +866,18 @@ void WebEditorClient::checkTextOfParagraph(const UChar* text, int length, uint64
             results.append(result);
         }
     }
+
+    return results;
+}
+#endif
+
+void WebEditorClient::checkTextOfParagraph(const UChar* text, int length, TextCheckingTypeMask checkingTypes, Vector<TextCheckingResult>& results)
+{
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+    NSString *textString = [[NSString alloc] initWithCharactersNoCopy:const_cast<UChar*>(text) length:length freeWhenDone:NO];
+    NSArray *incomingResults = [[NSSpellChecker sharedSpellChecker] checkString:textString range:NSMakeRange(0, [textString length]) types:(checkingTypes|NSTextCheckingTypeOrthography) options:nil inSpellDocumentWithTag:spellCheckerDocumentTag() orthography:NULL wordCount:NULL];
+    [textString release];
+    results = core(incomingResults, checkingTypes);
 #endif
 }
 
@@ -965,58 +976,35 @@ void WebEditorClient::setInputMethodState(bool)
 {
     WebCore::SpellChecker* _sender;
     int _sequence;
+    TextCheckingTypeMask _types;
     RetainPtr<NSArray> _results;
 }
-- (id)initWithSender:(WebCore::SpellChecker*)sender sequence:(int)sequence results:(NSArray*)results;
+- (id)initWithSender:(WebCore::SpellChecker*)sender sequence:(int)sequence types:(WebCore::TextCheckingTypeMask)types results:(NSArray*)results;
 - (void)perform;
-- (WTF::Vector<WebCore::SpellCheckingResult>) _coreResults;
 @end
 
 @implementation WebEditorSpellCheckResponder
-- (id)initWithSender:(WebCore::SpellChecker*)sender sequence:(int)sequence results:(NSArray*)results
+- (id)initWithSender:(WebCore::SpellChecker*)sender sequence:(int)sequence types:(WebCore::TextCheckingTypeMask)types results:(NSArray*)results
 {
     self = [super init];
     if (!self)
         return nil;
     _sender = sender;
     _sequence = sequence;
+    _types = types;
     _results = results;
     return self;
 }
 
 - (void)perform
 {
-    _sender->didCheck(_sequence, [self _coreResults]);
-}
-
-static SpellCheckingResult toCoreSpellingResult(NSTextCheckingResult* result)
-{
-    NSTextCheckingType type = [result resultType];
-    NSRange range = [result range];
-    DocumentMarker::MarkerType coreType;
-    if (type & NSTextCheckingTypeSpelling)
-        coreType = DocumentMarker::Spelling;
-    else if (type & NSTextCheckingTypeGrammar)
-        coreType = DocumentMarker::Grammar;
-    else
-        coreType = DocumentMarker::AllMarkers;
-
-    return SpellCheckingResult(coreType, range.location, range.length);
-}
-
-- (WTF::Vector<WebCore::SpellCheckingResult>)_coreResults
-{
-    WTF::Vector<WebCore::SpellCheckingResult> coreResults;
-    coreResults.reserveCapacity([_results.get() count]);
-    for (NSTextCheckingResult* result in _results.get())
-        coreResults.append(toCoreSpellingResult(result));
-    return coreResults;
+    _sender->didCheck(_sequence, core(_results.get(), _types));
 }
 
 @end
 #endif
 
-void WebEditorClient::requestCheckingOfString(WebCore::SpellChecker* sender, int sequence, const String& text)
+void WebEditorClient::requestCheckingOfString(WebCore::SpellChecker* sender, int sequence, WebCore::TextCheckingTypeMask checkingTypes, const String& text)
 {
 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
     NSRange range = NSMakeRange(0, text.length());
@@ -1024,7 +1012,7 @@ void WebEditorClient::requestCheckingOfString(WebCore::SpellChecker* sender, int
     [[NSSpellChecker sharedSpellChecker] requestCheckingOfString:text range:range types:NSTextCheckingAllSystemTypes options:0 inSpellDocumentWithTag:0 
                                          completionHandler:^(NSInteger, NSArray* results, NSOrthography*, NSInteger) {
             [currentLoop performSelector:@selector(perform) 
-                                  target:[[[WebEditorSpellCheckResponder alloc] initWithSender:sender sequence:sequence results:results] autorelease]
+                                  target:[[[WebEditorSpellCheckResponder alloc] initWithSender:sender sequence:sequence types:checkingTypes results:results] autorelease]
                                 argument:nil order:0 modes:[NSArray arrayWithObject:NSDefaultRunLoopMode]];
         }];
 #endif
index 73aa0a3..fa8cabc 100644 (file)
@@ -1,3 +1,13 @@
+2011-04-04  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Ryosuke Niwa.
+
+        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
+        https://bugs.webkit.org/show_bug.cgi?id=56085
+        
+        * WebCoreSupport/EditorClientQt.h:
+        (WebCore::EditorClientQt::requestCheckingOfString):
+
 2011-04-04  Chang Shu  <cshu@webkit.org>
 
         Reviewed by Ryosuke Niwa.
index 0450603..0d8e8c6 100644 (file)
@@ -109,7 +109,7 @@ public:
     virtual void getGuessesForWord(const String& word, const String& context, Vector<String>& guesses);
     virtual void willSetInputMethodState();
     virtual void setInputMethodState(bool enabled);
-    virtual void requestCheckingOfString(SpellChecker*, int, const String&) {}
+    virtual void requestCheckingOfString(SpellChecker*, int, WebCore::TextCheckingTypeMask, const String&) {}
     virtual TextCheckerClient* textChecker() { return this; }
 
     bool isEditing() const;
index 501669a..d2b1b43 100644 (file)
@@ -1,3 +1,13 @@
+2011-04-04  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Ryosuke Niwa.
+
+        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
+        https://bugs.webkit.org/show_bug.cgi?id=56085
+
+        * WebCoreSupport/WebEditorClient.h:
+        (WebEditorClient::requestCheckingOfString):
+
 2011-04-04  Alexey Proskuryakov  <ap@apple.com>
 
         Reviewed by Dan Bernstein.
index 1d0a7d0..d456cc9 100644 (file)
@@ -110,7 +110,7 @@ public:
 
     virtual void willSetInputMethodState();
     virtual void setInputMethodState(bool);
-    virtual void requestCheckingOfString(WebCore::SpellChecker*, int, const WTF::String&) {}
+    virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&) {}
     virtual WebCore::TextCheckerClient* textChecker() { return this; }
 
 private:
index 2889b1a..a5b9acb 100644 (file)
@@ -1,3 +1,13 @@
+2011-04-04  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Ryosuke Niwa.
+
+        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
+        https://bugs.webkit.org/show_bug.cgi?id=56085
+
+        * WebCoreSupport/EditorClientWinCE.h:
+        (WebKit::EditorClientWinCE::requestCheckingOfString):
+
 2011-04-04  Alexey Proskuryakov  <ap@apple.com>
 
         Reviewed by Dan Bernstein.
index d93ecc5..a2b23b4 100644 (file)
@@ -101,7 +101,7 @@ public:
     virtual void getGuessesForWord(const WTF::String& word, const WTF::String& context, WTF::Vector<WTF::String>& guesses);
     virtual void willSetInputMethodState();
     virtual void setInputMethodState(bool);
-    virtual void requestCheckingOfString(WebCore::SpellChecker*, int, const WTF::String&) {}
+    virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&) {}
     virtual WebCore::TextCheckerClient* textChecker() { return this; }
 
 private:
index 56ba9a7..c898bb5 100644 (file)
@@ -1,3 +1,13 @@
+2011-04-04  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Ryosuke Niwa.
+
+        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
+        https://bugs.webkit.org/show_bug.cgi?id=56085
+
+        * WebKitSupport/EditorClientWx.h:
+        (WebCore::EditorClientWx::requestCheckingOfString):
+
 2011-04-04  Malcolm MacLeod  <mmacleod@webmail.co.za>
 
         Reviewed by Kevin Ollivier.
index d1d3597..65ee493 100644 (file)
@@ -114,7 +114,7 @@ public:
 
     virtual void willSetInputMethodState();
     virtual void setInputMethodState(bool enabled);
-    virtual void requestCheckingOfString(WebCore::SpellChecker*, int, const WTF::String&) {}
+    virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&) {}
     virtual TextCheckerClient* textChecker() { return this; }
 
 private:
index 12c7147..d998ed6 100644 (file)
@@ -1,3 +1,16 @@
+2011-04-04  MORITA Hajime  <morrita@google.com>
+
+        Reviewed by Ryosuke Niwa.
+
+        [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult
+        https://bugs.webkit.org/show_bug.cgi?id=56085
+        
+        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+        (WebKit::WebEditorClient::requestCheckingOfString):
+        * WebProcess/WebCoreSupport/WebEditorClient.h:
+        * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
+        (WebKit::WebEditorClient::checkTextOfParagraph):
+
 2011-04-05  Alejandro G. Castro  <alex@igalia.com>
 
         Another compilation fix after r82929 horrible patch merge.
index 6a4f0af..fff767f 100644 (file)
@@ -441,7 +441,7 @@ void WebEditorClient::setInputMethodState(bool)
     notImplemented();
 }
 
-void WebEditorClient::requestCheckingOfString(WebCore::SpellChecker*, int, const WTF::String&)
+void WebEditorClient::requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&)
 {
     notImplemented();
 }
index acb85a7..633090f 100644 (file)
@@ -136,7 +136,7 @@ private:
     virtual String getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord);
     virtual void checkGrammarOfString(const UChar*, int length, Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength);
 #if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
-    virtual void checkTextOfParagraph(const UChar* text, int length, uint64_t checkingTypes, Vector<WebCore::TextCheckingResult>& results);
+    virtual void checkTextOfParagraph(const UChar* text, int length, WebCore::TextCheckingTypeMask checkingTypes, Vector<WebCore::TextCheckingResult>& results);
 #endif
     virtual void updateSpellingUIWithGrammarString(const String&, const WebCore::GrammarDetail& detail);
     virtual void updateSpellingUIWithMisspelledWord(const String&);
@@ -145,7 +145,7 @@ private:
     virtual void getGuessesForWord(const String& word, const String& context, Vector<String>& guesses);
     virtual void willSetInputMethodState();
     virtual void setInputMethodState(bool enabled);
-    virtual void requestCheckingOfString(WebCore::SpellChecker*, int, const WTF::String&);
+    virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&);
 #if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD)
     virtual void showCorrectionPanel(WebCore::CorrectionPanelInfo::PanelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings);
     virtual void dismissCorrectionPanel(WebCore::ReasonForDismissingCorrectionPanel);
index 282b232..ea440fc 100644 (file)
@@ -240,7 +240,7 @@ void WebEditorClient::toggleAutomaticSpellingCorrection()
     notImplemented();
 }
 
-void WebEditorClient::checkTextOfParagraph(const UChar* text, int length, uint64_t checkingTypes, Vector<TextCheckingResult>& results)
+void WebEditorClient::checkTextOfParagraph(const UChar* text, int length, WebCore::TextCheckingTypeMask checkingTypes, Vector<TextCheckingResult>& results)
 {
     // FIXME: It would be nice if we wouldn't have to copy the text here.
     m_page->sendSync(Messages::WebPageProxy::CheckTextOfParagraph(String(text, length), checkingTypes), Messages::WebPageProxy::CheckTextOfParagraph::Reply(results));