Bug 45441 - [Chromium] Implement textInputController.hasSpellingMarker() for Chromium
Summary: [Chromium] Implement textInputController.hasSpellingMarker() for Chromium
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Hajime Morrita
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-08 23:29 PDT by Hironori Bono
Modified: 2010-09-12 21:21 PDT (History)
4 users (show)

See Also:


Attachments
A draft implementation (just for your information) (5.31 KB, patch)
2010-09-09 22:26 PDT, Hironori Bono
no flags Details | Formatted Diff | Diff
Patch (12.34 KB, patch)
2010-09-10 00:49 PDT, Hajime Morrita
tony: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hironori Bono 2010-09-08 23:29:02 PDT
Greetings,

As written in Bug 41832 <https://bugs.webkit.org/show_bug.cgi?id=41832>, I have added textInputController.hasSpellingMarker() so we can write text-based tests for spellcheckers. Unfortunately, this implementation is only for Mac DumpRenderTree and we need to implemented this function for Chromium DumpRenderTree.

Regards,

Hironori Bono
Comment 1 Hajime Morrita 2010-09-09 18:53:06 PDT
OK, I'll take this.
Comment 2 Hironori Bono 2010-09-09 22:26:29 PDT
Created attachment 67154 [details]
A draft implementation (just for your information)

Greetings,

Thank you for taking this issue.
I would like to post my quick implementation. I wish it helps.

Regards,

Hironori Bono
Comment 3 Hironori Bono 2010-09-09 22:32:34 PDT
Greetings,

By the way, Chromium DumpRenderTree checks the spellings of text only on Mac as shown in the following snippet copied from <http://svn.webkit.org/repository/webkit/trunk/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp>.

  void WebViewHost::spellCheck(const WebString& text, int& misspelledOffset, int& misspelledLength)
  {
      // Check the spelling of the given text.
  #if OS(MAC_OS_X)
      // FIXME: rebaseline layout-test results of Windows and Linux so we
      // can enable this mock spellchecker on them.
      m_spellcheck.spellCheckWord(text, &misspelledOffset, &misspelledLength);
  #endif
  }

Should we add another API to DumpRenderTree so we can enable/disable spell-checking?

Regards,

Hironori Bono
Comment 4 Hajime Morrita 2010-09-10 00:49:59 PDT
Created attachment 67162 [details]
Patch
Comment 5 Tony Chang 2010-09-10 10:07:52 PDT
Moving the code into Editor.cpp sounds fine to me, but just to make sure, Eric, is it OK for us to have this method which is currently only used in testing in WebCore (rather than WebKit)?
Comment 6 Hajime Morrita 2010-09-12 18:26:03 PDT
(In reply to comment #5)
> Moving the code into Editor.cpp sounds fine to me, but just to make sure, Eric, is it OK for us to have this method which is currently only used in testing in WebCore (rather than WebKit)?

Hi, I'll land this soon seeing no objection here.
Comment 7 Eric Seidel (no email) 2010-09-12 18:31:16 PDT
Looks fine to me.  We have a bunch of code in WebCore which is only used by DRT.
Comment 8 Hajime Morrita 2010-09-12 21:21:19 PDT
Committed r67362: <http://trac.webkit.org/changeset/67362>