Bug 229885

Summary: [macCatalyst] Support photo picker and camera actions for file inputs
Product: WebKit Reporter: Aditya Keerthi <akeerthi>
Component: FormsAssignee: Aditya Keerthi <akeerthi>
Status: NEW ---    
Severity: Normal CC: cdumez, hi, megan_gardner, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
thorton: review+, ews-feeder: commit-queue-
Patch for landing none

Description Aditya Keerthi 2021-09-03 12:31:12 PDT
iOS supports three actions for media-accepting file inputs:
1. Choose Photo or Video
2. Take Photo or Video
3. Choose File

macCatalyst currently only supports (3) – we should add support for (1) and (2).
Comment 1 Aditya Keerthi 2021-09-03 12:40:22 PDT
Created attachment 437298 [details]
Patch
Comment 2 Aditya Keerthi 2021-09-03 12:44:21 PDT
rdar://49961589
Comment 3 Aditya Keerthi 2021-09-03 13:00:13 PDT
Created attachment 437304 [details]
Patch
Comment 4 Tim Horton 2021-09-03 13:08:23 PDT
Comment on attachment 437304 [details]
Patch

It seems slightly odd to me that we would make macCatalyst WebKit and macOS WebKit do different things when you click a file input, but I don't know if that means "macOS WebKit should get an image picker" or "macCatalyst WebKit should just go straight to NSOpenPanel". Regardless, that should be an explicit decision instead of a random ifdef about missing API, so I guess this is a change in a good /direction/.
Comment 5 Aditya Keerthi 2021-09-03 13:34:43 PDT
Created attachment 437306 [details]
Patch for landing
Comment 6 Aditya Keerthi 2021-09-03 13:35:39 PDT
(In reply to Tim Horton from comment #4)
> Comment on attachment 437304 [details]
> Patch
> 
> It seems slightly odd to me that we would make macCatalyst WebKit and macOS
> WebKit do different things when you click a file input, but I don't know if
> that means "macOS WebKit should get an image picker" or "macCatalyst WebKit
> should just go straight to NSOpenPanel". Regardless, that should be an
> explicit decision instead of a random ifdef about missing API, so I guess
> this is a change in a good /direction/.

Thanks for the review!

I will discuss with more Catalyst folks prior to landing.