Closed Bug 1619154 Opened 4 years ago Closed 4 years ago

.webp not listed when accept="image/*"

Categories

(Core :: DOM: Core & HTML, defect, P3)

73 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: asia, Assigned: michael.katilevsky)

References

Details

(Keywords: good-first-bug)

Attachments

(2 files)

Attached image 1.PNG

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0

Steps to reproduce:

I opened a HTML page with:
<input type="file" accept="image/*" />
While the file picker opened, no '.webp' files listed.

Actual results:

No '.webp' extension files listed.

Expected results:

Have .webp file listed.

Another BUG: https://bugzilla.mozilla.org/show_bug.cgi?id=1619153
.jpeg not listed when accept="image/jpeg"

Component: Untriaged → DOM: Core & HTML
Depends on: 1366645
Product: Firefox → Core
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: good-first-bug
Priority: -- → P3
See Also: → 1619197
No longer depends on: 1366645

Indeed it's only a matter of adding the extension to that list, you're right: image/* video/* and audio/* have hardcoded extension list, unlike generic mime type, for which the logic is more complex, and involves an hardcoded list and information retrieved from the OS.

I'm fine implementing the change but I'm not sure however who should review it. Probably Peter since he is the module of dom/* according to 1?
Note the file is located in toolkit/content but it is actually used in dom/html/HTMLInputElement.cpp 2

Depends on: 1366645
Flags: needinfo?(peterv)

Maybe Mounir could review the change as well since he originally worked on this, but I'm not sure if he is still working on this Firefox those days?

Flags: needinfo?(mounir)
No longer depends on: 1366645

Hi! I noticed there is no assignee for this bug, and I would love to fix it as my first bug contribution! Would it be possible to assign me to this bug? Thanks a lot!

Assignee: nobody → michael.katilevsky
Status: NEW → ASSIGNED

Hi! I was able to replicate the bug and believe to have applied a fix. Here are screenshots demonstrating the before and after behavior of the functionality in question:

Before fix, no .webp files could be selected: <br>
![Before](https://i.imgur.com/8NZQf1c.png =450x)

After fix, .webp files can now be uploaded: <br>
![After](https://i.imgur.com/mQWRCZG.png =450x)

I submitted a fix for the bug, I am however not sure whom to set as reviewer(s) for the patch. Please let me know if there is someone I could set as reviewer, if necessary!

Best

(In reply to Michael from comment #7)

I submitted a fix for the bug,

Thank you.

I am however not sure whom to set as reviewer(s) for the patch. Please let me know if there is someone I could set as reviewer, if necessary!

In general, the way this is supposed to work is that you match the code you are changing to the module list at https://wiki.mozilla.org/Modules/All . However, as comment 3 points out, this file is actually used by DOM code rather than Toolkit code, so a DOM peer review should be enough. I've reviewed the patch.

If the "View Stack in Lando" link on Phabricator doesn't let you land this, I can land this as well.

Flags: needinfo?(peterv)
Flags: needinfo?(mounir)

(In reply to Henri Sivonen (:hsivonen) from comment #8)

In general, the way this is supposed to work is that you match the code you are changing to the module list at https://wiki.mozilla.org/Modules/All . However, as comment 3 points out, this file is actually used by DOM code rather than Toolkit code, so a DOM peer review should be enough. I've reviewed the patch.

I see, thank you very much for the info - and for the revision!

If the "View Stack in Lando" link on Phabricator doesn't let you land this, I can land this as well.

Unfortunately I do not have Level 3 Commit Access, so I am unable to land this; I would really appreciate it if you could land this instead! Thanks a lot for your time :)

I think you should be able to set the "Check-in Needed" tag in "Edit Revision". To expedite the process I just triggered lando myself.

Pushed by evilpies@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/02ef6cee073c
Added .webp to supported image file types so that it is possible to upload .webp files. r=hsivonen

Backed out for mochitest failures on test_input_file_picker.html.

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&selectedJob=293591231&resultStatus=testfailed%2Cbusted%2Cexception&searchStr=android%2C7.0%2Cx86-64%2Copt%2Cmochitests%2Ctest-android-em-7.0-x86_64%2Fopt-geckoview-mochitest-plain-e10s-3%2Cm%283%29&revision=02ef6cee073c21acd233267f620e0556e5d36906

Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=293591231&repo=autoland

Backout link: https://hg.mozilla.org/integration/autoland/rev/70f8ce3e2d394a8c4d08725b108003844abbbff9

[task 2020-03-18T00:31:34.281Z] 00:31:34 INFO - 304 INFO TEST-PASS | dom/html/test/forms/test_input_file_picker.html | filterAll is missing (d)
[task 2020-03-18T00:31:34.281Z] 00:31:34 INFO - Buffered messages finished
[task 2020-03-18T00:31:34.281Z] 00:31:34 WARNING - 305 INFO TEST-UNEXPECTED-FAIL | dom/html/test/forms/test_input_file_picker.html | Correct filters should have been added (d) - got "*.jpe; *.jpg; *.jpeg; *.gif; *.png; *.bmp; *.ico; *.svg; *.svgz; *.tif; *.tiff; *.ai; *.drw; *.pct; *.psp; *.xcf; *.psd; *.raw; *.webp; *.aac; *.aif; *.flac; *.iff; *.m4a; *.m4b; *.mid; *.midi; *.mp3; *.mpa; *.mpc; *.oga; *.ogg; *.ra; *.ram; *.snd; *.wav; .wma", expected ".jpe; *.jpg; *.jpeg; *.gif; *.png; *.bmp; *.ico; *.svg; *.svgz; *.tif; *.tiff; *.ai; *.drw; *.pct; *.psp; *.xcf; *.psd; *.raw; *.aac; *.aif; *.flac; *.iff; *.m4a; *.m4b; *.mid; *.midi; *.mp3; *.mpa; *.mpc; *.oga; *.ogg; *.ra; *.ram; *.snd; *.wav; *.wma"
[task 2020-03-18T00:31:34.281Z] 00:31:34 INFO - SimpleTest.is@SimpleTest/SimpleTest.js:383:14
[task 2020-03-18T00:31:34.281Z] 00:31:34 INFO - runTests/MockFilePicker.showCallback/<@dom/html/test/forms/test_input_file_picker.html:249:13
[task 2020-03-18T00:31:34.281Z] 00:31:34 INFO - 306 INFO TEST-PASS | dom/html/test/forms/test_input_file_picker.html | appendFilters not called as often as expected (d)

Flags: needinfo?(michael.katilevsky)

It appears to me that test_input_file_picker.html fails simply because ".webp" was not added as a known file extension in test_input_file_picker.html. I will add ".webp" to test_input_file_picker.html and push a new patch; hopefully that will fix it.

Flags: needinfo?(michael.katilevsky)
Pushed by rgurzau@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e1b78dd147a1
Added .webp to supported image file types so that it is possible to upload .webp files. r=hsivonen
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: