Bug 63050 - [chromium] cannot replace a misspelled phrase with a suggested word
Summary: [chromium] cannot replace a misspelled phrase with a suggested word
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-21 00:17 PDT by Hironori Bono
Modified: 2013-04-11 14:41 PDT (History)
3 users (show)

See Also:


Attachments
A patch v0 (12.51 KB, patch)
2011-06-21 01:57 PDT, Hironori Bono
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hironori Bono 2011-06-21 00:17:05 PDT
(Copied from <http://crbug.com/86905>.)

What steps will reproduce the problem?
1. Open the attached file "replace.html". (Chrome shows a user-added marker under a phrase 'mer ger'.)
2. Right-click the phrase. (Chrome shows a user-added suggestion 'merger' as shown in the attached picture '001.png'.)
3. Choose the suggestion.

What is the expected output?
a misspelled phrase 'mer ger' is replaced with the suggestion 'merger'.

What do you see instead?
a part of the misspelled phrase is replaced with the suggestion as shown in the attached picture '002.png'.

Please use labels and text to provide additional information.
WebFrameImpl::replaceSelection() of Chrome just replaces the selection with the given text and this problem happens when this selection is not equal to the one of a user-added marker. We need to replace the range of a user-added marker with the given text for this case.

Regards,

Hironori Bono
Comment 1 Hironori Bono 2011-06-21 01:57:04 PDT
Created attachment 97951 [details]
A patch v0

Greetings,

I have written a quick fix for Chromium. It may be better to change SpellingCorrectionCommand so it works not only on Chromium but also on other platforms?

Regards,

Hironori Bono
Comment 2 WebKit Review Bot 2011-06-21 01:59:20 PDT
Attachment 97951 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/edit..." exit_code: 1

Source/WebKit/chromium/src/WebFrameImpl.cpp:133:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Hajime Morrita 2011-06-21 23:57:34 PDT
Comment on attachment 97951 [details]
A patch v0

View in context: https://bugs.webkit.org/attachment.cgi?id=97951&action=review

> Source/WebKit/chromium/src/WebFrameImpl.cpp:1148
>  }

As you said, I believe this is worth having inside WebCore.
If we have this inside WebCore, we no longer need new TextInputController method.
Also, this behavior is desirable for spelling marker in general, not only for API-based spellchecking.

> LayoutTests/editing/spelling/spellcheck-api-replace.html:7
> +<script language="javascript" type="text/javascript">

Could you get these two <script> block together?

> LayoutTests/editing/spelling/spellcheck-api-replace.html:18
> +function RunTest() {

we usually use camel case name like "runTest"
Comment 4 Hajime Morrita 2011-06-27 02:11:53 PDT
Comment on attachment 97951 [details]
A patch v0

Marking obsolete at now. because original change was gone.