Always set the Document::contentType attribute in ScriptThread::load().

There's no good reason to limit this to a few particular content types.
This commit is contained in:
Ms2ger 2017-01-27 12:33:20 +01:00 committed by Anthony Ramine
parent c853337d64
commit 69e3173047
7 changed files with 3 additions and 39 deletions

View file

@ -1718,15 +1718,9 @@ impl ScriptThread {
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()));