From 58309444d735d9e69ebb45a85cdf6d594fedfeb0 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 4 Dec 2021 14:38:16 +0100 Subject: [PATCH] LibWeb: Fix DOMImplementation changing content type of wrong document DOMImplementation.createDocument() should set the content type of the newly created document, not replace the content type of the DOMImplementation's own host document. --- Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp b/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp index 1b46a0d5f6..7dab0f5c62 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp +++ b/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp @@ -40,11 +40,11 @@ NonnullRefPtr DOMImplementation::create_document(const String& namespa xml_document->set_origin(m_document.origin()); if (namespace_ == Namespace::HTML) - m_document.set_content_type("application/xhtml+xml"); + xml_document->set_content_type("application/xhtml+xml"); else if (namespace_ == Namespace::SVG) - m_document.set_content_type("image/svg+xml"); + xml_document->set_content_type("image/svg+xml"); else - m_document.set_content_type("application/xml"); + xml_document->set_content_type("application/xml"); return xml_document; }