Bug 738952 Make it possible for a stream converter to propagate the actual MIME type to the document r=bz
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Sat, 02 Mar 2013 14:23:20 +0000
changeset 123564 1cd1a9fdf8fba4c777b4cb044cad1641c0186010
parent 123563 7d93ba84ce2f3718173b98978ee5876bd1650e6f
child 123565 fbdbdebeb0dd51c0b949244edef9e38916d27984
push id23920
push userneil@parkwaycc.co.uk
push dateSat, 02 Mar 2013 14:30:50 +0000
treeherdermozilla-inbound@4fa6b9dbe823 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs738952
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 738952 Make it possible for a stream converter to propagate the actual MIME type to the document r=bz
content/base/src/nsDocument.cpp
mach
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -2255,17 +2255,20 @@ nsDocument::StartDocumentLoad(const char
 
   mHaveInputEncoding = true;
 
   if (aReset) {
     Reset(aChannel, aLoadGroup);
   }
 
   nsAutoCString contentType;
-  if (NS_SUCCEEDED(aChannel->GetContentType(contentType))) {
+  nsCOMPtr<nsIPropertyBag2> bag = do_QueryInterface(aChannel);
+  if ((bag && NS_SUCCEEDED(bag->GetPropertyAsACString(
+                NS_LITERAL_STRING("contentType"), contentType))) ||
+      NS_SUCCEEDED(aChannel->GetContentType(contentType))) {
     // XXX this is only necessary for viewsource:
     nsACString::const_iterator start, end, semicolon;
     contentType.BeginReading(start);
     contentType.EndReading(end);
     semicolon = start;
     FindCharInReadable(';', semicolon, end);
     SetContentTypeInternal(Substring(start, semicolon));
   }