Bug 155343

Summary: [iOS] Allow clients to specify text suggestions to be used for a form input session
Product: WebKit Reporter: Chelsea Pugh <cpugh>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Enhancement CC: adele, commit-queue, cpugh, enrica, mitz
Priority: P2    
Version: WebKit Nightly Build   
Hardware: iPhone / iPad   
OS: Unspecified   
Attachments:
Description Flags
Patch to resolve [iOS] Allow clients to specify text suggestions to be used for a form input session
mitz: review-
patch version 2 mitz: review+

Description Chelsea Pugh 2016-03-10 18:59:21 PST
Allow clients to specify text suggestions to be used for a form input session. Patch forthcoming.
Comment 1 Chelsea Pugh 2016-03-10 21:35:03 PST
Created attachment 273685 [details]
Patch to resolve [iOS] Allow clients to specify text suggestions to be used for a form input session
Comment 2 mitz 2016-03-10 21:47:33 PST
Comment on attachment 273685 [details]
Patch to resolve [iOS] Allow clients to specify text suggestions to be used for a form input session

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

> Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:313
> +    id <UITextInputSuggestionDelegate> suggestionDelegate = (id <UITextInputSuggestionDelegate>)_contentView.inputDelegate;

Should we assert that this was a valid cast?

> Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:314
> +    _suggestions = suggestions;

You should adhere to the API contract and copy the array here.
Comment 3 Chelsea Pugh 2016-03-11 14:03:39 PST
Created attachment 273765 [details]
patch version 2
Comment 4 WebKit Commit Bot 2016-03-11 14:05:28 PST
Attachment 273765 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:324:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 1 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 mitz 2016-03-11 14:07:04 PST
Comment on attachment 273765 [details]
patch version 2

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

> Source/WebKit2/UIProcess/API/Cocoa/_WKInputDelegate.h:48
>  - (BOOL)_webView:(WKWebView *)webView hasSuggestionsForCurrentStringInInputSession:(id <_WKFormInputSession>)inputSession;
>  - (NSArray *)_webView:(WKWebView *)webView suggestionsForString:(NSString *)string inInputSession:(id <_WKFormInputSession>)inputSession;

Shouldn’t be part of this bug, but I think we can get rid of this old suggestions API, since we never ended up invoking these methods.
Comment 6 mitz 2016-03-11 14:13:41 PST
Committed <http://trac.webkit.org/r198046>.