From 5430bc896316c1cd8702b8f32bfc16c68cd407e6 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 5 Jul 2021 05:21:52 +0100 Subject: [PATCH] LibWeb: Make clone_node capable of cloning document fragments Used by Web Components Polyfills. --- Userland/Libraries/LibWeb/DOM/Node.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index 8ec7179a40..c90dcadf98 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -446,6 +446,9 @@ NonnullRefPtr Node::clone_node(Document* document, bool clone_children) co auto processing_instruction = verify_cast(this); auto processing_instruction_copy = adopt_ref(*new ProcessingInstruction(*document, processing_instruction->data(), processing_instruction->target())); copy = move(processing_instruction_copy); + } else if (is(this)) { + auto document_fragment_copy = adopt_ref(*new DocumentFragment(*document)); + copy = move(document_fragment_copy); } else { dbgln("clone_node() not implemented for NodeType {}", (u16)m_type); TODO();