diff options
author | Andreas Kling <kling@serenityos.org> | 2022-03-02 08:56:17 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-02 09:18:19 +0100 |
commit | 05e9dceba6726bf4da3e7dd46d252cc0eac292cd (patch) | |
tree | 4ba33fbec4c6859b7ccd7d5e19bdb832f0c1abe8 /Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp | |
parent | a9c9c8c07625f3432d761be8d604d888bf95890d (diff) | |
download | serenity-05e9dceba6726bf4da3e7dd46d252cc0eac292cd.zip |
LibWeb: Support DOMImplementation.createDocument() doctype parameter
1% progression on ACID3. :^)
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp b/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp index 1f6aa5d69d..28a5a11dbd 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp +++ b/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp @@ -20,7 +20,7 @@ DOMImplementation::DOMImplementation(Document& document) } // https://dom.spec.whatwg.org/#dom-domimplementation-createdocument -ExceptionOr<NonnullRefPtr<Document>> DOMImplementation::create_document(const String& namespace_, const String& qualified_name) const +ExceptionOr<NonnullRefPtr<Document>> DOMImplementation::create_document(const String& namespace_, const String& qualified_name, RefPtr<DocumentType> doctype) const { // FIXME: This should specifically be an XML document. auto xml_document = Document::create(); @@ -36,7 +36,8 @@ ExceptionOr<NonnullRefPtr<Document>> DOMImplementation::create_document(const St element = new_element.release_value(); } - // FIXME: If doctype is non-null, append doctype to document. + if (doctype) + xml_document->append_child(doctype.release_nonnull()); if (element) xml_document->append_child(element.release_nonnull()); |