Changeset 141110 in webkit


Ignore:
Timestamp:
Jan 29, 2013 7:29:48 AM (11 years ago)
Author:
g.czajkowski@samsung.com
Message:

[EFL] Unified text checker implementation.
https://bugs.webkit.org/show_bug.cgi?id=107682

Reviewed by Anders Carlsson.

Source/WebCore:

No new tests, covered by editing/spelling tests.

  • platform/text/TextChecking.h:

(WebCore):
Enabling unified text checker feature for WebKit-EFL.

Source/WebKit/efl:

Add an empty checkTextOfParagraph implementation for WK1-EFL
to do not break build when WTF_USE_UNIFIED_TEXT_CHECKING
is enabled.

  • WebCoreSupport/EditorClientEfl.h:

(EditorClientEfl):
(WebCore::EditorClientEfl::checkTextOfParagraph):

Source/WebKit2:

  • UIProcess/efl/TextCheckerEfl.cpp:

(WebKit):
(WebKit::TextChecker::checkTextOfParagraph):
Allow to check spelling for multiple words,
their misspelling location and length are saved to the vector.

  • WebProcess/WebCoreSupport/WebEditorClient.h:
  • WebProcess/WebCoreSupport/efl/WebEditorClientEfl.cpp:

(WebKit::WebEditorClient::checkTextOfParagraph):
(WebKit):
As spelling implementation is exposed to UIProcess,
send a meesage to UIProcess to call TextChecker::checkTextOfParagraph.

LayoutTests:

  • platform/efl-wk2/TestExpectations:

Skip context-menu-suggestions.html until
https://bugs.webkit.org/show_bug.cgi?id=107684 lands.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r141106 r141110  
     12013-01-29  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
     2
     3        [EFL] Unified text checker implementation.
     4        https://bugs.webkit.org/show_bug.cgi?id=107682
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * platform/efl-wk2/TestExpectations:
     9        Skip context-menu-suggestions.html until
     10        https://bugs.webkit.org/show_bug.cgi?id=107684 lands.
     11
    1122013-01-29  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
    213
  • trunk/LayoutTests/platform/efl-wk2/TestExpectations

    r141103 r141110  
    293293Bug(EFL) fast/events/touch/basic-single-touch-events.html [ Failure ]
    294294
     295# On Linux, should be able to get spelling suggestions without selecting the misspelled word when unified text checker is enabled.
     296webkit.org/b/107684 editing/spelling/context-menu-suggestions.html [ Failure ]
     297
    295298# Needs grammar checking
    296299Bug(EFL) editing/spelling/grammar-edit-word.html [ Failure ]
  • trunk/Source/WebCore/ChangeLog

    r141109 r141110  
     12013-01-29  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
     2
     3        [EFL] Unified text checker implementation.
     4        https://bugs.webkit.org/show_bug.cgi?id=107682
     5
     6        Reviewed by Anders Carlsson.
     7
     8        No new tests, covered by editing/spelling tests.
     9
     10        * platform/text/TextChecking.h:
     11        (WebCore):
     12        Enabling unified text checker feature for WebKit-EFL.
     13
    1142013-01-29  Vladislav Kaznacheev  <kaznacheev@chromium.org>
    215
  • trunk/Source/WebCore/platform/text/TextChecking.h

    r123809 r141110  
    4040#define WTF_USE_GRAMMAR_CHECKING 1
    4141
    42 #if (PLATFORM(MAC) && (PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060)) || PLATFORM(BLACKBERRY)
     42#if (PLATFORM(MAC) && (PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060)) || PLATFORM(BLACKBERRY) || PLATFORM(EFL)
    4343#define WTF_USE_UNIFIED_TEXT_CHECKING 1
    4444#endif
  • trunk/Source/WebKit/efl/ChangeLog

    r141040 r141110  
     12013-01-29  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
     2
     3        [EFL] Unified text checker implementation.
     4        https://bugs.webkit.org/show_bug.cgi?id=107682
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Add an empty checkTextOfParagraph implementation for WK1-EFL
     9        to do not break build when WTF_USE_UNIFIED_TEXT_CHECKING
     10        is enabled.
     11
     12        * WebCoreSupport/EditorClientEfl.h:
     13        (EditorClientEfl):
     14        (WebCore::EditorClientEfl::checkTextOfParagraph):
     15
    1162013-01-28  Huang Dongsung  <luxtella@company100.net>
    217
  • trunk/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.h

    r138326 r141110  
    150150    virtual void setInputMethodState(bool enabled);
    151151    virtual void requestCheckingOfString(WTF::PassRefPtr<WebCore::TextCheckingRequest>) { }
     152#if USE(UNIFIED_TEXT_CHECKING)
     153    virtual void checkTextOfParagraph(const UChar*, int, TextCheckingTypeMask, Vector<TextCheckingResult>&) { }
     154#endif
    152155    virtual TextCheckerClient* textChecker() { return this; }
    153156
  • trunk/Source/WebKit2/ChangeLog

    r141102 r141110  
     12013-01-29  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
     2
     3        [EFL] Unified text checker implementation.
     4        https://bugs.webkit.org/show_bug.cgi?id=107682
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * UIProcess/efl/TextCheckerEfl.cpp:
     9        (WebKit):
     10        (WebKit::TextChecker::checkTextOfParagraph):
     11        Allow to check spelling for multiple words,
     12        their misspelling location and length are saved to the vector.
     13
     14        * WebProcess/WebCoreSupport/WebEditorClient.h:
     15        * WebProcess/WebCoreSupport/efl/WebEditorClientEfl.cpp:
     16        (WebKit::WebEditorClient::checkTextOfParagraph):
     17        (WebKit):
     18        As spelling implementation is exposed to UIProcess,
     19        send a meesage to UIProcess to call TextChecker::checkTextOfParagraph.
     20
    1212013-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
    222
  • trunk/Source/WebKit2/UIProcess/efl/TextCheckerEfl.cpp

    r133736 r141110  
    125125}
    126126
     127#if USE(UNIFIED_TEXT_CHECKING)
     128Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(int64_t spellDocumentTag, const UChar* text, int length, uint64_t checkingTypes)
     129{
     130    Vector<TextCheckingResult> paragraphCheckingResult;
     131#if ENABLE(SPELLCHECK)
     132    if (checkingTypes & TextCheckingTypeSpelling) {
     133        int offset = 0;
     134        while (offset < length) {
     135            int32_t misspellingLocation = -1;
     136            int32_t misspellingLength = 0;
     137            checkSpellingOfString(spellDocumentTag, text + offset, length - offset, misspellingLocation, misspellingLength);
     138            if (!misspellingLength)
     139                break;
     140
     141            TextCheckingResult misspellingResult;
     142            misspellingResult.type = TextCheckingTypeSpelling;
     143            misspellingResult.location = offset + misspellingLocation;
     144            misspellingResult.length = misspellingLength;
     145            paragraphCheckingResult.append(misspellingResult);
     146
     147            offset += misspellingLocation + misspellingLength;
     148        }
     149    }
     150#else
     151    UNUSED_PARAM(spellDocumentTag);
     152    UNUSED_PARAM(text);
     153    UNUSED_PARAM(length);
     154    UNUSED_PARAM(checkingTypes);
     155#endif
     156    return paragraphCheckingResult;
     157}
     158#endif
     159
    127160void TextChecker::checkSpellingOfString(int64_t spellDocumentTag, const UChar* text, uint32_t length, int32_t& misspellingLocation, int32_t& misspellingLength)
    128161{
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h

    r136620 r141110  
    138138    virtual String getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord) OVERRIDE;
    139139    virtual void checkGrammarOfString(const UChar*, int length, Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength) OVERRIDE;
    140 #if PLATFORM(MAC)
     140#if PLATFORM(MAC) || PLATFORM(EFL)
    141141    virtual void checkTextOfParagraph(const UChar* text, int length, WebCore::TextCheckingTypeMask checkingTypes, Vector<WebCore::TextCheckingResult>& results) OVERRIDE;
    142142#endif
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/efl/WebEditorClientEfl.cpp

    r137023 r141110  
    6161}
    6262
     63void WebEditorClient::checkTextOfParagraph(const UChar* text, int length, WebCore::TextCheckingTypeMask checkingTypes, Vector<TextCheckingResult>& results)
     64{
     65    m_page->sendSync(Messages::WebPageProxy::CheckTextOfParagraph(String(text, length), checkingTypes), Messages::WebPageProxy::CheckTextOfParagraph::Reply(results));
    6366}
     67
     68}
Note: See TracChangeset for help on using the changeset viewer.