Closed Bug 1690845 Opened 4 years ago Closed 4 years ago

File with no extension uses icon for C: drive

Categories

(Core :: Graphics: ImageLib, defect)

Desktop
Windows
defect

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: agashlin, Assigned: tnikkel)

Details

Attachments

(2 files)

Attached image drive icon dialog.png

STR:

  1. Click a link to open a file that will be saved with no extension, example octet-stream just called "test".
  2. In the unknown content type dialog the icon shown will be that for the C: drive itself.
  3. Save the file.
  4. The icon shown in the downloads panel will be the same C: drive icon.

I'm pretty sure it's for the C: drive and not just some default icon, because it shows up differently on different machines, consistent with how C: appears in Explorer (e.g. with BitLocker, across Win 7 and Win 10). Even if the file is saved to an external drive with a different icon, the C: icon is used in both the dialog and the panel.

This isn't new, I found it going back at least to 2018. Sorry if it's already filed but I couldn't find a previous example.

Also note that this is different from the behavior for an unknown extension, which shows a "blank page" icon, probably that's the one we should be using.

Believe it or not, this is moz-icon code and it lives in imagelib.

The problem is that we'll try to create an icon with moz-icon://test?size=16&contentType=application/octet-stream and either the nsIconURI.cpp or the windows implementation of nsIconChannel.cpp does not deal well with the leafname not having an extension.

Component: File Handling → ImageLib
Product: Firefox → Core
Severity: -- → S3

The tests I added pass before and after this patch. I couldn't figure out a way to write a test that failed before.

Assignee: nobody → tnikkel
Status: NEW → ASSIGNED
Pushed by tnikkel@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1ff45a9b57fe Don't ask Windows for the icon of an empty file extension because it returns the c: drive icon, which is not what we want. r=Gijs
Flags: needinfo?(tnikkel)
Pushed by tnikkel@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a63e14d399f7 Don't ask Windows for the icon of an empty file extension because it returns the c: drive icon, which is not what we want. r=Gijs
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: