Changeset 230847 in webkit
- Timestamp:
- Apr 20, 2018 12:39:52 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r230837 r230847 1 2018-04-20 Daniel Bates <dabates@apple.com> 2 3 Unreviewed, rolling out r230117. 4 5 Broke find-in-page for PDFs 6 7 Reverted changeset: 8 9 "ASSERTION FAILED: ASSERT(!containsImage || 10 MIMETypeRegistry::isSupportedImageResourceMIMEType([resource 11 MIMEType])) in -[NSPasteboard(WebExtras) 12 _web_writePromisedRTFDFromArchive:containsImage:]" 13 https://bugs.webkit.org/show_bug.cgi?id=184161 14 https://trac.webkit.org/changeset/230117 15 1 16 2018-04-20 Carlos Garcia Campos <cgarcia@igalia.com> 2 17 -
trunk/Source/WebCore/ChangeLog
r230846 r230847 1 2018-04-20 Daniel Bates <dabates@apple.com> 2 3 Unreviewed, rolling out r230117. 4 5 Broke find-in-page for PDFs 6 7 Reverted changeset: 8 9 "ASSERTION FAILED: ASSERT(!containsImage || 10 MIMETypeRegistry::isSupportedImageResourceMIMEType([resource 11 MIMEType])) in -[NSPasteboard(WebExtras) 12 _web_writePromisedRTFDFromArchive:containsImage:]" 13 https://bugs.webkit.org/show_bug.cgi?id=184161 14 https://trac.webkit.org/changeset/230117 15 1 16 2018-04-20 Eric Carlson <eric.carlson@apple.com> 2 17 -
trunk/Source/WebCore/dom/DOMImplementation.cpp
r230211 r230847 150 150 151 151 // If we want to useImageDocumentForSubframePDF, we'll let that override plugin support. 152 if (frame && !frame->isMainFrame() && MIMETypeRegistry::isPDFMIMEType(type) && frame->settings().useImageDocumentForSubframePDF()) { 153 ASSERT(Image::supportsType(type)); 152 if (frame && !frame->isMainFrame() && MIMETypeRegistry::isPDFMIMEType(type) && frame->settings().useImageDocumentForSubframePDF()) 154 153 return ImageDocument::create(*frame, url); 155 }156 154 157 155 PluginData* pluginData = nullptr; -
trunk/Source/WebCore/platform/MIMETypeRegistry.cpp
r230117 r230847 56 56 namespace WebCore { 57 57 58 static HashSet<String, ASCIICaseInsensitiveHash>* supportedImageResourceMIMETypes; 58 59 static HashSet<String, ASCIICaseInsensitiveHash>* supportedImageMIMETypes; 59 60 static HashSet<String, ASCIICaseInsensitiveHash>* supportedImageMIMETypesForEncoding; … … 66 67 static void initializeSupportedImageMIMETypes() 67 68 { 69 supportedImageResourceMIMETypes = new HashSet<String, ASCIICaseInsensitiveHash>; 68 70 supportedImageMIMETypes = new HashSet<String, ASCIICaseInsensitiveHash>; 69 71 … … 71 73 // This represents the subset of allowed image UTIs for which CoreServices has a corresponding MIME type. Keep this in sync with allowedImageUTIs(). 72 74 static const char* const allowedImageMIMETypes[] = { "image/tiff", "image/gif", "image/jpeg", "image/vnd.microsoft.icon", "image/jp2", "image/png", "image/bmp" }; 73 for (auto& mimeType : allowedImageMIMETypes) 75 for (auto& mimeType : allowedImageMIMETypes) { 74 76 supportedImageMIMETypes->add(ASCIILiteral { mimeType }); 77 supportedImageResourceMIMETypes->add(ASCIILiteral { mimeType }); 78 } 75 79 76 80 #ifndef NDEBUG 77 81 for (auto& uti : allowedImageUTIs()) { 78 82 auto mimeType = MIMETypeForImageSourceType(uti); 79 if (!mimeType.isEmpty()) 83 if (!mimeType.isEmpty()) { 80 84 ASSERT(supportedImageMIMETypes->contains(mimeType)); 85 ASSERT(supportedImageResourceMIMETypes->contains(mimeType)); 86 } 81 87 } 82 88 … … 89 95 // Favicons don't have a MIME type in the registry either. 90 96 supportedImageMIMETypes->add("image/x-icon"); 97 supportedImageResourceMIMETypes->add("image/x-icon"); 91 98 92 99 // We only get one MIME type per UTI, hence our need to add these manually 93 100 supportedImageMIMETypes->add("image/pjpeg"); 101 supportedImageResourceMIMETypes->add("image/pjpeg"); 94 102 95 103 #if PLATFORM(IOS) … … 115 123 "application/bmp", "application/x-bmp", "application/x-win-bitmap", 116 124 }; 117 for (auto& type : malformedMIMETypes) 125 for (auto& type : malformedMIMETypes) { 118 126 supportedImageMIMETypes->add(type); 127 supportedImageResourceMIMETypes->add(type); 128 } 119 129 #endif 120 130 … … 131 141 "image/x-xbitmap" // xbm 132 142 }; 133 for (auto& type : types) 143 for (auto& type : types) { 134 144 supportedImageMIMETypes->add(type); 145 supportedImageResourceMIMETypes->add(type); 146 } 135 147 136 148 #if USE(WEBP) 137 149 supportedImageMIMETypes->add("image/webp"); 150 supportedImageResourceMIMETypes->add("image/webp"); 138 151 #endif 139 152 … … 451 464 bool MIMETypeRegistry::isSupportedImageResourceMIMEType(const String& mimeType) 452 465 { 453 return isSupportedImageMIMEType(mimeType) || isPDFOrPostScriptMIMEType(mimeType); 466 if (mimeType.isEmpty()) 467 return false; 468 if (!supportedImageResourceMIMETypes) 469 initializeSupportedImageMIMETypes(); 470 return supportedImageResourceMIMETypes->contains(getNormalizedMIMEType(mimeType)); 454 471 } 455 472 … … 640 657 initializeSupportedImageMIMETypes(); 641 658 return *supportedImageMIMETypes; 659 } 660 661 const HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::getSupportedImageResourceMIMETypes() 662 { 663 if (!supportedImageResourceMIMETypes) 664 initializeSupportedImageMIMETypes(); 665 return *supportedImageResourceMIMETypes; 642 666 } 643 667 -
trunk/Source/WebCore/platform/MIMETypeRegistry.h
r230117 r230847 110 110 111 111 WEBCORE_EXPORT const static HashSet<String, ASCIICaseInsensitiveHash>& getSupportedImageMIMETypes(); 112 const static HashSet<String, ASCIICaseInsensitiveHash>& getSupportedImageResourceMIMETypes(); 112 113 WEBCORE_EXPORT const static HashSet<String, ASCIICaseInsensitiveHash>& getSupportedMediaMIMETypes(); 113 114 WEBCORE_EXPORT const static HashSet<String, ASCIICaseInsensitiveHash>& getPDFMIMETypes();
Note: See TracChangeset
for help on using the changeset viewer.