Bug 209637 - Add support for application/vnd.wap.xhtml+xml. r=bz a=gchang
authorMichael Kaply <mozilla@kaply.com>
Wed, 28 Sep 2016 09:48:17 -0500
changeset 359090 b89d16ac356bb9ecbee401a145b583c1289a2f15
parent 359089 f51416ce7c801f9561098e079681e09b9b3c970e
child 359091 73a35ef26a49c06a7857718d934558521a5d2103
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, gchang
bugs209637
milestone51.0
Bug 209637 - Add support for application/vnd.wap.xhtml+xml. r=bz a=gchang
dom/html/nsHTMLDocument.cpp
layout/build/nsContentDLF.cpp
layout/build/nsContentDLF.h
netwerk/mime/nsMimeTypes.h
parser/htmlparser/CParserContext.cpp
--- a/dom/html/nsHTMLDocument.cpp
+++ b/dom/html/nsHTMLDocument.cpp
@@ -537,17 +537,17 @@ nsHTMLDocument::StartDocumentLoad(const 
   bool asData = !strcmp(aCommand, kLoadAsData);
   bool import = !strcmp(aCommand, "import");
   if (!(view || viewSource || asData || import)) {
     MOZ_ASSERT(false, "Bad parser command");
     return NS_ERROR_INVALID_ARG;
   }
 
   bool html = contentType.EqualsLiteral(TEXT_HTML);
-  bool xhtml = !html && contentType.EqualsLiteral(APPLICATION_XHTML_XML);
+  bool xhtml = !html && (contentType.EqualsLiteral(APPLICATION_XHTML_XML) || contentType.EqualsLiteral(APPLICATION_WAPXHTML_XML));
   bool plainText = !html && !xhtml && nsContentUtils::IsPlainTextType(contentType);
   if (!(html || xhtml || plainText || viewSource)) {
     MOZ_ASSERT(false, "Channel with bad content type.");
     return NS_ERROR_INVALID_ARG;
   }
 
   bool loadAsHtml5 = true;
 
--- a/layout/build/nsContentDLF.cpp
+++ b/layout/build/nsContentDLF.cpp
@@ -47,16 +47,17 @@ static NS_DEFINE_IID(kImageDocumentCID, 
 static NS_DEFINE_IID(kXULDocumentCID, NS_XULDOCUMENT_CID);
 
 already_AddRefed<nsIContentViewer> NS_NewContentViewer();
 
 static const char* const gHTMLTypes[] = {
   TEXT_HTML,
   VIEWSOURCE_CONTENT_TYPE,
   APPLICATION_XHTML_XML,
+  APPLICATION_WAPXHTML_XML,
   0
 };
   
 static const char* const gXMLTypes[] = {
   TEXT_XML,
   APPLICATION_XML,
   APPLICATION_MATHML_XML,
   APPLICATION_RDF_XML,
--- a/layout/build/nsContentDLF.h
+++ b/layout/build/nsContentDLF.h
@@ -80,13 +80,14 @@ NS_NewContentDocumentLoaderFactory(nsIDo
     { "Gecko-Content-Viewers", APPLICATION_RDF_XML, "@mozilla.org/content/document-loader-factory;1" }, \
     { "Gecko-Content-Viewers", TEXT_RDF, "@mozilla.org/content/document-loader-factory;1" }, \
     { "Gecko-Content-Viewers", TEXT_XUL, "@mozilla.org/content/document-loader-factory;1" }, \
     { "Gecko-Content-Viewers", APPLICATION_CACHED_XUL, "@mozilla.org/content/document-loader-factory;1" }, \
     { "Gecko-Content-Viewers", VIEWSOURCE_CONTENT_TYPE, "@mozilla.org/content/document-loader-factory;1" }, \
     { "Gecko-Content-Viewers", IMAGE_SVG_XML, "@mozilla.org/content/document-loader-factory;1" }, \
     { "Gecko-Content-Viewers", APPLICATION_MATHML_XML, "@mozilla.org/content/document-loader-factory;1" }, \
     { "Gecko-Content-Viewers", TEXT_VTT, "@mozilla.org/content/document-loader-factory;1" }, \
+    { "Gecko-Content-Viewers", APPLICATION_WAPXHTML_XML, "@mozilla.org/content/document-loader-factory;1" }, \
     CONTENTDLF_WEBM_CATEGORIES
 
 
 #endif
 
--- a/netwerk/mime/nsMimeTypes.h
+++ b/netwerk/mime/nsMimeTypes.h
@@ -68,16 +68,17 @@
 #define APPLICATION_WEB_MANIFEST            "application/manifest+json"
 #define APPLICATION_XMARIMBA                "application/x-marimba"
 #define APPLICATION_XPINSTALL               "application/x-xpinstall"
 #define APPLICATION_XML                     "application/xml"
 #define APPLICATION_XHTML_XML               "application/xhtml+xml"
 #define APPLICATION_XSLT_XML                "application/xslt+xml"
 #define APPLICATION_MATHML_XML              "application/mathml+xml"
 #define APPLICATION_RDF_XML                 "application/rdf+xml"
+#define APPLICATION_WAPXHTML_XML            "application/vnd.wap.xhtml+xml"
 #define APPLICATION_PACKAGE                 "application/package"
 
 #define AUDIO_BASIC                         "audio/basic"
 #define AUDIO_OGG                           "audio/ogg"
 #define AUDIO_WAV                           "audio/x-wav"
 #define AUDIO_WEBM                          "audio/webm"
 #define AUDIO_MP3                           "audio/mpeg"
 #define AUDIO_MP4                           "audio/mp4"
--- a/parser/htmlparser/CParserContext.cpp
+++ b/parser/htmlparser/CParserContext.cpp
@@ -53,16 +53,17 @@ CParserContext::SetMimeType(const nsACSt
     mDocType = eHTML_Strict;
   else if (mMimeType.EqualsLiteral(TEXT_XML)              ||
            mMimeType.EqualsLiteral(APPLICATION_XML)       ||
            mMimeType.EqualsLiteral(APPLICATION_XHTML_XML) ||
            mMimeType.EqualsLiteral(TEXT_XUL)              ||
            mMimeType.EqualsLiteral(IMAGE_SVG_XML)         ||
            mMimeType.EqualsLiteral(APPLICATION_MATHML_XML) ||
            mMimeType.EqualsLiteral(APPLICATION_RDF_XML)   ||
+           mMimeType.EqualsLiteral(APPLICATION_WAPXHTML_XML) ||
            mMimeType.EqualsLiteral(TEXT_RDF))
     mDocType = eXML;
 }
 
 nsresult
 CParserContext::GetTokenizer(nsIDTD* aDTD,
                              nsIContentSink* aSink,
                              nsITokenizer*& aTokenizer)