Bug 184662 - Add -[_WKInputDelegate willStartInputSession:] for clients that want to configure input session before assisting form node
Summary: Add -[_WKInputDelegate willStartInputSession:] for clients that want to confi...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: WebKit Local Build
Hardware: iPhone / iPad iOS 11
: P2 Normal
Assignee: Paul Knight
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-04-16 13:34 PDT by Paul Knight
Modified: 2018-04-18 10:31 PDT (History)
8 users (show)

See Also:


Attachments
Patch (4.66 KB, patch)
2018-04-16 13:49 PDT, Paul Knight
no flags Details | Formatted Diff | Diff
Patch (4.94 KB, patch)
2018-04-17 12:04 PDT, Paul Knight
no flags Details | Formatted Diff | Diff
Patch (4.94 KB, patch)
2018-04-17 12:10 PDT, Paul Knight
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Knight 2018-04-16 13:34:49 PDT
Clients may wish to configure a WKInputSession before we start assisting a node. Add a -[_WKInputDelegateDelegate willStartInputSession:] callback for this reason.

For example, clients that wish to present a custom input view may want to configure the WKFormInputSession's customInputView before the keyboard is presented. Otherwise the standard keyboard will begin to animate and then the custom input view will swap places later.
Comment 1 Radar WebKit Bug Importer 2018-04-16 13:39:07 PDT
<rdar://problem/39467668>
Comment 2 Paul Knight 2018-04-16 13:49:14 PDT
Created attachment 338035 [details]
Patch
Comment 3 Wenson Hsieh 2018-04-16 13:57:10 PDT
This looks reasonable to me, especially since this bookends the existing -didStartInputSession: delegate method.

It might require a WebKit2 owner to rubber-stamp, though...adding a few more folks.
Comment 4 Darin Adler 2018-04-16 17:59:37 PDT
Comment on attachment 338035 [details]
Patch

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

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:4040
> +    _formInputSession = adoptNS([[WKFormInputSession alloc] initWithContentView:self focusedElementInfo:focusedElementInfo.get() requiresStrongPasswordAssistance:_focusRequiresStrongPasswordAssistance]);

Wouldn’t it be nicer to create this only if the input delegate implements one of the two will/startInputSession methods?
Comment 5 Darin Adler 2018-04-16 18:00:22 PDT
Comment on attachment 338035 [details]
Patch

Otherwise, looks fine to me. Can cache implementsDidStartInputSession in a boolean to avoid computing it twice.
Comment 6 Paul Knight 2018-04-17 12:04:01 PDT
Created attachment 338138 [details]
Patch
Comment 7 Wenson Hsieh 2018-04-17 12:08:01 PDT
Comment on attachment 338138 [details]
Patch

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

> Source/WebKit/ChangeLog:6
> +        Clients may wish to configure a WKInputSession before we start assisting

Nit - ChangeLog descriptions go below the "Reviewed by" line.
Comment 8 Paul Knight 2018-04-17 12:10:05 PDT
Created attachment 338139 [details]
Patch
Comment 9 WebKit Commit Bot 2018-04-18 10:31:47 PDT
Comment on attachment 338139 [details]
Patch

Clearing flags on attachment: 338139

Committed r230766: <https://trac.webkit.org/changeset/230766>
Comment 10 WebKit Commit Bot 2018-04-18 10:31:48 PDT
All reviewed patches have been landed.  Closing bug.