Bug 108511

Summary: [Chromium] Spelling should ignore punctuation
Product: WebKit Reporter: Rouslan Solomakhin <rouslan+webkit>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: groby, rniwa, rouslan+webkit, tony, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 106815    
Attachments:
Description Flags
Patch
none
Patch none

Rouslan Solomakhin
Reported 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.
Attachments
Patch (4.10 KB, patch)
2013-02-01 11:45 PST, Rouslan Solomakhin
no flags
Patch (3.96 KB, patch)
2013-02-01 13:20 PST, Rouslan Solomakhin
no flags
Rouslan Solomakhin
Comment 1 2013-02-01 11:45:15 PST
Tony Chang
Comment 2 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?
Rouslan Solomakhin
Comment 3 2013-02-01 13:20:54 PST
Rouslan Solomakhin
Comment 4 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.
Tony Chang
Comment 5 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.
WebKit Review Bot
Comment 6 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>
WebKit Review Bot
Comment 7 2013-02-01 15:05:38 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.