mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
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:
parent
0c64bd766a
commit
c1bdd3d5ce
8 changed files with 9 additions and 136 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue