servo: Merge #15264 - Always set the Document::contentType attribute in ScriptThread::load() (from servo:content-type); r=nox
authorMs2ger <Ms2ger@gmail.com>
Mon, 30 Jan 2017 05:33:14 -0800
changeset 340691 271c3517a866a25ed09d91e840039f09b0c44102
parent 340690 5f5a2bb6758111731926fc18bcdb53978a741cb5
child 340692 da159b43518982c0910b4408573f03dbcf361096
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnox
servo: Merge #15264 - Always set the Document::contentType attribute in ScriptThread::load() (from servo:content-type); r=nox Source-Repo: https://github.com/servo/servo Source-Revision: cc2011c05037a8f261f2e803b8a3fb58178ab1b9
servo/components/script/script_thread.rs
--- a/servo/components/script/script_thread.rs
+++ b/servo/components/script/script_thread.rs
@@ -1705,25 +1705,19 @@ impl ScriptThread {
                 window.init_browsing_context(browsing_context);
             },
         }
 
         let last_modified = metadata.headers.as_ref().and_then(|headers| {
             headers.get().map(|&LastModified(HttpDate(ref tm))| dom_last_modified(tm))
         });
 
-        let content_type = metadata.content_type.as_ref().and_then(|&Serde(ContentType(ref mimetype))| {
-            match *mimetype {
-                Mime(TopLevel::Application, SubLevel::Xml, _) |
-                Mime(TopLevel::Application, SubLevel::Ext(_), _) |
-                Mime(TopLevel::Text, SubLevel::Xml, _) |
-                Mime(TopLevel::Text, SubLevel::Plain, _) => Some(DOMString::from(mimetype.to_string())),
-                _ => None,
-            }
-        });
+        let content_type = metadata.content_type
+                                   .as_ref()
+                                   .map(|&Serde(ContentType(ref mimetype))| DOMString::from(mimetype.to_string()));
 
         let loader = DocumentLoader::new_with_threads(self.resource_threads.clone(),
                                                       Some(final_url.clone()));
 
         let is_html_document = match metadata.content_type {
             Some(Serde(ContentType(Mime(TopLevel::Application, SubLevel::Ext(ref sub_level), _))))
                 if sub_level.ends_with("+xml") => IsHTMLDocument::NonHTMLDocument,