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)) 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))| { let content_type = metadata.content_type
match *mimetype { .as_ref()
Mime(TopLevel::Application, SubLevel::Xml, _) | .map(|&Serde(ContentType(ref mimetype))| DOMString::from(mimetype.to_string()));
Mime(TopLevel::Application, SubLevel::Ext(_), _) |
Mime(TopLevel::Text, SubLevel::Xml, _) |
Mime(TopLevel::Text, SubLevel::Plain, _) => Some(DOMString::from(mimetype.to_string())),
_ => None,
}
});
let loader = DocumentLoader::new_with_threads(self.resource_threads.clone(), let loader = DocumentLoader::new_with_threads(self.resource_threads.clone(),
Some(final_url.clone())); Some(final_url.clone()));

View file

@ -1,5 +0,0 @@
[contenttype_bmp.html]
type: testharness
[BMP document.contentType === 'image/bmp']
expected: FAIL

View file

@ -1,5 +0,0 @@
[contenttype_css.html]
type: testharness
[CSS document.contentType === 'text/css']
expected: FAIL

View file

@ -1,5 +0,0 @@
[contenttype_gif.html]
type: testharness
[GIF document.contentType === 'image/gif']
expected: FAIL

View file

@ -1,5 +0,0 @@
[contenttype_jpg.html]
type: testharness
[JPG document.contentType === 'image/jpeg']
expected: FAIL

View file

@ -1,5 +0,0 @@
[contenttype_png.html]
type: testharness
[PNG document.contentType === 'image/png']
expected: FAIL

View file

@ -1,5 +0,0 @@
[pageload-image.html]
type: testharness
[The document for a standalone media file should have one child in the body.]
expected: FAIL