2010-10-28 MORITA Hajime <morrita@google.com>
authormorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Dec 2010 06:06:19 +0000 (06:06 +0000)
committermorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Dec 2010 06:06:19 +0000 (06:06 +0000)
commitfb7a66cc22ab5a3dce06225437c7b26c50bb1c30
tree63348bb980f368ba1909f7a8f14e2f8fb950f3be
parentcdff9f1c2f697ec81f8f61c914f77a2f3ba8aebf
2010-10-28  MORITA Hajime  <morrita@google.com>

        Reviewed by Ojan Vafai.

        spellcheck does not check pasted text
        https://bugs.webkit.org/show_bug.cgi?id=40092

        * editing/spelling/script-tests/spellcheck-paste.js: Added.
        * editing/spelling/spellcheck-paste.html: Added.
        * editing/spelling/spellcheck-paste-expected.txt: Added.
        * platform/chromium/test_expectations.txt:
        * platform/gtk/Skipped:
        * platform/mac-leopard/Skipped:
        * platform/mac-tiger/Skipped:
        * platform/mac-wk2/Skipped:
        * platform/qt/Skipped:
        * platform/win/Skipped:
2010-10-28  MORITA Hajime  <morrita@google.com>

        Reviewed by Ojan Vafai.

        spellcheck does not check pasted text
        https://bugs.webkit.org/show_bug.cgi?id=40092

        - Introduced SpellChecker class to encapsulate asynchronous spell
          checker state: sequence id, requesting text and target node.
          This is also the first step to decompose spell-check related
          code to a separate class.
        - Added EditorClient::isAsynchronousSpellCheckingEnabled()
          to use async spellcheck API on the platform.
          These APIs are touched by SpellChecker.
        - Used SpellChecker to check a pasted test. Text to check is
          collected from the subtree under the editingRoot.
        - Added Setting::m_asynchronousSpellCheckingEnabled to control
          async spell checking.

        Test: editing/spelling/spellcheck-paste.html

        * CMakeLists.txt:
        * GNUmakefile.am:
        * WebCore.exp.in:
        * WebCore.gypi:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/DocumentMarkerController.cpp:
        (WebCore::DocumentMarkerController::showMarkers):
        (showDocumentMarkers):
        * dom/DocumentMarkerController.h:
        * dom/PositionIterator.cpp:
        (WebCore::PositionIterator::setOffsetInLeafNode):
        * dom/PositionIterator.h:
        * editing/Editor.cpp:
        (WebCore::Editor::replaceSelectionWithFragment):
        (WebCore::Editor::Editor):
        (WebCore::findFirstMarkable):
        (WebCore::Editor::selectionStartHasSpellingMarkerFor):
        * editing/Editor.h:
        (WebCore::Editor::spellChecker):
        * editing/SpellChecker.cpp: Added.
        (WebCore::SpellChecker::SpellChecker):
        (WebCore::SpellChecker::~SpellChecker):
        (WebCore::SpellChecker::initRequest):
        (WebCore::SpellChecker::clearRequest):
        (WebCore::SpellChecker::isAsynchronousEnabled):
        (WebCore::SpellChecker::canCheckAsynchronously):
        (WebCore::SpellChecker::isBusy):
        (WebCore::SpellChecker::isValid):
        (WebCore::SpellChecker::isCheckable):
        (WebCore::SpellChecker::requestCheckingFor):
        (WebCore::forwardIterator):
        (WebCore::SpellChecker::didCheck):
        * editing/SpellChecker.h: Added.
        (WebCore::SpellCheckingResult::SpellCheckingResult):
        (WebCore::SpellCheckingResult::type):
        (WebCore::SpellCheckingResult::location):
        (WebCore::SpellCheckingResult::length):
        * loader/EmptyClients.h:
        (WebCore::EmptyEditorClient::requestCheckingOfString):
        * page/EditorClient.h:
        * page/Settings.cpp:
        (WebCore::Settings::Settings):
        * page/Settings.h:
        (WebCore::Settings::setAsynchronousSpellCheckingEnabled):
        (WebCore::Settings::asynchronousSpellCheckingEnabled):
2010-10-28  MORITA Hajime  <morrita@google.com>

        Reviewed by Ojan Vafai.

        spellcheck does not check pasted text
        https://bugs.webkit.org/show_bug.cgi?id=40092

        Added a stub implememntation.

        * src/EditorClientImpl.h:
        (WebKit::EditorClientImpl::requestCheckingOfString):
2010-10-28  MORITA Hajime  <morrita@google.com>

        Reviewed by Ojan Vafai.

        spellcheck does not check pasted text
        https://bugs.webkit.org/show_bug.cgi?id=40092

        Added a stub implememntation.

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

        Reviewed by Ojan Vafai.

        spellcheck does not check pasted text
        https://bugs.webkit.org/show_bug.cgi?id=40092

        Added a stub implememntation.

        * WebCoreSupport/EditorClientGtk.h:
        (WebKit::EditorClient::requestCheckingOfString):
2010-10-28  MORITA Hajime  <morrita@google.com>

        Reviewed by Ojan Vafai.

        spellcheck does not check pasted text
        https://bugs.webkit.org/show_bug.cgi?id=40092

        Added a stub implememntation.

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

        Reviewed by Ojan Vafai.

        spellcheck does not check pasted text
        https://bugs.webkit.org/show_bug.cgi?id=40092

        Added asynchronous spell checking API to WebEditorClient using
        -[NSSpellChecker requestCheckingOfString].
        Note that WebEditorSpellCheckResponder is a small class to receive
        requested spell-checking result. Note that this feature is
        disabled at default.

        Also added [WebPreferences setAsynchronousSpellCheckingEnabled:] to
        enable the feature from LayoutTestController.

        * WebCoreSupport/WebEditorClient.h:
        * WebCoreSupport/WebEditorClient.mm:
        (-[WebEditorSpellCheckResponder initWithSender:WebCore::sequence:results:]):
        (-[WebEditorSpellCheckResponder perform]):
        (toCoreSpellingResult):
        (-[WebEditorSpellCheckResponder WTF::WebCore::]):
        (WebEditorClient::requestCheckingOfString):
        * WebView/WebPreferenceKeysPrivate.h:
        * WebView/WebPreferences.mm:
        (+[WebPreferences initialize]):
        (-[WebPreferences setAsynchronousSpellCheckingEnabled:]):
        (-[WebPreferences asynchronousSpellCheckingEnabled]):
        * WebView/WebPreferencesPrivate.h:
        * WebView/WebView.mm:
        (-[WebView _preferencesChangedNotification:]):
2010-10-28  MORITA Hajime  <morrita@google.com>

        Reviewed by Ojan Vafai.

        spellcheck does not check pasted text
        https://bugs.webkit.org/show_bug.cgi?id=40092

        Added a stub implememntation.

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

        Reviewed by Ojan Vafai.

        spellcheck does not check pasted text
        https://bugs.webkit.org/show_bug.cgi?id=40092

        Added a stub implememntation.

        * WebCoreSupport/WebEditorClient.h:
        (WebEditorClient::requestCheckingOfString):
2010-10-28  MORITA Hajime  <morrita@google.com>

        Reviewed by Ojan Vafai.

        spellcheck does not check pasted text
        https://bugs.webkit.org/show_bug.cgi?id=40092

        Added a stub implememntation.

        * WebCoreSupport/EditorClientWinCE.h:
        (WebKit::EditorClient::requestCheckingOfString):
2010-10-28  MORITA Hajime  <morrita@google.com>

        Reviewed by Ojan Vafai.

        spellcheck does not check pasted text
        https://bugs.webkit.org/show_bug.cgi?id=40092

        Added a stub implememntation.

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

        Reviewed by Ojan Vafai.

        spellcheck does not check pasted text
        https://bugs.webkit.org/show_bug.cgi?id=40092

        Added a stub implememntation.

        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::WebEditorClient::requestCheckingOfString):
        * WebProcess/WebCoreSupport/WebEditorClient.h:
2010-10-28  MORITA Hajime  <morrita@google.com>

        Reviewed by Ojan Vafai.

        spellcheck does not check pasted text
        https://bugs.webkit.org/show_bug.cgi?id=40092

        Added LayoutTestController::setAsynchronousSpellCheckingEnabled()
        to control the setting.

        * DumpRenderTree/LayoutTestController.cpp:
        (setAsynchronousSpellCheckingEnabledCallback):
        (LayoutTestController::staticFunctions):
        * DumpRenderTree/LayoutTestController.h:
        * DumpRenderTree/chromium/LayoutTestController.h:
        * DumpRenderTree/chromium/LayoutTestController.cpp:
        (LayoutTestController::LayoutTestController):
        (LayoutTestController::setAsynchronousSpellCheckingEnabled):
        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
        (LayoutTestController::setAsynchronousSpellCheckingEnabled):
        * DumpRenderTree/mac/DumpRenderTree.mm:
        (resetDefaultsToConsistentValues):
        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
        (LayoutTestController::setAsynchronousSpellCheckingEnabled):
        * DumpRenderTree/qt/LayoutTestControllerQt.h:
        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
        (LayoutTestController::setAsynchronousSpellCheckingEnabled):
        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
        (LayoutTestController::setAsynchronousSpellCheckingEnabled):
        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
        (LayoutTestController::setAsynchronousSpellCheckingEnabled):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73886 268f45cc-cd09-0410-ab3c-d52691b4dbfc
69 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/spelling/script-tests/spellcheck-paste.js [new file with mode: 0644]
LayoutTests/editing/spelling/spellcheck-paste-expected.txt [new file with mode: 0644]
LayoutTests/editing/spelling/spellcheck-paste.html [new file with mode: 0644]
LayoutTests/platform/chromium/test_expectations.txt
LayoutTests/platform/gtk/Skipped
LayoutTests/platform/mac-leopard/Skipped
LayoutTests/platform/mac-tiger/Skipped
LayoutTests/platform/mac-wk2/Skipped
LayoutTests/platform/qt/Skipped
LayoutTests/platform/win/Skipped
WebCore/CMakeLists.txt
WebCore/ChangeLog
WebCore/GNUmakefile.am
WebCore/WebCore.exp.in
WebCore/WebCore.gypi
WebCore/WebCore.pro
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/dom/DocumentMarkerController.cpp
WebCore/dom/DocumentMarkerController.h
WebCore/dom/PositionIterator.cpp
WebCore/dom/PositionIterator.h
WebCore/editing/Editor.cpp
WebCore/editing/Editor.h
WebCore/editing/SpellChecker.cpp [new file with mode: 0644]
WebCore/editing/SpellChecker.h [new file with mode: 0644]
WebCore/loader/EmptyClients.h
WebCore/page/EditorClient.h
WebCore/page/Settings.cpp
WebCore/page/Settings.h
WebKit/chromium/ChangeLog
WebKit/chromium/src/EditorClientImpl.h
WebKit/efl/ChangeLog
WebKit/efl/WebCoreSupport/EditorClientEfl.h
WebKit/gtk/ChangeLog
WebKit/gtk/WebCoreSupport/EditorClientGtk.h
WebKit/haiku/ChangeLog
WebKit/haiku/WebCoreSupport/EditorClientHaiku.h
WebKit/mac/ChangeLog
WebKit/mac/WebCoreSupport/WebEditorClient.h
WebKit/mac/WebCoreSupport/WebEditorClient.mm
WebKit/mac/WebView/WebPreferenceKeysPrivate.h
WebKit/mac/WebView/WebPreferences.mm
WebKit/mac/WebView/WebPreferencesPrivate.h
WebKit/mac/WebView/WebView.mm
WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/EditorClientQt.h
WebKit/win/ChangeLog
WebKit/win/WebCoreSupport/WebEditorClient.h
WebKit/wince/ChangeLog
WebKit/wince/WebCoreSupport/EditorClientWinCE.h
WebKit/wx/ChangeLog
WebKit/wx/WebKitSupport/EditorClientWx.h
WebKit2/ChangeLog
WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/LayoutTestController.cpp
WebKitTools/DumpRenderTree/LayoutTestController.h
WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp