Properly mark application/xhtml+xml documents as XML

For this to work, we must remove the unimplemented!() call
in Element::parse_fragment because all the tests rely on
setting innerHTML.
This commit is contained in:
Anthony Ramine 2016-11-30 16:19:07 +01:00
parent 0c64bd766a
commit c1bdd3d5ce
8 changed files with 9 additions and 136 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,