Closed Bug 643576 Opened 9 years ago Closed 9 years ago

<input accept="{image,audio,video}/*"> does not work on MacOS X

Categories

(Core :: Widget: Cocoa, defect)

All
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla5

People

(Reporter: khuey, Assigned: mounir)

References

()

Details

Attachments

(2 files, 1 obsolete file)

See URL.

I'm guessing this is a bug in the Mac widget code, since this works on Linux and Windows.
I looked at that bug today between two glasses of champagne... I've been able to fix it locally. I will clean the patch a bit and attach the patch later this week.

FWIW, the reason of the bug is that MacOS X do not let the users to choose between different filters so the current implementations add all filters to the filtering list and if one of the filter is "*", it will not filter. And we actually add "*" and all images types when we try to filter with accept="image/*". BTW, this bug applies to audio/* and video/*.
Assignee: nobody → mounir.lamouri
Status: NEW → ASSIGNED
Hardware: x86 → All
Summary: <input accept="image/*"> does not work on Mac → <input accept="{image,audio,video}/*"> does not work on MacOS X
Version: unspecified → Trunk
Attachment #521252 - Flags: review?(joshmoz)
Whiteboard: [needs review]
Comment on attachment 521252 [details] [diff] [review]
Rewrite nsFilePicker::GenerateFilterList

>+  // On MacOS X, you can only use one filter type.
>+  if (mFilters.Length() <= (PRUint32)mSelectedTypeIndex) {
>+    return nil;
>+  }

This comment is confusing, just delete it.

I applied this patch and ran the resulting build. Now if I try to open a file by opening the browser and hitting cmd-o I can hardly select anything, not even HTML files. Seems like only text documents with no extension are selectable. Without this patch I can select just about anything. We can't have this behavioral regression, something else is wrong.
Attachment #521252 - Flags: review?(joshmoz) → review-
Attached patch Inter diffSplinter Review
Actually, my patch had a minor issue... :)
Attachment #521252 - Attachment is obsolete: true
Attachment #523324 - Flags: review?(joshmoz)
Follow up to change the filter: bug 646854.
Attachment #523324 - Flags: review?(joshmoz) → review+
Pushed:
http://hg.mozilla.org/mozilla-central/rev/373dd35f5f33
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Flags: in-litmus?
Resolution: --- → FIXED
Whiteboard: [needs review]
Target Milestone: --- → mozilla2.2
Depends on: 662261
You need to log in before you can comment on or make changes to this bug.