diff options
Diffstat (limited to 'Libraries/LibWeb/DOM')
-rw-r--r-- | Libraries/LibWeb/DOM/Node.cpp | 6 | ||||
-rw-r--r-- | Libraries/LibWeb/DOM/Node.h | 2 | ||||
-rw-r--r-- | Libraries/LibWeb/DOM/Node.idl | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/Libraries/LibWeb/DOM/Node.cpp b/Libraries/LibWeb/DOM/Node.cpp index 835cd68d65..0abb77b750 100644 --- a/Libraries/LibWeb/DOM/Node.cpp +++ b/Libraries/LibWeb/DOM/Node.cpp @@ -193,4 +193,10 @@ const Element* Node::parent_element() const return to<Element>(parent()); } +RefPtr<Node> Node::append_child(NonnullRefPtr<Node> node, bool notify) +{ + TreeNode<Node>::append_child(node, notify); + return node; +} + } diff --git a/Libraries/LibWeb/DOM/Node.h b/Libraries/LibWeb/DOM/Node.h index b0065f39b6..30504abcaf 100644 --- a/Libraries/LibWeb/DOM/Node.h +++ b/Libraries/LibWeb/DOM/Node.h @@ -82,6 +82,8 @@ public: bool is_document_fragment() const { return type() == NodeType::DOCUMENT_FRAGMENT_NODE; } bool is_parent_node() const { return is_element() || is_document() || is_document_fragment(); } + RefPtr<Node> append_child(NonnullRefPtr<Node>, bool notify = true); + virtual RefPtr<LayoutNode> create_layout_node(const StyleProperties* parent_style) const; virtual FlyString node_name() const = 0; diff --git a/Libraries/LibWeb/DOM/Node.idl b/Libraries/LibWeb/DOM/Node.idl index 2fca1a6d8e..3bb148197d 100644 --- a/Libraries/LibWeb/DOM/Node.idl +++ b/Libraries/LibWeb/DOM/Node.idl @@ -8,5 +8,6 @@ interface Node : EventTarget { readonly attribute Node? parentNode; readonly attribute Element? parentElement; + Node appendChild(Node node); } |