Bug 108511 - [Chromium] Spelling should ignore punctuation
Summary: [Chromium] Spelling should ignore punctuation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 106815
  Show dependency treegraph
 
Reported: 2013-01-31 12:23 PST by Rouslan Solomakhin
Modified: 2013-02-01 15:05 PST (History)
5 users (show)

See Also:


Attachments
Patch (4.10 KB, patch)
2013-02-01 11:45 PST, Rouslan Solomakhin
no flags Details | Formatted Diff | Diff
Patch (3.96 KB, patch)
2013-02-01 13:20 PST, Rouslan Solomakhin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rouslan Solomakhin 2013-01-31 12:23:33 PST
Punctuation marks should be treated as whitespace: spelling should ignore them. To test manually, type 'wellcome!', select 'wellcome!', and context-click on the selection. The test succeeds when the context menu has spell check suggestions.
Comment 1 Rouslan Solomakhin 2013-02-01 11:45:15 PST
Created attachment 186092 [details]
Patch
Comment 2 Tony Chang 2013-02-01 12:06:55 PST
Comment on attachment 186092 [details]
Patch

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

> Source/WebKit/chromium/src/ContextMenuClientImpl.cpp:147
> +// Returns true for whitespace and punctuation characters. Returns false for every other type of character.

Remove this comment.

> Source/WebKit/chromium/src/ContextMenuClientImpl.cpp:150
> +    return WTF::Unicode::isSeparatorSpace(c) || WTF::Unicode::isPunct(c);

The old code did WTF::Unicode::direction(c) == WTF::Unicode::WhiteSpaceNeutral instead of WTF::Unicode::isSeparatorSpace(c).  Is this difference intentional?  Maybe we should #include <wtf/text/StringImpl.h> and use isSpaceOrNewline(c) || WTF::Unicode::isPunct(c) to be more like the old code?
Comment 3 Rouslan Solomakhin 2013-02-01 13:20:54 PST
Created attachment 186121 [details]
Patch
Comment 4 Rouslan Solomakhin 2013-02-01 13:24:06 PST
(In reply to comment #2)
> (From update of attachment 186092 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=186092&action=review
> 
> > Source/WebKit/chromium/src/ContextMenuClientImpl.cpp:147
> > +// Returns true for whitespace and punctuation characters. Returns false for every other type of character.
> 
> Remove this comment.

Removed. What are the guidelines for function comments?

> > Source/WebKit/chromium/src/ContextMenuClientImpl.cpp:150
> > +    return WTF::Unicode::isSeparatorSpace(c) || WTF::Unicode::isPunct(c);
> 
> The old code did WTF::Unicode::direction(c) == WTF::Unicode::WhiteSpaceNeutral instead of WTF::Unicode::isSeparatorSpace(c).  Is this difference intentional?  Maybe we should #include <wtf/text/StringImpl.h> and use isSpaceOrNewline(c) || WTF::Unicode::isPunct(c) to be more like the old code?

The difference is not intentional. I switched to "isSpaceOrNewLine(c) || WTF::Unicode::isPunct(c)" as you suggested. I did not need to include StringImpl.h.
Comment 5 Tony Chang 2013-02-01 14:42:14 PST
Comment on attachment 186121 [details]
Patch

Most functions don't have comments in WebKit.  Instead, we try to use descriptive function names.
Comment 6 WebKit Review Bot 2013-02-01 15:05:33 PST
Comment on attachment 186121 [details]
Patch

Clearing flags on attachment: 186121

Committed r141650: <http://trac.webkit.org/changeset/141650>
Comment 7 WebKit Review Bot 2013-02-01 15:05:38 PST
All reviewed patches have been landed.  Closing bug.