LibWeb: Set correct document type when parsing XML with DOMParser

This commit is contained in:
Tim Ledbetter 2024-02-18 14:27:25 +00:00 committed by Andreas Kling
parent 27e369cd19
commit f18ea096e0
Notes: sideshowbarker 2024-07-17 04:21:32 +09:00

View File

@ -62,6 +62,7 @@ JS::NonnullGCPtr<DOM::Document> DOMParser::parse_from_string(StringView string,
// -> Otherwise
document = DOM::XMLDocument::create(realm(), verify_cast<HTML::Window>(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 });