aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-01-30 05:33:14 -0800
committerGitHub <noreply@github.com>2017-01-30 05:33:14 -0800
commitcc2011c05037a8f261f2e803b8a3fb58178ab1b9 (patch)
tree54c78a6336fa373183652d650dc89ba2c4f582a1 /components/script/script_thread.rs
parentb0cf5348b830e51ef76a04c8434ab7b42d5de1ca (diff)
parent69e31730479fbe9afda715f2c146b44562143316 (diff)
downloadservo-cc2011c05037a8f261f2e803b8a3fb58178ab1b9.tar.gz
servo-cc2011c05037a8f261f2e803b8a3fb58178ab1b9.zip
Auto merge of #15264 - servo:content-type, r=nox
Always set the Document::contentType attribute in ScriptThread::load(). <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15264) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r--components/script/script_thread.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index e1e07fd177e..865fd389330 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -1710,15 +1710,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()));