diff --git a/dom/security/nsContentSecurityManager.cpp b/dom/security/nsContentSecurityManager.cpp index f689286d6be5..b92818201e76 100644 --- a/dom/security/nsContentSecurityManager.cpp +++ b/dom/security/nsContentSecurityManager.cpp @@ -112,7 +112,7 @@ bool nsContentSecurityManager::AllowTopLevelNavigationToDataURI( // Allow data: images as long as they are not SVGs if (StringBeginsWith(contentType, "image/"_ns) && - !contentType.EqualsLiteral("image/svg+xml")) { + !contentType.EqualsLiteral(IMAGE_SVG_XML)) { return true; } // Allow all data: PDFs. or JSON documents diff --git a/dom/serializers/nsDocumentEncoder.cpp b/dom/serializers/nsDocumentEncoder.cpp index ea5c6de77e58..c10594820f04 100644 --- a/dom/serializers/nsDocumentEncoder.cpp +++ b/dom/serializers/nsDocumentEncoder.cpp @@ -31,6 +31,7 @@ #include "mozilla/dom/Selection.h" #include "nsContentUtils.h" #include "nsElementTable.h" +#include "nsMimeTypes.h" #include "nsUnicharUtils.h" #include "nsReadableUtils.h" #include "nsTArray.h" @@ -1534,12 +1535,12 @@ nsDocumentEncoder::SetNodeFixup(nsIDocumentEncoderNodeFixup* aFixup) { } bool do_getDocumentTypeSupportedForEncoding(const char* aContentType) { - if (!nsCRT::strcmp(aContentType, "text/xml") || - !nsCRT::strcmp(aContentType, "application/xml") || - !nsCRT::strcmp(aContentType, "application/xhtml+xml") || - !nsCRT::strcmp(aContentType, "image/svg+xml") || - !nsCRT::strcmp(aContentType, "text/html") || - !nsCRT::strcmp(aContentType, "text/plain")) { + if (!nsCRT::strcmp(aContentType, TEXT_XML) || + !nsCRT::strcmp(aContentType, APPLICATION_XML) || + !nsCRT::strcmp(aContentType, APPLICATION_XHTML_XML) || + !nsCRT::strcmp(aContentType, IMAGE_SVG_XML) || + !nsCRT::strcmp(aContentType, TEXT_HTML) || + !nsCRT::strcmp(aContentType, TEXT_PLAIN)) { return true; } return false; diff --git a/gfx/thebes/gfxSVGGlyphs.cpp b/gfx/thebes/gfxSVGGlyphs.cpp index a668f9070337..d1297a33fb50 100644 --- a/gfx/thebes/gfxSVGGlyphs.cpp +++ b/gfx/thebes/gfxSVGGlyphs.cpp @@ -129,7 +129,7 @@ gfxSVGGlyphsDocument* gfxSVGGlyphs::FindOrCreateGlyphsDocument( nsresult gfxSVGGlyphsDocument::SetupPresentation() { nsCOMPtr docLoaderFactory = - nsContentUtils::FindInternalDocumentViewer("image/svg+xml"_ns); + nsContentUtils::FindInternalDocumentViewer(SVG_CONTENT_TYPE); NS_ASSERTION(docLoaderFactory, "Couldn't get DocumentLoaderFactory"); nsCOMPtr viewer; diff --git a/image/imgLoader.cpp b/image/imgLoader.cpp index dc6f412542a2..e94cf0836896 100644 --- a/image/imgLoader.cpp +++ b/image/imgLoader.cpp @@ -2845,7 +2845,7 @@ bool imgLoader::SupportImageWithMimeType(const nsACString& aMimeType, ToLowerCase(mimeType); if (aAccept == AcceptedMimeTypes::IMAGES_AND_DOCUMENTS && - mimeType.EqualsLiteral("image/svg+xml")) { + mimeType.EqualsLiteral(IMAGE_SVG_XML)) { return true; } diff --git a/widget/nsITransferable.idl b/widget/nsITransferable.idl index c6e424d7cb41..9f4df85e6266 100644 --- a/widget/nsITransferable.idl +++ b/widget/nsITransferable.idl @@ -31,6 +31,7 @@ interface nsIReferrerInfo; #define kJPEGImageMime "image/jpeg" #define kJPGImageMime "image/jpg" #define kGIFImageMime "image/gif" +#define kSVGImageMime "image/svg+xml" #define kFileMime "application/x-moz-file" #define kURLMime "text/x-moz-url" // data contains url\ntitle