Bug 180686 - [WK] Add modern WebKit SPI to set auto fill button type and query if the auto fill button is enabled
Summary: [WK] Add modern WebKit SPI to set auto fill button type and query if the auto...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-12-11 17:08 PST by Daniel Bates
Modified: 2017-12-12 18:53 PST (History)
4 users (show)

See Also:


Attachments
Patch (12.33 KB, patch)
2017-12-11 17:10 PST, Daniel Bates
achristensen: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2017-12-11 17:08:15 PST
Add modern WebKit SPI to set the auto fill button type and query whether the auto fill button is enabled. Specifically, add SPI equivalents for WKBundleNodeHandleGetHTMLInputElementAutoFillButtonEnabled() and WKBundleNodeHandleSetHTMLInputElementAutoFillButtonEnabledWithButtonType().
Comment 1 Daniel Bates 2017-12-11 17:10:28 PST
Created attachment 329061 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2017-12-11 17:12:19 PST
<rdar://problem/35983093>
Comment 3 Alex Christensen 2017-12-11 17:58:41 PST
Comment on attachment 329061 [details]
Patch

C SPI exists for both of these.  Is there an advantage to making ObjC equivalents?
Comment 4 Daniel Bates 2017-12-11 20:51:12 PST
(In reply to Alex Christensen from comment #3)
> Comment on attachment 329061 [details]
> Patch
> 
> C SPI exists for both of these.  Is there an advantage to making ObjC
> equivalents?

I thought the long term goal was to get rid of the C SPI.
Comment 5 rabbasian 2017-12-12 12:22:20 PST
(In reply to Alex Christensen from comment #3)
> Comment on attachment 329061 [details]
> Patch
> 
> C SPI exists for both of these.  Is there an advantage to making ObjC
> equivalents?

It would be great to have the ObjC SPI since in MobileSafari we only work with modern WebKit ObjC SPI, and even on macOS Safari we are trying to move away from the C APIs. There is already a node handle class in MobileSafari that fully expects an ObjC interface
Comment 6 Daniel Bates 2017-12-12 15:27:44 PST
Comment on attachment 329061 [details]
Patch

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

> Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:30
> +typedef NS_ENUM(NSInteger, WKAutoFillButtonType) {

Will prefix the name of this enumeration and its enumerators with an underscore before landing.
Comment 7 Daniel Bates 2017-12-12 15:29:54 PST
Comment on attachment 329061 [details]
Patch

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

>> Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:30
>> +typedef NS_ENUM(NSInteger, WKAutoFillButtonType) {
> 
> Will prefix the name of this enumeration and its enumerators with an underscore before landing.

Will annotate this enumeration with WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)) before landing.

> Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:39
> +- (BOOL)isHTMLInputElementAutoFillButtonEnabled;
> +- (void)setHTMLInputElementAutoFillButtonEnabledWithButtonType:(WKAutoFillButtonType)autoFillButtonType;

Will annotate these with WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)) before landing.
Comment 8 Daniel Bates 2017-12-12 18:53:02 PST
Committed r225833: <https://trac.webkit.org/changeset/225833>