"accept" attribute on file input is ignored for unknown MIME types
Categories
(Core :: DOM: Forms, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox94 | --- | fixed |
People
(Reporter: sam, Assigned: evilpies)
References
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:90.0) Gecko/20100101 Firefox/90.0
Steps to reproduce:
https://js-9q2pd7.stackblitz.io
- Click the upload button
- Browse to a folder that contains files that are not videos
Actual results:
All files are allowed to be selected
Expected results:
Only video files should be selectable
Link to same as above, plus source: https://stackblitz.com/edit/js-9q2pd7?file=index.html
Comment 2•5 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
| Assignee | ||
Comment 3•5 years ago
|
||
Thanks for the report. As far as I can tell it's not really being ignored, but maybe there is something platform specific about this. On Linux Fedora, I see "All files" is selected by default, but there is also an option to select "All supported types".
For reference the test case is just: <input accept="video/quicktime,video/mp4,video/mpeg,video/m4v" multiple="multiple" type="file">. accept="video/*" might produce the desired results.
By comparison, when the value is accept="audio/x-wav,audio/wav,audio/x-aiff,audio/aiff,audio/mpeg,audio/x-m4a", it works as expected. And yes, video/* does work, but it's not my desired outcome, as we don't want to accept all video file types.
BTW, this occurs on both Mac & Windows.
Comment 5•5 years ago
|
||
(In reply to Tom Schuster [:evilpie] from comment #3)
Thanks for the report. As far as I can tell it's not really being ignored, but maybe there is something platform specific about this. On Linux Fedora, I see "All files" is selected by default, but there is also an option to select "All supported types".
Same on Windows, so it might not actually be platform specific.
Comment 6•5 years ago
•
|
||
Removing video/m4v makes things as expected, just as the behavior seen in https://bugzilla.mozilla.org/show_bug.cgi?id=1724890#c2
Chrome does not default to All files even when there is a random unidentified media type. I guess Gecko should follow them.
Comment 7•5 years ago
|
||
BTW, replacing video/m4v with video/x-m4v also fixes it.
Comment 8•5 years ago
|
||
Bug 826176 required all media types to be supported in order to make All Supported Types as default:
:smaug, can we follow what Chrome does or is there still a valid reason to keep the current behavior?
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 10•5 years ago
|
||
I am not sure why this is suddenly producing so many dupes, maybe Chrome changed their behavior? I am going to try and change our implementation.
| Assignee | ||
Comment 12•5 years ago
|
||
Comment 13•5 years ago
|
||
Comment 14•5 years ago
|
||
| bugherder | ||
Updated•4 years ago
|
Description
•