Closed
Bug 1364550
Opened 7 years ago
Closed 7 years ago
File Input with `accept="image/jpeg"` does not accept .jpeg on macOS
Categories
(Core :: DOM: Core & HTML, defect, P2)
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: dduan, Assigned: jessica)
References
Details
Attachments
(2 files, 1 obsolete file)
18.88 KB,
image/png
|
Details | |
2.02 KB,
patch
|
jessica
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36 Steps to reproduce: Create a file input that accepts jpegs `<input type="file" accept="mime/jpeg">` Actual results: If you open the file selector, "all supported files" should be enabled by default but any file with .jpeg extension will greyed out. Only .jpg extension will be available. Expected results: .jpeg and .jpg extensions should both be available
Updated•7 years ago
|
Component: Untriaged → DOM
Product: Firefox → Core
Comment 1•7 years ago
|
||
Confirmed on MacOS also. Note that the steps are wrong, should be: `<input type="file" accept="image/jpeg">` But it's still broken.
Comment 2•7 years ago
|
||
Hi Jessica, mind taking a look?
Component: DOM → DOM: Core & HTML
Flags: needinfo?(jjong)
Priority: -- → P2
Comment 3•7 years ago
|
||
Assignee | ||
Comment 4•7 years ago
|
||
I can reproduce this only on Mac not on Ubuntu. HTMLInputElement::SetFilePickerFiltersFromAccept gets mimeInfo from mimeService, and mimeInfo is implemented for each OS. For mac, it seems that we use the API `preferredExtensionForMIMEType`, so we only get one extension. Maybe we should use `extensionsForMIMEType` instead. Let me see if it works... [1] http://searchfox.org/mozilla-central/rev/ae24a3c83d22e0e35aecfd9049c2b463ca7e045b/uriloader/exthandler/mac/nsOSHelperAppService.mm#504
Flags: needinfo?(jjong)
Assignee | ||
Updated•7 years ago
|
Summary: File Input with `accept="mime/jpeg"` does not accept .jpeg → File Input with `accept="image/jpeg"` does not accept .jpeg
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → jjong
Assignee | ||
Comment 5•7 years ago
|
||
Assignee | ||
Comment 6•7 years ago
|
||
Looking good on try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=d5ba4d07cbbac64cbd0d29008fe15d1ed9b277b7&group_state=expanded
Assignee | ||
Comment 7•7 years ago
|
||
Comment on attachment 8868409 [details] [diff] [review] patch, v1. Hi baku, I've no idea who to ask for a review, maybe you can help? Thanks.
Attachment #8868409 -
Flags: review?(amarchesini)
Assignee | ||
Comment 8•7 years ago
|
||
Hmm, I can reproduce this on Windows 10 as well, and I can't find a suitable Windows API for this, we can only get one extension for MIME type from "HKEY_CLASSES_ROOT\MIME\Database\Content Type". It looks like Chrome has two hard coded mapping lists that it adds to the OS extension list. [1] https://cs.chromium.org/chromium/src/net/base/mime_util.cc?l=544
Updated•7 years ago
|
Attachment #8868409 -
Flags: review?(amarchesini) → review+
Assignee | ||
Comment 9•7 years ago
|
||
Thanks baku. Let's fix this for macOS first and file a separate bug to consider whether we should have a hard-coded list.
Assignee | ||
Comment 10•7 years ago
|
||
Added reviewer's name, carrying r+.
Attachment #8868409 -
Attachment is obsolete: true
Attachment #8868948 -
Flags: review+
Assignee | ||
Comment 11•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=ed6dbc237f8f60a8bf5cb0be458e4cbe17b5016f&group_state=expanded
Keywords: checkin-needed
Comment 12•7 years ago
|
||
Pushed by ihsiao@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/2acee92959cb Get all extensions for a MIME type and not just the preferred one (macOS). r=baku
Keywords: checkin-needed
Comment 13•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2acee92959cb
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Updated•7 years ago
|
OS: Unspecified → Mac OS X
Summary: File Input with `accept="image/jpeg"` does not accept .jpeg → File Input with `accept="image/jpeg"` does not accept .jpeg on macOS
You need to log in
before you can comment on or make changes to this bug.
Description
•