Bug 242110

Summary: File input treats accept="audio/*" as accept="video/*"
Product: WebKit Reporter: Sam Gentle <sam>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: akeerthi, cdumez, eric.carlson, jer.noble, sabouhallawa, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: iPhone / iPad   
OS: iOS 15   
See Also: https://bugs.webkit.org/show_bug.cgi?id=234566
https://bugs.webkit.org/show_bug.cgi?id=34442

Sam Gentle
Reported 2022-06-29 08:44:59 PDT
When iOS Safari encounters a file input with an accept attribute of "audio/*", like so: <input type="file" accept="audio/*"> It treats it identically to the following: <input type="file" accept="video/*"> That is, it offers the photo library and video recorder as options, and the file picker is filtered to include video files (eg, .flv, .mp4), but not audio files (eg .mp3, .wav, .m4a). I believe this was introduced by r250410, which made UTIsForMIMETypes return a UTTypeMovie instead of a UTTypeAudio so that the video recorder could be used for audio capture. However, this means that UTTypeMovie is also passed to the file picker (via the reference to _acceptedUTIs in showFilePickerMenu). The tests in LayoutTests/fast/forms/ios/file-upload-panel.html (updated in r252051) seem to indicate that at least the photo library and video recorder options are intentional, though the resulting file has a video/quicktime MIME type. The tests in LayoutTests/fast/forms/ios/file-upload-panel-accept.html don't cover "audio/*". Also mentioned in bug 234566 and bug 34442 comment 8.
Attachments
Radar WebKit Bug Importer
Comment 1 2022-07-06 08:45:12 PDT
Note You need to log in before you can comment on or make changes to this bug.