Bug 155343 - [iOS] Allow clients to specify text suggestions to be used for a form input session
Summary: [iOS] Allow clients to specify text suggestions to be used for a form input s...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: iPhone / iPad Unspecified
: P2 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-10 18:59 PST by Chelsea Pugh
Modified: 2016-03-11 14:13 PST (History)
5 users (show)

See Also:


Attachments
Patch to resolve [iOS] Allow clients to specify text suggestions to be used for a form input session (4.98 KB, patch)
2016-03-10 21:35 PST, Chelsea Pugh
mitz: review-
Details | Formatted Diff | Diff
patch version 2 (5.05 KB, patch)
2016-03-11 14:03 PST, Chelsea Pugh
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>.