diff --git a/components/script/dom/domparser.rs b/components/script/dom/domparser.rs index 00c18541a9b..c0de086569a 100644 --- a/components/script/dom/domparser.rs +++ b/components/script/dom/domparser.rs @@ -77,7 +77,6 @@ impl DOMParserMethods for DOMParser { Ok(document) } Text_xml | Application_xml | Application_xhtml_xml => { - // FIXME: this should probably be FromParser when we actually parse the string (#3756). let document = Document::new(&self.window, HasBrowsingContext::No, Some(url.clone()), @@ -86,12 +85,13 @@ impl DOMParserMethods for DOMParser { Some(content_type), None, DocumentActivity::Inactive, - DocumentSource::NotFromParser, + DocumentSource::FromParser, loader, None, None, Default::default()); ServoParser::parse_xml_document(&document, s, url); + document.set_ready_state(DocumentReadyState::Complete); Ok(document) } } diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index 55a3ff3d585..af456269a80 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -307439,6 +307439,12 @@ {} ] ], + "domparsing/xmldomparser.html": [ + [ + "/domparsing/xmldomparser.html", + {} + ] + ], "domxpath/001.html": [ [ "/domxpath/001.html", @@ -525106,6 +525112,10 @@ "b62d4cf898f819ccaf02769de3af12cdc80cea7e", "testharness" ], + "domparsing/xmldomparser.html": [ + "bf343e8d7f4488fc2e2755fc2dc3c8fc83a8cb17", + "testharness" + ], "domxpath/001.html": [ "f7161655a8955dd5a028b2e7dd5ada945176a930", "testharness" diff --git a/tests/wpt/web-platform-tests/domparsing/xmldomparser.html b/tests/wpt/web-platform-tests/domparsing/xmldomparser.html new file mode 100644 index 00000000000..9dac65d3053 --- /dev/null +++ b/tests/wpt/web-platform-tests/domparsing/xmldomparser.html @@ -0,0 +1,13 @@ + + +