2011-01-05 Anders Carlsson <andersca@apple.com>
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Jan 2011 19:41:03 +0000 (19:41 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Jan 2011 19:41:03 +0000 (19:41 +0000)
commit047c400413737e89882782c066441494db3866db
treef4f4f26c3673a2994853eb651752ff37366d0398
parentd8bbc42521e5d5b50cb1b9f7f918753a1cb2f22b
2011-01-05  Anders Carlsson  <andersca@apple.com>

        Reviewed by Sam Weinig.

        More work on spelling
        https://bugs.webkit.org/show_bug.cgi?id=51939

        * UIProcess/API/mac/WKView.mm:
        (-[WKView validateUserInterfaceItem:]):
        Handle changeSpelling: as well.

        (-[WKView showGuessPanel:]):
        Show or hide the guess panel.

        (-[WKView checkSpelling:]):
        Pass false to advanceToNextMisspelling.

        (-[WKView changeSpelling:]):
        Call changeSpellingToWord.

        * UIProcess/TextChecker.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::WebPageProxy):
        Initialize m_pendingLearnOrIgnoreWordMessageCount.

        (WebKit::WebPageProxy::contextMenuItemSelected):
        Handle smart toggles directly in the UI process, keep track of whether
        we're asked to learn or ignore a word.

        (WebKit::WebPageProxy::advanceToNextMisspelling):
        Pass the boolean through.

        (WebKit::WebPageProxy::changeSpellingToWord):
        Send a ChangeSpellingToWord message.

        (WebKit::WebPageProxy::learnWord):
        (WebKit::WebPageProxy::ignoreWord):
        Check that we do have a pending learn or ignore word message. Call through to
        the text checker.

        (WebKit::WebPageProxy::processDidCrash):
        Reset the m_pendingLearnOrIgnoreWordMessageCount variable.

        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        Add new messages.

        * UIProcess/mac/TextCheckerMac.mm:
        (WebKit::TextChecker::learnWord):
        (WebKit::TextChecker::ignoreWord):
        Implement in terms of NSSpellChecker.

        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::WebEditorClient::ignoreWordInSpellDocument):
        (WebKit::WebEditorClient::learnWord):
        Send IgnoreWord and LearnWord messages.

        * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
        (WebKit::WebEditorClient::toggleAutomaticQuoteSubstitution):
        (WebKit::WebEditorClient::toggleAutomaticLinkDetection):
        (WebKit::WebEditorClient::toggleAutomaticDashSubstitution):
        (WebKit::WebEditorClient::toggleAutomaticTextReplacement):
        Add assertions.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::advanceToNextMisspelling):
        Pass the bool along to the Editor.

        (WebKit::WebPage::changeSpellingToWord):
        Replace the selected text.

        * WebProcess/WebPage/WebPage.messages.in:
        Add new ChangeSpellingToWord message and add a boolean to AdvanceToNextMisspelling.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75086 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
WebKit2/ChangeLog
WebKit2/UIProcess/API/mac/WKView.mm
WebKit2/UIProcess/TextChecker.h
WebKit2/UIProcess/WebPageProxy.cpp
WebKit2/UIProcess/WebPageProxy.h
WebKit2/UIProcess/WebPageProxy.messages.in
WebKit2/UIProcess/mac/TextCheckerMac.mm
WebKit2/UIProcess/qt/TextCheckerQt.cpp
WebKit2/UIProcess/win/TextCheckerWin.cpp
WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm
WebKit2/WebProcess/WebPage/WebPage.cpp
WebKit2/WebProcess/WebPage/WebPage.h
WebKit2/WebProcess/WebPage/WebPage.messages.in