Bug 222008 - [iOS][FCR] Add new datalist dropdown for text inputs
Summary: [iOS][FCR] Add new datalist dropdown for text inputs
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Aditya Keerthi
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-16 15:52 PST by Aditya Keerthi
Modified: 2021-02-17 17:10 PST (History)
12 users (show)

See Also:


Attachments
Patch (42.15 KB, patch)
2021-02-16 15:55 PST, Aditya Keerthi
wenson_hsieh: review+
Details | Formatted Diff | Diff
Patch for landing (43.90 KB, patch)
2021-02-17 13:34 PST, Aditya Keerthi
no flags Details | Formatted Diff | Diff

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