SpellCheckRequest needs to know the context where the spellcheck happened.
authorshinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Feb 2012 12:32:27 +0000 (12:32 +0000)
committershinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Feb 2012 12:32:27 +0000 (12:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=79320

Reviewed by Hajime Morita.

Source/WebCore:

WebKit clients should be able to get the context how the spellcheck happended.
For example, WebKit clients may want to change the behavior by a spellcheck request is
invoked in typing or in pasting.

This patch added an enum in SpellCheckRequest so that WebKit clients can understand the context.

* editing/Editor.cpp:
(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
* editing/SpellChecker.cpp:
(WebCore::SpellCheckRequest::SpellCheckRequest):
(WebCore::SpellCheckRequest::create):
(WebCore::SpellChecker::invokeRequest):
* editing/SpellChecker.h:
(SpellCheckRequest):
(WebCore::SpellCheckRequest::textCheckingRequest):
(WebCore::SpellCheckRequest::processType):
* loader/EmptyClients.h:
(WebCore::EmptyTextCheckerClient::requestCheckingOfString):
* platform/text/TextCheckerClient.h:
(WebCore):
(TextCheckerClient):
* platform/text/TextChecking.h:
(TextCheckingRequest):
(WebCore::TextCheckingRequest::TextCheckingRequest):
(WebCore::TextCheckingRequest::setSequence):
(WebCore::TextCheckingRequest::sequence):
(WebCore::TextCheckingRequest::text):
(WebCore::TextCheckingRequest::mask):
(WebCore::TextCheckingRequest::processType):
(WebCore):

Source/WebKit/blackberry:

* WebCoreSupport/EditorClientBlackBerry.cpp:
(WebCore::EditorClientBlackBerry::requestCheckingOfString):
* WebCoreSupport/EditorClientBlackBerry.h:
(EditorClientBlackBerry):

Source/WebKit/chromium:

* src/EditorClientImpl.cpp:
(WebKit::EditorClientImpl::requestCheckingOfString):
* src/EditorClientImpl.h:
(EditorClientImpl):
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::requestTextChecking):

Source/WebKit/efl:

* WebCoreSupport/EditorClientEfl.h:
(WebCore::EditorClientEfl::requestCheckingOfString):

Source/WebKit/gtk:

* WebCoreSupport/TextCheckerClientGtk.h:
(WebKit::TextCheckerClientGtk::requestCheckingOfString):

Source/WebKit/mac:

* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::requestCheckingOfString):

Source/WebKit/qt:

* WebCoreSupport/TextCheckerClientQt.h:
(WebCore::TextCheckerClientQt::requestCheckingOfString):

Source/WebKit/win:

* WebCoreSupport/WebEditorClient.h:
(WebEditorClient::requestCheckingOfString):
(WebEditorClient):

Source/WebKit/wince:

* WebCoreSupport/EditorClientWinCE.h:
(WebKit::EditorClientWinCE::requestCheckingOfString):

Source/WebKit/wx:

* WebKitSupport/EditorClientWx.h:
(WebCore::EditorClientWx::requestCheckingOfString):

Source/WebKit2:

* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::requestCheckingOfString):
* WebProcess/WebCoreSupport/WebEditorClient.h:

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

32 files changed:
Source/WebCore/ChangeLog
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/SpellChecker.cpp
Source/WebCore/editing/SpellChecker.h
Source/WebCore/loader/EmptyClients.h
Source/WebCore/platform/text/TextCheckerClient.h
Source/WebCore/platform/text/TextChecking.h
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebCoreSupport/EditorClientBlackBerry.cpp
Source/WebKit/blackberry/WebCoreSupport/EditorClientBlackBerry.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/EditorClientImpl.cpp
Source/WebKit/chromium/src/EditorClientImpl.h
Source/WebKit/chromium/src/WebFrameImpl.cpp
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/EditorClientEfl.h
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/TextCheckerClientGtk.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/TextCheckerClientQt.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

index 0b3a36d..0cca173 100644 (file)
@@ -1,3 +1,42 @@
+2012-02-24  Shinya Kawanaka  <shinyak@chromium.org>
+
+        SpellCheckRequest needs to know the context where the spellcheck happened.
+        https://bugs.webkit.org/show_bug.cgi?id=79320
+
+        Reviewed by Hajime Morita.
+
+        WebKit clients should be able to get the context how the spellcheck happended.
+        For example, WebKit clients may want to change the behavior by a spellcheck request is
+        invoked in typing or in pasting.
+
+        This patch added an enum in SpellCheckRequest so that WebKit clients can understand the context.
+
+        * editing/Editor.cpp:
+        (WebCore::Editor::replaceSelectionWithFragment):
+        (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
+        * editing/SpellChecker.cpp:
+        (WebCore::SpellCheckRequest::SpellCheckRequest):
+        (WebCore::SpellCheckRequest::create):
+        (WebCore::SpellChecker::invokeRequest):
+        * editing/SpellChecker.h:
+        (SpellCheckRequest):
+        (WebCore::SpellCheckRequest::textCheckingRequest):
+        (WebCore::SpellCheckRequest::processType):
+        * loader/EmptyClients.h:
+        (WebCore::EmptyTextCheckerClient::requestCheckingOfString):
+        * platform/text/TextCheckerClient.h:
+        (WebCore):
+        (TextCheckerClient):
+        * platform/text/TextChecking.h:
+        (TextCheckingRequest):
+        (WebCore::TextCheckingRequest::TextCheckingRequest):
+        (WebCore::TextCheckingRequest::setSequence):
+        (WebCore::TextCheckingRequest::sequence):
+        (WebCore::TextCheckingRequest::text):
+        (WebCore::TextCheckingRequest::mask):
+        (WebCore::TextCheckingRequest::processType):
+        (WebCore):
+
 2012-02-24  Hayato Ito  <hayato@chromium.org>
 
         Make Node::showTreeForThis (and Node::showTreeForThisAcrossFrame) dump multiple shadow roots.
index 13bb7e7..1ce24e5 100644 (file)
@@ -418,7 +418,7 @@ void Editor::replaceSelectionWithFragment(PassRefPtr<DocumentFragment> fragment,
         return;
 
     RefPtr<Range> rangeToCheck = Range::create(m_frame->document(), firstPositionInNode(nodeToCheck), lastPositionInNode(nodeToCheck));
-    m_spellChecker->requestCheckingFor(SpellCheckRequest::create(resolveTextCheckingTypeMask(TextCheckingTypeSpelling | TextCheckingTypeGrammar), rangeToCheck, rangeToCheck));
+    m_spellChecker->requestCheckingFor(SpellCheckRequest::create(resolveTextCheckingTypeMask(TextCheckingTypeSpelling | TextCheckingTypeGrammar), TextCheckingProcessBatch, rangeToCheck, rangeToCheck));
 }
 
 void Editor::replaceSelectionWithText(const String& text, bool selectReplacement, bool smartReplace)
@@ -1935,7 +1935,7 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(TextCheckingTypeMask textC
     bool asynchronous = m_frame && m_frame->settings() && m_frame->settings()->asynchronousSpellCheckingEnabled() && !shouldShowCorrectionPanel;
 
     // In asynchronous mode, we intentionally check paragraph-wide sentence.
-    RefPtr<SpellCheckRequest> request = SpellCheckRequest::create(resolveTextCheckingTypeMask(textCheckingOptions), asynchronous ? paragraphRange : rangeToCheck, paragraphRange);
+    RefPtr<SpellCheckRequest> request = SpellCheckRequest::create(resolveTextCheckingTypeMask(textCheckingOptions), TextCheckingProcessIncremental, asynchronous ? paragraphRange : rangeToCheck, paragraphRange);
 
     if (asynchronous) {
         m_spellChecker->requestCheckingFor(request);
index 683644c..e1243b1 100644 (file)
@@ -47,12 +47,13 @@ namespace WebCore {
 
 static const int unrequestedSequence = -1;
 
-SpellCheckRequest::SpellCheckRequest(int sequence, PassRefPtr<Range> checkingRange, PassRefPtr<Range> paragraphRange, const String& text, TextCheckingTypeMask mask)
+SpellCheckRequest::SpellCheckRequest(int sequence, PassRefPtr<Range> checkingRange, PassRefPtr<Range> paragraphRange, const String& text, TextCheckingTypeMask mask, TextCheckingProcessType processType)
     : m_sequence(sequence)
-    , m_checkingRange(checkingRange)
-    , m_paragraphRange(paragraphRange)
     , m_text(text)
     , m_mask(mask)
+    , m_processType(processType)
+    , m_checkingRange(checkingRange)
+    , m_paragraphRange(paragraphRange)
     , m_rootEditableElement(m_checkingRange->startContainer()->rootEditableElement())
 {
 }
@@ -62,7 +63,7 @@ SpellCheckRequest::~SpellCheckRequest()
 }
 
 // static
-PassRefPtr<SpellCheckRequest> SpellCheckRequest::create(TextCheckingTypeMask textCheckingOptions, PassRefPtr<Range> checkingRange, PassRefPtr<Range> paragraphRange)
+PassRefPtr<SpellCheckRequest> SpellCheckRequest::create(TextCheckingTypeMask textCheckingOptions, TextCheckingProcessType processType, PassRefPtr<Range> checkingRange, PassRefPtr<Range> paragraphRange)
 {
     ASSERT(checkingRange);
     ASSERT(paragraphRange);
@@ -71,7 +72,7 @@ PassRefPtr<SpellCheckRequest> SpellCheckRequest::create(TextCheckingTypeMask tex
     if (!text.length())
         return PassRefPtr<SpellCheckRequest>();
 
-    return adoptRef(new SpellCheckRequest(unrequestedSequence, checkingRange, paragraphRange, text, textCheckingOptions));
+    return adoptRef(new SpellCheckRequest(unrequestedSequence, checkingRange, paragraphRange, text, textCheckingOptions, processType));
 }
 
 
@@ -145,7 +146,7 @@ void SpellChecker::invokeRequest(PassRefPtr<SpellCheckRequest> request)
     ASSERT(!m_processingRequest);
 
     m_processingRequest = request;
-    client()->requestCheckingOfString(this, m_processingRequest->sequence(), m_processingRequest->mask(), m_processingRequest->text());
+    client()->requestCheckingOfString(this, m_processingRequest->textCheckingRequest());
 }
 
 void SpellChecker::enqueueRequest(PassRefPtr<SpellCheckRequest> request)
index 20306da..07f51e4 100644 (file)
@@ -46,10 +46,12 @@ struct TextCheckingResult;
 
 class SpellCheckRequest : public RefCounted<SpellCheckRequest> {
 public:
-    SpellCheckRequest(int sequence, PassRefPtr<Range> checkingRange, PassRefPtr<Range> paragraphRange, const String&, TextCheckingTypeMask);
+    SpellCheckRequest(int sequence, PassRefPtr<Range> checkingRange, PassRefPtr<Range> paragraphRange, const String&, TextCheckingTypeMask, TextCheckingProcessType);
     ~SpellCheckRequest();
 
-    static PassRefPtr<SpellCheckRequest> create(TextCheckingTypeMask, PassRefPtr<Range> checkingRange, PassRefPtr<Range> paragraphRange);
+    static PassRefPtr<SpellCheckRequest> create(TextCheckingTypeMask, TextCheckingProcessType, PassRefPtr<Range> checkingRange, PassRefPtr<Range> paragraphRange);
+
+    TextCheckingRequest textCheckingRequest() const;
 
     void setSequence(int sequence) { m_sequence = sequence; }
     int sequence() const { return m_sequence; }
@@ -57,14 +59,15 @@ public:
     PassRefPtr<Range> paragraphRange() const { return m_paragraphRange; }
     const String& text() const { return m_text; }
     TextCheckingTypeMask mask() const { return m_mask; }
+    TextCheckingProcessType processType() const { return m_processType; }
     PassRefPtr<Element> rootEditableElement() const { return m_rootEditableElement; }
 private:
-
     int m_sequence;
-    RefPtr<Range> m_checkingRange;
-    RefPtr<Range> m_paragraphRange;
     String m_text;
     TextCheckingTypeMask m_mask;
+    TextCheckingProcessType m_processType;
+    RefPtr<Range> m_checkingRange;
+    RefPtr<Range> m_paragraphRange;
     RefPtr<Element> m_rootEditableElement;
 };
 
@@ -109,6 +112,11 @@ private:
     RequestQueue m_requestQueue;
 };
 
+inline TextCheckingRequest SpellCheckRequest::textCheckingRequest() const
+{
+    return TextCheckingRequest(m_sequence, m_text, m_mask, m_processType);
+}
+
 } // namespace WebCore
 
 #endif // SpellChecker_h
index 2352c28..8c4f00a 100644 (file)
@@ -432,7 +432,7 @@ public:
 #endif
 
     virtual void getGuessesForWord(const String&, const String&, Vector<String>&) { }
-    virtual void requestCheckingOfString(SpellChecker*, int, TextCheckingTypeMask, const String&) { }
+    virtual void requestCheckingOfString(SpellChecker*, const TextCheckingRequest&) { }
 };
 
 class EmptyEditorClient : public EditorClient {
index d16ade1..6b0fa80 100644 (file)
@@ -37,6 +37,7 @@
 namespace WebCore {
 
 class SpellChecker;
+class TextCheckingRequest;
 
 struct GrammarDetail {
     int location;
@@ -71,7 +72,7 @@ public:
     // 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, TextCheckingTypeMask, const String&) = 0;
+    virtual void requestCheckingOfString(SpellChecker*, const TextCheckingRequest&) = 0;
 };
 
 }
index 967eac5..be9ed5f 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef TextChecking_h
 #define TextChecking_h
 
+#include <wtf/text/WTFString.h>
+
 namespace WebCore {
 
 #define WTF_USE_GRAMMAR_CHECKING 1
@@ -61,6 +63,34 @@ enum TextCheckingType {
 
 typedef unsigned TextCheckingTypeMask;
 
+enum TextCheckingProcessType {
+    TextCheckingProcessBatch,
+    TextCheckingProcessIncremental
+};
+
+class TextCheckingRequest {
+public:
+    TextCheckingRequest(int sequence, String text, TextCheckingTypeMask mask, TextCheckingProcessType processType)
+        : m_sequence(sequence)
+        , m_text(text)
+        , m_mask(mask)
+        , m_processType(processType)
+    {
+    }
+
+    void setSequence(int sequence) { m_sequence = sequence; }
+    int sequence() const { return m_sequence; }
+    String text() const { return m_text; }
+    TextCheckingTypeMask mask() const { return m_mask; }
+    TextCheckingProcessType processType() const { return m_processType; }
+
+private:
+    int m_sequence;
+    String m_text;
+    TextCheckingTypeMask m_mask;
+    TextCheckingProcessType m_processType;
+};
+
 }
 
 #endif // TextChecking_h
index b910ff6..60d341a 100644 (file)
@@ -1,3 +1,15 @@
+2012-02-24  Shinya Kawanaka  <shinyak@chromium.org>
+
+        SpellCheckRequest needs to know the context where the spellcheck happened.
+        https://bugs.webkit.org/show_bug.cgi?id=79320
+
+        Reviewed by Hajime Morita.
+
+        * WebCoreSupport/EditorClientBlackBerry.cpp:
+        (WebCore::EditorClientBlackBerry::requestCheckingOfString):
+        * WebCoreSupport/EditorClientBlackBerry.h:
+        (EditorClientBlackBerry):
+
 2012-02-24  Charles Wei  <charles.wei@torchmobile.com.cn>
 
         [BlackBerry] Anchor mailto: with target set won't launch Messaging application when clicked
index d3c37ee..0e4441d 100644 (file)
@@ -558,7 +558,7 @@ void EditorClientBlackBerry::checkGrammarOfString(const UChar*, int, WTF::Vector
     notImplemented();
 }
 
-void EditorClientBlackBerry::requestCheckingOfString(SpellChecker*, int, TextCheckingTypeMask, const String&)
+void EditorClientBlackBerry::requestCheckingOfString(SpellChecker*, const TextCheckingRequest&)
 {
     notImplemented();
 }
index bffa881..54a3100 100644 (file)
@@ -84,7 +84,7 @@ public:
     virtual String getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord);
     virtual void checkGrammarOfString(const UChar*, int, Vector<GrammarDetail, 0u>&, int*, int*);
     virtual void getGuessesForWord(const String&, const String&, Vector<String>&);
-    virtual void requestCheckingOfString(SpellChecker*, int, TextCheckingTypeMask, const String&);
+    virtual void requestCheckingOfString(SpellChecker*, const TextCheckingRequest&);
 
     virtual TextCheckerClient* textChecker();
     virtual void updateSpellingUIWithGrammarString(const String&, const GrammarDetail&);
index 651658c..797b31c 100644 (file)
@@ -1,3 +1,17 @@
+2012-02-24  Shinya Kawanaka  <shinyak@chromium.org>
+
+        SpellCheckRequest needs to know the context where the spellcheck happened.
+        https://bugs.webkit.org/show_bug.cgi?id=79320
+
+        Reviewed by Hajime Morita.
+
+        * src/EditorClientImpl.cpp:
+        (WebKit::EditorClientImpl::requestCheckingOfString):
+        * src/EditorClientImpl.h:
+        (EditorClientImpl):
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::requestTextChecking):
+
 2012-02-23  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed.  Rolled DEPS.
index 033d46d..934281a 100644 (file)
@@ -729,10 +729,10 @@ void EditorClientImpl::checkSpellingOfString(const UChar* text, int length,
         *misspellingLength = spellLength;
 }
 
-void EditorClientImpl::requestCheckingOfString(SpellChecker* sender, int identifier, TextCheckingTypeMask, const String& text)
+void EditorClientImpl::requestCheckingOfString(SpellChecker* sender, const WebCore::TextCheckingRequest& request)
 {
     if (m_webView->spellCheckClient())
-        m_webView->spellCheckClient()->requestCheckingOfText(text, new WebTextCheckingCompletionImpl(identifier, sender));
+        m_webView->spellCheckClient()->requestCheckingOfText(request.text(), new WebTextCheckingCompletionImpl(request.sequence(), sender));
 }
 
 String EditorClientImpl::getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord)
index 999860a..b167b6c 100644 (file)
@@ -109,7 +109,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, WebCore::TextCheckingTypeMask, const WTF::String&);
+    virtual void requestCheckingOfString(WebCore::SpellChecker*, const WebCore::TextCheckingRequest&);
 
     virtual WebCore::TextCheckerClient* textChecker() { return this; }
 
index 21704d9..adf2023 100644 (file)
@@ -1301,7 +1301,7 @@ void WebFrameImpl::requestTextChecking(const WebElement& webElem)
 
     RefPtr<Range> rangeToCheck = rangeOfContents(const_cast<Element*>(webElem.constUnwrap<Element>()));
 
-    frame()->editor()->spellChecker()->requestCheckingFor(SpellCheckRequest::create(TextCheckingTypeSpelling | TextCheckingTypeGrammar, rangeToCheck, rangeToCheck));
+    frame()->editor()->spellChecker()->requestCheckingFor(SpellCheckRequest::create(TextCheckingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToCheck, rangeToCheck));
 }
 
 bool WebFrameImpl::hasSelection() const
index 92c01fe..db22d44 100644 (file)
@@ -1,3 +1,13 @@
+2012-02-24  Shinya Kawanaka  <shinyak@chromium.org>
+
+        SpellCheckRequest needs to know the context where the spellcheck happened.
+        https://bugs.webkit.org/show_bug.cgi?id=79320
+
+        Reviewed by Hajime Morita.
+
+        * WebCoreSupport/EditorClientEfl.h:
+        (WebCore::EditorClientEfl::requestCheckingOfString):
+
 2012-02-21  Ryosuke Niwa  <rniwa@webkit.org>
 
         Remove the remaining uses of CSSStyleDeclaration in Editor
index 42189e1..2b52e9d 100644 (file)
@@ -120,7 +120,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, WebCore::TextCheckingTypeMask, const WTF::String&) { }
+    virtual void requestCheckingOfString(WebCore::SpellChecker*, const WebCore::TextCheckingRequest&) { }
     virtual TextCheckerClient* textChecker() { return this; }
 
 private:
index 0677aa2..59bb90a 100644 (file)
@@ -1,3 +1,13 @@
+2012-02-24  Shinya Kawanaka  <shinyak@chromium.org>
+
+        SpellCheckRequest needs to know the context where the spellcheck happened.
+        https://bugs.webkit.org/show_bug.cgi?id=79320
+
+        Reviewed by Hajime Morita.
+
+        * WebCoreSupport/TextCheckerClientGtk.h:
+        (WebKit::TextCheckerClientGtk::requestCheckingOfString):
+
 2012-02-23  ChangSeok Oh  <shivamidow@gmail.com>
 
         [GTK] DRT doesn't support scheduleAsynchronousKeyDown.
index e5390bc..b3fa049 100644 (file)
@@ -48,7 +48,7 @@ class TextCheckerClientGtk : 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, WebCore::TextCheckingTypeMask, const WTF::String&) {}
+        virtual void requestCheckingOfString(WebCore::SpellChecker*, const WebCore::TextCheckingRequest&) { }
 
         void updateSpellCheckingLanguage(const char*);
     private:
index 548c8f1..898482e 100644 (file)
@@ -1,3 +1,14 @@
+2012-02-24  Shinya Kawanaka  <shinyak@chromium.org>
+
+        SpellCheckRequest needs to know the context where the spellcheck happened.
+        https://bugs.webkit.org/show_bug.cgi?id=79320
+
+        Reviewed by Hajime Morita.
+
+        * WebCoreSupport/WebEditorClient.h:
+        * WebCoreSupport/WebEditorClient.mm:
+        (WebEditorClient::requestCheckingOfString):
+
 2012-02-23  Andy Estes  <aestes@apple.com>
 
         Rename [setS|s]uppressIncrementalRendering to [setS|s]uppressesIncrementalRendering and make it WebPreferences API.
index 5a9b917..c75fee0 100644 (file)
@@ -135,7 +135,7 @@ public:
     virtual void getGuessesForWord(const WTF::String& word, const WTF::String& context, WTF::Vector<WTF::String>& guesses) OVERRIDE;
     virtual void willSetInputMethodState() OVERRIDE;
     virtual void setInputMethodState(bool enabled) OVERRIDE;
-    virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&) OVERRIDE;
+    virtual void requestCheckingOfString(WebCore::SpellChecker*, const WebCore::TextCheckingRequest&) OVERRIDE;
 #if !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) OVERRIDE;
     virtual void dismissCorrectionPanel(WebCore::ReasonForDismissingCorrectionPanel) OVERRIDE;
index f1c5510..4785530 100644 (file)
@@ -972,15 +972,15 @@ void WebEditorClient::setInputMethodState(bool)
 @end
 #endif
 
-void WebEditorClient::requestCheckingOfString(WebCore::SpellChecker* sender, int sequence, WebCore::TextCheckingTypeMask checkingTypes, const String& text)
+void WebEditorClient::requestCheckingOfString(WebCore::SpellChecker* sender, const WebCore::TextCheckingRequest& request)
 {
 #ifndef BUILDING_ON_LEOPARD
-    NSRange range = NSMakeRange(0, text.length());
+    NSRange range = NSMakeRange(0, request.text().length());
     NSRunLoop* currentLoop = [NSRunLoop currentRunLoop];
-    [[NSSpellChecker sharedSpellChecker] requestCheckingOfString:text range:range types:NSTextCheckingAllSystemTypes options:0 inSpellDocumentWithTag:0 
+    [[NSSpellChecker sharedSpellChecker] requestCheckingOfString:request.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 types:checkingTypes results:results] autorelease]
+                                  target:[[[WebEditorSpellCheckResponder alloc] initWithSender:sender sequence:request.sequence() types:request.mask() results:results] autorelease]
                                 argument:nil order:0 modes:[NSArray arrayWithObject:NSDefaultRunLoopMode]];
         }];
 #endif
index ffe9c64..f20f183 100644 (file)
@@ -1,3 +1,13 @@
+2012-02-24  Shinya Kawanaka  <shinyak@chromium.org>
+
+        SpellCheckRequest needs to know the context where the spellcheck happened.
+        https://bugs.webkit.org/show_bug.cgi?id=79320
+
+        Reviewed by Hajime Morita.
+
+        * WebCoreSupport/TextCheckerClientQt.h:
+        (WebCore::TextCheckerClientQt::requestCheckingOfString):
+
 2012-02-23  Simon Hausmann  <simon.hausmann@nokia.com>
 
         [Qt] Add support for touch cancellation
index e78ce1d..ae419b2 100644 (file)
@@ -47,7 +47,7 @@ public:
     virtual String getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord);
     virtual void checkGrammarOfString(const UChar*, int length, Vector<GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength);
     virtual void getGuessesForWord(const String& word, const String& context, Vector<String>& guesses);
-    virtual void requestCheckingOfString(SpellChecker*, int, TextCheckingTypeMask, const String&) { }
+    virtual void requestCheckingOfString(SpellChecker*, const TextCheckingRequest&) { }
 
     virtual bool isContinousSpellCheckingEnabled();
     virtual void toggleContinousSpellChecking();
index 862a9c3..1c7f320 100644 (file)
@@ -1,3 +1,14 @@
+2012-02-24  Shinya Kawanaka  <shinyak@chromium.org>
+
+        SpellCheckRequest needs to know the context where the spellcheck happened.
+        https://bugs.webkit.org/show_bug.cgi?id=79320
+
+        Reviewed by Hajime Morita.
+
+        * WebCoreSupport/WebEditorClient.h:
+        (WebEditorClient::requestCheckingOfString):
+        (WebEditorClient):
+
 2012-02-21  Ryosuke Niwa  <rniwa@webkit.org>
 
         Remove the remaining uses of CSSStyleDeclaration in Editor
index 28a9105..0f29e9e 100644 (file)
@@ -110,7 +110,8 @@ public:
 
     virtual void willSetInputMethodState();
     virtual void setInputMethodState(bool);
-    virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&) {}
+    virtual void requestCheckingOfString(WebCore::SpellChecker*, const WebCore::TextCheckingRequest&) { }
+
     virtual WebCore::TextCheckerClient* textChecker() { return this; }
 
 private:
index dcda069..998f5d1 100644 (file)
@@ -1,3 +1,13 @@
+2012-02-24  Shinya Kawanaka  <shinyak@chromium.org>
+
+        SpellCheckRequest needs to know the context where the spellcheck happened.
+        https://bugs.webkit.org/show_bug.cgi?id=79320
+
+        Reviewed by Hajime Morita.
+
+        * WebCoreSupport/EditorClientWinCE.h:
+        (WebKit::EditorClientWinCE::requestCheckingOfString):
+
 2012-02-23  Patrick Gansterer  <paroga@webkit.org>
 
         Unreviewed WinCE build fix after r108462.
index 72fad3d..fc9ce02 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, WebCore::TextCheckingTypeMask, const WTF::String&) {}
+    virtual void requestCheckingOfString(WebCore::SpellChecker*, const WebCore::TextCheckingRequest&) { }
     virtual WebCore::TextCheckerClient* textChecker() { return this; }
 
 private:
index 1160eed..0c6021e 100644 (file)
@@ -1,3 +1,13 @@
+2012-02-24  Shinya Kawanaka  <shinyak@chromium.org>
+
+        SpellCheckRequest needs to know the context where the spellcheck happened.
+        https://bugs.webkit.org/show_bug.cgi?id=79320
+
+        Reviewed by Hajime Morita.
+
+        * WebKitSupport/EditorClientWx.h:
+        (WebCore::EditorClientWx::requestCheckingOfString):
+
 2012-02-21  Ryosuke Niwa  <rniwa@webkit.org>
 
         Remove the remaining uses of CSSStyleDeclaration in Editor
index d0bfd2a..ece15fa 100644 (file)
@@ -114,7 +114,7 @@ public:
 
     virtual void willSetInputMethodState();
     virtual void setInputMethodState(bool enabled);
-    virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&) {}
+    virtual void requestCheckingOfString(WebCore::SpellChecker*, const WebCore::TextCheckingRequest&) { }
     virtual TextCheckerClient* textChecker() { return this; }
 
 private:
index 95851d9..3abc4a2 100644 (file)
@@ -1,3 +1,14 @@
+2012-02-24  Shinya Kawanaka  <shinyak@chromium.org>
+
+        SpellCheckRequest needs to know the context where the spellcheck happened.
+        https://bugs.webkit.org/show_bug.cgi?id=79320
+
+        Reviewed by Hajime Morita.
+
+        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+        (WebKit::WebEditorClient::requestCheckingOfString):
+        * WebProcess/WebCoreSupport/WebEditorClient.h:
+
 2012-02-23  Kenneth Rohde Christiansen  <kenneth@webkit.org>
 
         [Qt] Tiling: Improve the method names dealing with moving and scaling.
index 19ef7dc..c742167 100644 (file)
@@ -447,7 +447,7 @@ void WebEditorClient::setInputMethodState(bool)
     notImplemented();
 }
 
-void WebEditorClient::requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&)
+void WebEditorClient::requestCheckingOfString(WebCore::SpellChecker*, const WebCore::TextCheckingRequest&)
 {
     notImplemented();
 }
index 260020f..2fb3150 100644 (file)
@@ -141,7 +141,7 @@ private:
     virtual void getGuessesForWord(const String& word, const String& context, Vector<String>& guesses) OVERRIDE;
     virtual void willSetInputMethodState() OVERRIDE;
     virtual void setInputMethodState(bool enabled) OVERRIDE;
-    virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&) OVERRIDE;
+    virtual void requestCheckingOfString(WebCore::SpellChecker*, const WebCore::TextCheckingRequest&) OVERRIDE;
 #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) OVERRIDE;
     virtual void dismissCorrectionPanel(WebCore::ReasonForDismissingCorrectionPanel) OVERRIDE;