diff --git a/Libraries/LibWeb/HTML/DOMParser.cpp b/Libraries/LibWeb/HTML/DOMParser.cpp index 27bb8e6520b..7b70b863e48 100644 --- a/Libraries/LibWeb/HTML/DOMParser.cpp +++ b/Libraries/LibWeb/HTML/DOMParser.cpp @@ -56,7 +56,7 @@ GC::Ref DOMParser::parse_from_string(StringView string, Bindings: document->parse_html_from_a_string(string); } else { // -> Otherwise - document = DOM::XMLDocument::create(realm(), associated_document.url()); + document = DOM::Document::create(realm(), associated_document.url()); document->set_content_type(Bindings::idl_enum_to_string(type)); document->set_document_type(DOM::Document::Type::XML); diff --git a/Tests/LibWeb/Text/expected/DOM/DOMParser-xml-document.txt b/Tests/LibWeb/Text/expected/DOM/DOMParser-xml-document.txt index 7b4c1cfe762..7568f248152 100644 --- a/Tests/LibWeb/Text/expected/DOM/DOMParser-xml-document.txt +++ b/Tests/LibWeb/Text/expected/DOM/DOMParser-xml-document.txt @@ -1 +1 @@ -XMLDocument +Document diff --git a/Tests/LibWeb/Text/expected/wpt-import/domparsing/DOMParser-parseFromString-xml.txt b/Tests/LibWeb/Text/expected/wpt-import/domparsing/DOMParser-parseFromString-xml.txt new file mode 100644 index 00000000000..947fcdc2e9d --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/domparsing/DOMParser-parseFromString-xml.txt @@ -0,0 +1,25 @@ +Harness status: OK + +Found 20 tests + +20 Pass +Pass Should parse correctly in type text/xml +Pass XMLDocument interface for correctly parsed document with type text/xml +Pass Should return an error document for XML wellformedness errors in type text/xml +Pass XMLDocument interface for incorrectly parsed document with type text/xml +Pass scripting must be disabled with type text/xml +Pass Should parse correctly in type application/xml +Pass XMLDocument interface for correctly parsed document with type application/xml +Pass Should return an error document for XML wellformedness errors in type application/xml +Pass XMLDocument interface for incorrectly parsed document with type application/xml +Pass scripting must be disabled with type application/xml +Pass Should parse correctly in type application/xhtml+xml +Pass XMLDocument interface for correctly parsed document with type application/xhtml+xml +Pass Should return an error document for XML wellformedness errors in type application/xhtml+xml +Pass XMLDocument interface for incorrectly parsed document with type application/xhtml+xml +Pass scripting must be disabled with type application/xhtml+xml +Pass Should parse correctly in type image/svg+xml +Pass XMLDocument interface for correctly parsed document with type image/svg+xml +Pass Should return an error document for XML wellformedness errors in type image/svg+xml +Pass XMLDocument interface for incorrectly parsed document with type image/svg+xml +Pass scripting must be disabled with type image/svg+xml \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/domparsing/DOMParser-parseFromString-xml.html b/Tests/LibWeb/Text/input/wpt-import/domparsing/DOMParser-parseFromString-xml.html new file mode 100644 index 00000000000..caccef4ddb0 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/domparsing/DOMParser-parseFromString-xml.html @@ -0,0 +1,77 @@ + +DOMParser + + + +
+