[QuickLook] Use case-insensitive comparison of preview MIME types
https://bugs.webkit.org/show_bug.cgi?id=175350
<rdar://problem/
33761159>
Reviewed by Brady Eidson.
Source/WebCore:
MIME types are case-insensitive, but PreviewLoader was using a case-sensitive comparison to
determine if a MIME type was supported by QLPreviewConverter. As a result we would fail to
preview Excel macro-enabled workbooks, since CFNetwork would sniff a MIME type of
"application/vnd.ms-excel.sheet.macroEnabled.12" but QuickLook contained
"application/vnd.ms-excel.sheet.macroenabled.12" in its set of supported MIME type strings.
Fix this by copying the QuickLook supported MIME type set into a HashSet using
ASCIICaseInsensitiveHash and using that HashSet for MIME type checks.
Test: quicklook/excel-macro-enabled.html
* loader/ios/PreviewLoader.mm:
(WebCore::PreviewLoader::shouldCreateForMIMEType):
LayoutTests:
* platform/ios-11/quicklook/excel-macro-enabled-expected.txt: Added.
* quicklook/excel-macro-enabled-expected.txt: Added.
* quicklook/excel-macro-enabled.html: Added.
* quicklook/resources/excel-macro-enabled.xlsm: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220456
268f45cc-cd09-0410-ab3c-
d52691b4dbfc