Bug 1463133 - Remove unnecessary MIME preludes. r=mkmelin a=jorgk
authorJorg K <jorgk@jorgk.com>
Wed, 23 May 2018 00:07:52 +0200
changeset 28242 ff980b7a7ae7ecd88bbe7b1641a566a67d0c6e5e
parent 28241 25c3e70855eb4943af097c66517b6a70f9118679
child 28243 2f0222c3f952d52997e0c94d0262b2b430d399be
push id2087
push usermozilla@jorgk.com
push dateFri, 29 Jun 2018 15:47:48 +0000
treeherdercomm-esr52@3d3f118c29a2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, jorgk
bugs1463133
Bug 1463133 - Remove unnecessary MIME preludes. r=mkmelin a=jorgk
mailnews/mime/src/mimeTextHTMLParsed.cpp
mailnews/mime/src/mimethsa.cpp
--- a/mailnews/mime/src/mimeTextHTMLParsed.cpp
+++ b/mailnews/mime/src/mimeTextHTMLParsed.cpp
@@ -56,40 +56,16 @@ static int
 MimeInlineTextHTMLParsed_parse_begin(MimeObject *obj)
 {
   MimeInlineTextHTMLParsed *me = (MimeInlineTextHTMLParsed *)obj;
   me->complete_buffer = new nsString();
   int status = ((MimeObjectClass*)&MIME_SUPERCLASS)->parse_begin(obj);
   if (status < 0)
     return status;
 
-  // Dump the charset we get from the mime headers into a HTML <meta http-equiv>.
-  char *content_type = obj->headers ?
-    MimeHeaders_get(obj->headers, HEADER_CONTENT_TYPE, false, false) : 0;
-  if (content_type)
-  {
-    char* charset = MimeHeaders_get_parameter(content_type,
-                                              HEADER_PARM_CHARSET,
-                                              NULL, NULL);
-    PR_Free(content_type);
-    if (charset)
-    {
-      nsAutoCString charsetline(
-        "\n<meta http-equiv=\"content-type\" content=\"text/html; charset=");
-      charsetline += charset;
-      charsetline += "\">\n";
-      int status = MimeObject_write(obj,
-                                    charsetline.get(),
-                                    charsetline.Length(),
-                                    true);
-      PR_Free(charset);
-      if (status < 0)
-        return status;
-    }
-  }
   return 0;
 }
 
 static int
 MimeInlineTextHTMLParsed_parse_eof(MimeObject *obj, bool abort_p)
 {
 
   if (obj->closed_p)
--- a/mailnews/mime/src/mimethsa.cpp
+++ b/mailnews/mime/src/mimethsa.cpp
@@ -62,40 +62,16 @@ static int
 MimeInlineTextHTMLSanitized_parse_begin(MimeObject *obj)
 {
   MimeInlineTextHTMLSanitized *me = (MimeInlineTextHTMLSanitized *)obj;
   me->complete_buffer = new nsString();
   int status = ((MimeObjectClass*)&MIME_SUPERCLASS)->parse_begin(obj);
   if (status < 0)
     return status;
 
-  // Dump the charset we get from the mime headers into a HTML <meta http-equiv>.
-  char *content_type = obj->headers ?
-    MimeHeaders_get(obj->headers, HEADER_CONTENT_TYPE, false, false) : 0;
-  if (content_type)
-  {
-    char* charset = MimeHeaders_get_parameter(content_type,
-                                              HEADER_PARM_CHARSET,
-                                              NULL, NULL);
-    PR_Free(content_type);
-    if (charset)
-    {
-      nsAutoCString charsetline(
-        "\n<meta http-equiv=\"content-type\" content=\"text/html; charset=");
-      charsetline += charset;
-      charsetline += "\">\n";
-      int status = MimeObject_write(obj,
-                                    charsetline.get(),
-                                    charsetline.Length(),
-                                    true);
-      PR_Free(charset);
-      if (status < 0)
-        return status;
-    }
-  }
   return 0;
 }
 
 static int
 MimeInlineTextHTMLSanitized_parse_eof(MimeObject *obj, bool abort_p)
 {
   if (obj->closed_p)
     return 0;