From f18ea096e0efb2097486940adabe451c449d89e0 Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Sun, 18 Feb 2024 14:27:25 +0000 Subject: [PATCH] LibWeb: Set correct document type when parsing XML with DOMParser --- Userland/Libraries/LibWeb/HTML/DOMParser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Libraries/LibWeb/HTML/DOMParser.cpp b/Userland/Libraries/LibWeb/HTML/DOMParser.cpp index c18582defe0..e61fecee5cf 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/DOMParser.cpp @@ -62,6 +62,7 @@ JS::NonnullGCPtr DOMParser::parse_from_string(StringView string, // -> Otherwise document = DOM::XMLDocument::create(realm(), verify_cast(relevant_global_object(*this)).associated_document().url()); document->set_content_type(Bindings::idl_enum_to_string(type)); + document->set_document_type(DOM::Document::Type::XML); // 1. Create an XML parser parse, associated with document, and with XML scripting support disabled. XML::Parser parser(string, { .resolve_external_resource = resolve_xml_resource });