[Webkit-unassigned] [Bug 155532] Provide NSSpellChecker spellChecking methods with the current insertion point

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 16 15:28:45 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=155532

Simon Fraser (smfr) <simon.fraser at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #274216|review?                     |review+
              Flags|                            |

--- Comment #8 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 274216
  --> https://bugs.webkit.org/attachment.cgi?id=274216
Patch

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

>> Source/WebCore/ChangeLog:10
>> +        Pass the Frame’s section to a handful of spelling checking methods that call 
> 
> Frame's selection, not Frame's section

Is there any way to test this? API test perhaps?

> Source/WebKit2/UIProcess/TextChecker.h:75
> +    static Vector<WebCore::TextCheckingResult> checkTextOfParagraph(int64_t spellDocumentTag, StringView text, uint64_t insertionPoint, uint64_t checkingTypes);

I find it a bit odd that the insertionPoint is a uint64_t. Does WebCore handle 64-bit offsets?

> Source/WebKit2/UIProcess/mac/TextCheckerMac.mm:301
> +    options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedInteger:insertionPoint], NSTextCheckingInsertionPointKey, nil];

You should use literals here: @{} etc.

> Source/WebKit2/UIProcess/mac/TextCheckerMac.mm:440
> +    options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedInteger:insertionPoint], NSTextCheckingInsertionPointKey, nil];

Literals.

> Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm:1066
> +    options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedInteger:insertionPointFromCurrentSelection(currentSelection)], NSTextCheckingInsertionPointKey, nil];

literals.

> Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm:1112
> +    options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedInteger:insertionPointFromCurrentSelection(currentSelection)], NSTextCheckingInsertionPointKey, nil];

ditto.

> Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm:1300
> +    options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedInteger:insertionPointFromCurrentSelection(currentSelection)], NSTextCheckingInsertionPointKey, nil];

ditto. Maybe we should just wrap -checkString and -requestCheckingOfString: to avoid the repetition?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160316/ee4f2ce3/attachment.html>


More information about the webkit-unassigned mailing list