servo: Merge #14423 - Properly mark application/xhtml+xml documents as XML (from nox:xml-document); r=Ms2ger

Source-Repo: https://github.com/servo/servo
Source-Revision: 5abbc9f69668f23469a9c01937c68e305fa36cd8
This commit is contained in:
Anthony Ramine
2016-12-01 03:57:14 -08:00
parent 8322e35a61
commit cfc2192752
13 changed files with 146 additions and 137 deletions

View File

@@ -1751,9 +1751,12 @@ impl ScriptThread {
Some(incomplete.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,
Some(Serde(ContentType(Mime(TopLevel::Application, SubLevel::Xml, _)))) |
Some(Serde(ContentType(Mime(TopLevel::Text, SubLevel::Xml, _)))) =>
IsHTMLDocument::NonHTMLDocument,
Some(Serde(ContentType(Mime(TopLevel::Text, SubLevel::Xml, _)))) => IsHTMLDocument::NonHTMLDocument,
_ => IsHTMLDocument::HTMLDocument,
};
@@ -1844,17 +1847,7 @@ impl ScriptThread {
document.set_https_state(metadata.https_state);
let is_xml = match metadata.content_type {
Some(Serde(ContentType(Mime(TopLevel::Application, SubLevel::Ext(ref sub_level), _))))
if sub_level.ends_with("+xml") => true,
Some(Serde(ContentType(Mime(TopLevel::Application, SubLevel::Xml, _)))) |
Some(Serde(ContentType(Mime(TopLevel::Text, SubLevel::Xml, _)))) => true,
_ => false,
};
if is_xml {
if is_html_document == IsHTMLDocument::NonHTMLDocument {
ServoParser::parse_xml_document(
&document,
parse_input,