Changeset 67375 in webkit
- Timestamp:
- Sep 13, 2010 3:15:35 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r67373 r67375 1 2010-09-13 Andreas Kling <andreas.kling@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Don't add empty strings to list of supported image MIME types 6 https://bugs.webkit.org/show_bug.cgi?id=45643 7 8 After <http://trac.webkit.org/changeset/67355> getMIMETypeForExtension() 9 returns an empty string instead of "application/octet-stream" for unsupported 10 extensions. Don't add these to the list of supported types, and clean out 11 the logic that removed "application/octet-stream" from supported types. 12 13 Fixes crash in initializeMIMETypeRegistry() due to inserting String() into 14 a HashSet<String>. 15 16 * platform/MIMETypeRegistry.cpp: 17 (WebCore::initializeSupportedImageMIMETypes): 18 (WebCore::initializeSupportedImageMIMETypesForEncoding): 19 1 20 2010-09-13 Adam Barth <abarth@webkit.org> 2 21 -
trunk/WebCore/platform/MIMETypeRegistry.cpp
r66313 r67375 103 103 #endif 104 104 String mimeType = MIMETypeRegistry::getMIMETypeForExtension(formats.at(i).constData()); 105 supportedImageMIMETypes->add(mimeType); 106 supportedImageResourceMIMETypes->add(mimeType); 107 } 108 109 supportedImageMIMETypes->remove("application/octet-stream"); 110 supportedImageResourceMIMETypes->remove("application/octet-stream"); 105 if (!mimeType.isEmpty()) { 106 supportedImageMIMETypes->add(mimeType); 107 supportedImageResourceMIMETypes->add(mimeType); 108 } 109 } 111 110 #else 112 111 // assume that all implementations at least support the following standard … … 153 152 for (int i = 0; i < formats.size(); ++i) { 154 153 String mimeType = MIMETypeRegistry::getMIMETypeForExtension(formats.at(i).constData()); 155 supportedImageMIMETypesForEncoding->add(mimeType); 156 } 157 158 supportedImageMIMETypesForEncoding->remove("application/octet-stream"); 154 if (!mimeType.isEmpty()) 155 supportedImageMIMETypesForEncoding->add(mimeType); 156 } 159 157 #elif PLATFORM(GTK) 160 158 supportedImageMIMETypesForEncoding->add("image/png");
Note: See TracChangeset
for help on using the changeset viewer.