diff options
author | Luke <luke.wilde@live.co.uk> | 2021-07-05 05:30:24 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-05 12:39:46 +0200 |
commit | f3f2170ac6c217fb88346f4834524168bac85a50 (patch) | |
tree | b42af8a244102fa537d8766647806da0bac2bd68 /Userland/Libraries/LibWeb/DOM/Node.h | |
parent | e4ae1cdd1f4734a8cb33106d88bc4458e3c46ea9 (diff) | |
download | serenity-f3f2170ac6c217fb88346f4834524168bac85a50.zip |
LibWeb: Add the cloning steps in clone_node
This will be used in HTMLTemplateElement later to clone template
contents.
This makes the clone functions non-const in the process, as the cloning
steps can have side effects.
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/Node.h')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Node.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Node.h b/Userland/Libraries/LibWeb/DOM/Node.h index 63d9b122b6..0c21d6cd64 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.h +++ b/Userland/Libraries/LibWeb/DOM/Node.h @@ -85,8 +85,8 @@ public: ExceptionOr<NonnullRefPtr<Node>> replace_child(NonnullRefPtr<Node> node, NonnullRefPtr<Node> child); - NonnullRefPtr<Node> clone_node(Document* document = nullptr, bool clone_children = false) const; - ExceptionOr<NonnullRefPtr<Node>> clone_node_binding(bool deep) const; + NonnullRefPtr<Node> clone_node(Document* document = nullptr, bool clone_children = false); + ExceptionOr<NonnullRefPtr<Node>> clone_node_binding(bool deep); // NOTE: This is intended for the JS bindings. bool has_child_nodes() const { return has_children(); } @@ -134,6 +134,7 @@ public: virtual void removed_from(Node*) { } virtual void children_changed() { } virtual void adopted_from(const Document&) { } + virtual void cloned(Node&, bool) {}; const Layout::Node* layout_node() const { return m_layout_node; } Layout::Node* layout_node() { return m_layout_node; } |