Bug 222008

Summary: [iOS][FCR] Add new datalist dropdown for text inputs
Product: WebKit Reporter: Aditya Keerthi <akeerthi>
Component: FormsAssignee: Aditya Keerthi <akeerthi>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, macpherson, menard, mifenton, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
wenson_hsieh: review+
Patch for landing none

Description Aditya Keerthi 2021-02-16 15:52:24 PST
...
Comment 1 Aditya Keerthi 2021-02-16 15:52:41 PST
<rdar://problem/74410513>
Comment 2 Aditya Keerthi 2021-02-16 15:55:56 PST
Created attachment 420557 [details]
Patch
Comment 3 Wenson Hsieh 2021-02-17 11:13:20 PST
Comment on attachment 420557 [details]
Patch

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

> Source/WebCore/html/TextFieldInputType.h:139
> +    bool shouldOnlyShowDataListDropdownButtonWhenFocusedOrEdited();

Nit - we should mark this `const` now that it's an instance method.

> Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm:175
> +#if ENABLE(DATALIST_ELEMENT)
> +    if (_page)
> +        _page->selectDataListOptionForTesting(optionIndex);
> +#endif

Hm…I think ideally, the testing-only code should simulate interactions by invoking methods on UI objects (e.g. WKDataListSuggestionsDropdown). Though, if there's no clear simple way to achieve that, this is fine too.
Comment 4 Aditya Keerthi 2021-02-17 13:34:46 PST
Created attachment 420707 [details]
Patch for landing
Comment 5 Aditya Keerthi 2021-02-17 13:43:32 PST
(In reply to Wenson Hsieh from comment #3)
> Comment on attachment 420557 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=420557&action=review
> 
> > Source/WebCore/html/TextFieldInputType.h:139
> > +    bool shouldOnlyShowDataListDropdownButtonWhenFocusedOrEdited();
> 
> Nit - we should mark this `const` now that it's an instance method.

Done.
 
> > Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm:175
> > +#if ENABLE(DATALIST_ELEMENT)
> > +    if (_page)
> > +        _page->selectDataListOptionForTesting(optionIndex);
> > +#endif
> 
> Hm…I think ideally, the testing-only code should simulate interactions by
> invoking methods on UI objects (e.g. WKDataListSuggestionsDropdown). Though,
> if there's no clear simple way to achieve that, this is fine too.

As discussed offline, I've moved the testing hook to WKContentViewInteraction.
Comment 6 EWS 2021-02-17 17:10:55 PST
Committed r273049: <https://commits.webkit.org/r273049>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 420707 [details].