Bug 899519 - Use "description" instead of "mime type name" for filter name for accept attribute. r=mounir,bz

This commit is contained in:
Arnaud Bienner 2013-08-05 12:18:08 +01:00
parent 8c1d091b8e
commit c74a371a66

View File

@ -6025,10 +6025,14 @@ HTMLInputElement::SetFilePickerFiltersFromAccept(nsIFilePicker* filePicker)
continue;
}
// Get mime type name
nsCString mimeTypeName;
mimeInfo->GetType(mimeTypeName);
CopyUTF8toUTF16(mimeTypeName, filterName);
// Get a name for the filter: first try the description, then the mime type
// name if there is no description
mimeInfo->GetDescription(filterName);
if (filterName.IsEmpty()) {
nsCString mimeTypeName;
mimeInfo->GetType(mimeTypeName);
CopyUTF8toUTF16(mimeTypeName, filterName);
}
// Get extension list
nsCOMPtr<nsIUTF8StringEnumerator> extensions;