Bug 188669

Summary: [Datalist][iOS] Display suggestions for input[type=color]
Product: WebKit Reporter: Aditya Keerthi <pxlcoder>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, ews-watchlist, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: iPhone / iPad   
OS: Unspecified   
Attachments:
Description Flags
Patch
thorton: review+, ews-watchlist: commit-queue-
Archive of layout-test-results from ews206 for win-future
none
Patch
none
Patch
none
Patch for landing none

Description Aditya Keerthi 2018-08-16 11:58:14 PDT
This bug tracks the iOS work required to show suggestions for color input fields with a list attribute.
Comment 1 Aditya Keerthi 2018-08-16 12:04:26 PDT
Created attachment 347281 [details]
Patch
Comment 2 Tim Horton 2018-08-17 14:53:43 PDT
Comment on attachment 347281 [details]
Patch

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

> Source/WebKit/UIProcess/ios/forms/WKFormColorPicker.mm:48
> +#if ENABLE(DATALIST_ELEMENT)

Newline before the #if usually

> Source/WebKit/UIProcess/ios/forms/WKFormColorPicker.mm:168
> +    return @[ @[ [UIColor redColor], [UIColor orangeColor], [UIColor yellowColor], [UIColor greenColor], [UIColor cyanColor], [UIColor blueColor], [UIColor magentaColor], [UIColor purpleColor], [UIColor brownColor], [UIColor whiteColor], [UIColor grayColor], [UIColor blackColor] ] ];

Ideally I think these would have all been UIColor.redColor (dots!), but whatever.

> Source/WebKit/UIProcess/ios/forms/WKFormColorPicker.mm:202
> +            WebCore::Color color = view.assistedNodeInformation.suggestedColors.at(i);

Why at() instead of subscripting? (maybe there's a reason?)

> Source/WebKit/UIProcess/ios/forms/WKFormColorPicker.mm:203
> +            [colors addObject: [UIColor colorWithCGColor:cachedCGColor(color)]];

There's some weird spaces here (after the colon).
Do we not have a UIColor cache? (maybe not)

> Source/WebKit/UIProcess/ios/forms/WKFormColorPicker.mm:208
> +    } else
> +#endif
> +        topColorMatrix = [[self class] defaultTopColorMatrix];

I do not love flow-control-crossing-ifdef-boundaries, but maybe it's fine.
Comment 3 EWS Watchlist 2018-08-17 15:16:15 PDT
Comment on attachment 347281 [details]
Patch

Attachment 347281 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/8894924

New failing tests:
http/tests/security/canvas-remote-read-remote-video-blocked-no-crossorigin.html
Comment 4 EWS Watchlist 2018-08-17 15:16:26 PDT
Created attachment 347393 [details]
Archive of layout-test-results from ews206 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews206  Port: win-future  Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment 5 Aditya Keerthi 2018-08-17 15:42:02 PDT
Created attachment 347399 [details]
Patch
Comment 6 Aditya Keerthi 2018-08-17 16:10:05 PDT
Created attachment 347406 [details]
Patch
Comment 7 Tim Horton 2018-08-17 16:13:41 PDT
Comment on attachment 347406 [details]
Patch

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

> Source/WebKit/UIProcess/ios/forms/WKFormColorPicker.mm:247
>          // On iPad, round one corner of the indicator if it's at the corner of the picker, to match the popover.

Is this comment slightly inaccurate now?
Comment 8 Aditya Keerthi 2018-08-17 16:32:03 PDT
Created attachment 347411 [details]
Patch for landing
Comment 9 Aditya Keerthi 2018-08-17 16:33:38 PDT
(In reply to Tim Horton from comment #7)
> Comment on attachment 347406 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=347406&action=review
> 
> > Source/WebKit/UIProcess/ios/forms/WKFormColorPicker.mm:247
> >          // On iPad, round one corner of the indicator if it's at the corner of the picker, to match the popover.
> 
> Is this comment slightly inaccurate now?

Changed it to reflect the fact that multiple corners of the indicator could border the corners of the picker.
Comment 10 WebKit Commit Bot 2018-08-17 17:43:29 PDT
Comment on attachment 347411 [details]
Patch for landing

Clearing flags on attachment: 347411

Committed r235004: <https://trac.webkit.org/changeset/235004>
Comment 11 Radar WebKit Bug Importer 2018-08-20 16:55:02 PDT
<rdar://problem/43534552>