NEW 242110
File input treats accept="audio/*" as accept="video/*"
https://bugs.webkit.org/show_bug.cgi?id=242110
Summary File input treats accept="audio/*" as accept="video/*"
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.