[Webkit-unassigned] [Bug 242110] New: File input treats accept="audio/*" as accept="video/*"

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 29 08:44:59 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=242110

            Bug ID: 242110
           Summary: File input treats accept="audio/*" as accept="video/*"
           Product: WebKit
           Version: Safari 15
          Hardware: iPhone / iPad
                OS: iOS 15
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Forms
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: sam at samgentle.com
                CC: cdumez at apple.com, wenson_hsieh at apple.com

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220629/502e3ad6/attachment.htm>


More information about the webkit-unassigned mailing list