Changeset 24869 in webkit
- Timestamp:
- Aug 4, 2007 7:06:22 PM (17 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r24866 r24869 1 2007-08-04 David Kilzer <ddkilzer@webkit.org> 2 3 Reviewed by Oliver. 4 5 - fix for http://bugs.webkit.org/show_bug.cgi?id=14882 6 <rdar://problem/5386550> REGRESSION (r24866): text/plain documents are always downloaded 7 8 The supportedNonImageMimeTypes list is used to determine which MIME types may be viewed 9 within the web browser (e.g., plug-ins add their own MIME types to the list during 10 initialization), so we must add "text/plain" and "text/" back to the list. Since 11 this change would then break DOMImplementation::isTextMIMEType(), that method was reverted 12 to its original form and MIMETypeRegistry::shouldTreatAsText() was removed. 13 14 * dom/DOMImplementation.cpp: 15 (WebCore::DOMImplementation::isTextMIMEType): Revert to previous version. 16 * platform/MIMETypeRegistry.cpp: 17 (WebCore::initialiseSupportedNonImageMimeTypes): Added back "text/plain" and "text/" to the list. 18 (WebCore::MIMETypeRegistry::shouldTreatAsText): Removed. 19 * platform/MIMETypeRegistry.h: 20 1 21 2007-08-03 Brady Eidson <beidson@apple.com> 2 22 -
trunk/WebCore/dom/DOMImplementation.cpp
r24866 r24869 38 38 #include "ImageDocument.h" 39 39 #include "MediaList.h" 40 #include "MIMETypeRegistry.h"41 40 #include "Page.h" 42 41 #include "PluginDocument.h" … … 331 330 bool DOMImplementation::isTextMIMEType(const String& mimeType) 332 331 { 333 return MIMETypeRegistry::shouldTreatAsText(mimeType); 332 if (mimeType == "application/x-javascript" || 333 (mimeType.startsWith("text/") && mimeType != "text/html" && 334 mimeType != "text/xml" && mimeType != "text/xsl")) 335 return true; 336 337 return false; 334 338 } 335 339 -
trunk/WebCore/platform/MIMETypeRegistry.cpp
r24866 r24869 113 113 "text/xml", 114 114 "text/xsl", 115 "text/plain", 116 "text/", 115 117 "application/x-javascript", 116 118 "application/xml", … … 185 187 } 186 188 187 bool MIMETypeRegistry::shouldTreatAsText(const String& mimeType)188 {189 return mimeType == "application/x-javascript" || (mimeType.startsWith("text/") && !isSupportedNonImageMIMEType(mimeType));190 }191 192 189 HashSet<String> &MIMETypeRegistry::getSupportedImageMIMETypes() 193 190 { -
trunk/WebCore/platform/MIMETypeRegistry.h
r24866 r24869 56 56 static bool isJavaAppletMIMEType(const String& mimeType); 57 57 58 // Check to see if a mime type should be treated as text59 // application/javascript is one that should be even though it doesn't start with text/60 // text/html is one that *shouldn't* be by default even though it *does* start with text/61 static bool shouldTreatAsText(const String& mimeType);62 63 58 static HashSet<String>& getSupportedImageMIMETypes(); 64 59 static HashSet<String>& getSupportedImageResourceMIMETypes();
Note: See TracChangeset
for help on using the changeset viewer.