mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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:
parent
c853337d64
commit
69e3173047
7 changed files with 3 additions and 39 deletions
|
@ -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()));
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[contenttype_bmp.html]
|
|
||||||
type: testharness
|
|
||||||
[BMP document.contentType === 'image/bmp']
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[contenttype_css.html]
|
|
||||||
type: testharness
|
|
||||||
[CSS document.contentType === 'text/css']
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[contenttype_gif.html]
|
|
||||||
type: testharness
|
|
||||||
[GIF document.contentType === 'image/gif']
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[contenttype_jpg.html]
|
|
||||||
type: testharness
|
|
||||||
[JPG document.contentType === 'image/jpeg']
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[contenttype_png.html]
|
|
||||||
type: testharness
|
|
||||||
[PNG document.contentType === 'image/png']
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -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
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue