소스 검색

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.
Andreas Kling 3 년 전
부모
커밋
58309444d7
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp

+ 3 - 3
Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp

@@ -40,11 +40,11 @@ NonnullRefPtr<Document> DOMImplementation::create_document(const String& namespa
     xml_document->set_origin(m_document.origin());
     xml_document->set_origin(m_document.origin());
 
 
     if (namespace_ == Namespace::HTML)
     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)
     else if (namespace_ == Namespace::SVG)
-        m_document.set_content_type("image/svg+xml");
+        xml_document->set_content_type("image/svg+xml");
     else
     else
-        m_document.set_content_type("application/xml");
+        xml_document->set_content_type("application/xml");
 
 
     return xml_document;
     return xml_document;
 }
 }