Bug 46201 - Need to stop autocorrection panel timer after editing.
Summary: Need to stop autocorrection panel timer after editing.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.6
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2010-09-21 10:38 PDT by Jia Pu
Modified: 2010-09-22 17:44 PDT (History)
3 users (show)

See Also:


Attachments
Proposed patch (v1) (3.16 KB, patch)
2010-09-22 10:02 PDT, Jia Pu
mitz: review+
Details | Formatted Diff | Diff
Proposed patch (v2) (3.29 KB, patch)
2010-09-22 14:17 PDT, Jia Pu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jia Pu 2010-09-21 10:38:12 PDT
<rdar://problem/8441042>

A reproducible case is typing "doesn'". After typing the apostrophe, the string is corrected into "doesn'does'". This exposes in fact two bugs.

1. After typing "doesn", the correction panel timer is started. If the apostrophe is typed before the time fires, by the time the timer fires, we end up checking spelling on "doesn'" instead of "doesn". The solution is to stop timer whenever the selection changes.

2. If the spelling checking is done for the purpose of bringing up correction bubble, we should suppress any suggestion correction whose range does not end at the last character. In this case, the correction range ends at letter "n" which is the second to the last.This is generally a good policy since it is confusing if we alter other text at the same time we show the correction bubble.
Comment 1 Jia Pu 2010-09-21 10:56:21 PDT
(In reply to comment #0)
> <rdar://problem/8441042>
> 
> A reproducible case is typing "doesn'". After typing the apostrophe, the string is corrected into "doesn'does'". This exposes in fact two bugs.
> 
> 1. After typing "doesn", the correction panel timer is started. If the apostrophe is typed before the time fires, by the time the timer fires, we end up checking spelling on "doesn'" instead of "doesn". The solution is to stop timer whenever the selection changes.
> 
> 2. If the spelling checking is done for the purpose of bringing up correction bubble, we should suppress any suggestion correction whose range does not end at the last character. In this case, the correction range ends at letter "n" which is the second to the last.This is generally a good policy since it is confusing if we alter other text at the same time we show the correction bubble.

I should point out that fixing bug 1 would prevent bug 2 from manifest. But we should fix them both.
Comment 2 Jia Pu 2010-09-22 10:02:06 PDT
Created attachment 68385 [details]
Proposed patch (v1)
Comment 3 mitz 2010-09-22 11:23:18 PDT
Comment on attachment 68385 [details]
Proposed patch (v1)

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

> WebCore/editing/Editor.h:315
>      void startCorrectionPanelTimer();
> +    void stopCorrectionPanelTimer();

I don’t think these two methods need to be public. r+ but please upload a new patch making these methods private if possible. If not, set the “cq” flag to ? and I will set to + and the patch will be committed as-is.
Comment 4 Jia Pu 2010-09-22 14:17:07 PDT
Created attachment 68441 [details]
Proposed patch (v2)

Revised per comment #3. 

startCorrectionPanelTimer() is used by TypingCommand, so need to stay public. I have made stopCorrectionPanelTimer() private.
Comment 5 WebKit Commit Bot 2010-09-22 17:44:27 PDT
Comment on attachment 68441 [details]
Proposed patch (v2)

Clearing flags on attachment: 68441

Committed r68103: <http://trac.webkit.org/changeset/68103>
Comment 6 WebKit Commit Bot 2010-09-22 17:44:32 PDT
All reviewed patches have been landed.  Closing bug.