diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/Node.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Node.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index e8c66af51d..058dda44cc 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -354,7 +354,7 @@ NonnullRefPtr<Node> Node::clone_node(Document* document, bool clone_children) co if (is<Element>(this)) { auto& element = *downcast<Element>(this); auto qualified_name = QualifiedName(element.local_name(), element.prefix(), element.namespace_()); - auto element_copy = adopt(*new Element(*document, move(qualified_name))); + auto element_copy = adopt_ref(*new Element(*document, move(qualified_name))); element.for_each_attribute([&](auto& name, auto& value) { element_copy->set_attribute(name, value); }); @@ -370,22 +370,22 @@ NonnullRefPtr<Node> Node::clone_node(Document* document, bool clone_children) co copy = move(document_copy); } else if (is<DocumentType>(this)) { auto document_type = downcast<DocumentType>(this); - auto document_type_copy = adopt(*new DocumentType(*document)); + auto document_type_copy = adopt_ref(*new DocumentType(*document)); document_type_copy->set_name(document_type->name()); document_type_copy->set_public_id(document_type->public_id()); document_type_copy->set_system_id(document_type->system_id()); copy = move(document_type_copy); } else if (is<Text>(this)) { auto text = downcast<Text>(this); - auto text_copy = adopt(*new Text(*document, text->data())); + auto text_copy = adopt_ref(*new Text(*document, text->data())); copy = move(text_copy); } else if (is<Comment>(this)) { auto comment = downcast<Comment>(this); - auto comment_copy = adopt(*new Comment(*document, comment->data())); + auto comment_copy = adopt_ref(*new Comment(*document, comment->data())); copy = move(comment_copy); } else if (is<ProcessingInstruction>(this)) { auto processing_instruction = downcast<ProcessingInstruction>(this); - auto processing_instruction_copy = adopt(*new ProcessingInstruction(*document, processing_instruction->data(), processing_instruction->target())); + auto processing_instruction_copy = adopt_ref(*new ProcessingInstruction(*document, processing_instruction->data(), processing_instruction->target())); copy = move(processing_instruction_copy); } else { dbgln("clone_node() not implemented for NodeType {}", (u16)m_type); |