Bug 153331 - Handle soft spaces after accepted candidates
Summary: Handle soft spaces after accepted candidates
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-21 16:22 PST by Beth Dakin
Modified: 2016-01-25 12:32 PST (History)
6 users (show)

See Also:


Attachments
Patch (6.87 KB, patch)
2016-01-21 16:35 PST, Beth Dakin
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Beth Dakin 2016-01-21 16:22:51 PST
Handle soft spaces after accepted candidates

rdar://problem/23958418
Comment 1 Beth Dakin 2016-01-21 16:35:35 PST
Created attachment 269518 [details]
Patch
Comment 2 WebKit Commit Bot 2016-01-21 17:15:51 PST
Attachment 269518 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm:3526:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Darin Adler 2016-01-24 11:58:35 PST
Comment on attachment 269518 [details]
Patch

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

> Source/WebCore/editing/Editor.cpp:3567
> +    if (!acceptedCandidate.replacement.endsWith(" "))

Should be endsWith(' ') to avoid unnecessary work.

> Source/WebCore/editing/Editor.cpp:3568
> +        insertText(String(" "), 0);

Should be ASCIILiteral instead of String, although not sure how helpful that optimization is in cases like this.
Comment 4 Simon Fraser (smfr) 2016-01-25 11:59:41 PST
Comment on attachment 269518 [details]
Patch

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

> Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h:638
> +    NSRange m_softSpaceRange;

Can this be initialized with { NSNotFound, 0 } ?
Comment 5 Beth Dakin 2016-01-25 12:30:26 PST
Thanks Darin and Simon! http://trac.webkit.org/changeset/195547
Comment 6 Beth Dakin 2016-01-25 12:32:58 PST
(In reply to comment #5)
> Thanks Darin and Simon! http://trac.webkit.org/changeset/195547

I should note that I made all of the suggested changes.