mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-07 10:06:03 +00:00
LibWeb: Make node cloning methods const
This commit is contained in:
parent
31b20e38ee
commit
a467005855
Notes:
github-actions[bot]
2025-01-11 22:11:18 +00:00
Author: https://github.com/tcl3
Commit: a467005855
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3228
Reviewed-by: https://github.com/gmta ✅
20 changed files with 23 additions and 23 deletions
|
@ -28,7 +28,7 @@ GC::Ref<Attr> Attr::create(Document& document, QualifiedName qualified_name, Str
|
|||
return document.realm().create<Attr>(document, move(qualified_name), move(value), owner_element);
|
||||
}
|
||||
|
||||
GC::Ref<Attr> Attr::clone(Document& document)
|
||||
GC::Ref<Attr> Attr::clone(Document& document) const
|
||||
{
|
||||
return realm().create<Attr>(document, m_qualified_name, m_value, nullptr);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ class Attr final : public Node {
|
|||
public:
|
||||
[[nodiscard]] static GC::Ref<Attr> create(Document&, QualifiedName, String value = {}, Element* = nullptr);
|
||||
[[nodiscard]] static GC::Ref<Attr> create(Document&, FlyString local_name, String value = {}, Element* = nullptr);
|
||||
GC::Ref<Attr> clone(Document&);
|
||||
GC::Ref<Attr> clone(Document&) const;
|
||||
|
||||
virtual ~Attr() override = default;
|
||||
|
||||
|
|
|
@ -1030,7 +1030,7 @@ WebIDL::ExceptionOr<GC::Ref<Node>> Node::replace_child(GC::Ref<Node> node, GC::R
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#concept-node-clone
|
||||
WebIDL::ExceptionOr<GC::Ref<Node>> Node::clone_node(Document* document, bool subtree, Node* parent)
|
||||
WebIDL::ExceptionOr<GC::Ref<Node>> Node::clone_node(Document* document, bool subtree, Node* parent) const
|
||||
{
|
||||
// To clone a node given a node node and an optional document document (default node’s node document),
|
||||
// boolean subtree (default false), and node-or-null parent (default null):
|
||||
|
@ -1085,7 +1085,7 @@ WebIDL::ExceptionOr<GC::Ref<Node>> Node::clone_node(Document* document, bool sub
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#clone-a-single-node
|
||||
WebIDL::ExceptionOr<GC::Ref<Node>> Node::clone_single_node(Document& document)
|
||||
WebIDL::ExceptionOr<GC::Ref<Node>> Node::clone_single_node(Document& document) const
|
||||
{
|
||||
// To clone a single node given a node node and document document:
|
||||
|
||||
|
|
|
@ -199,8 +199,8 @@ public:
|
|||
|
||||
WebIDL::ExceptionOr<GC::Ref<Node>> replace_child(GC::Ref<Node> node, GC::Ref<Node> child);
|
||||
|
||||
WebIDL::ExceptionOr<GC::Ref<Node>> clone_node(Document* document = nullptr, bool subtree = false, Node* parent = nullptr);
|
||||
WebIDL::ExceptionOr<GC::Ref<Node>> clone_single_node(Document&);
|
||||
WebIDL::ExceptionOr<GC::Ref<Node>> clone_node(Document* document = nullptr, bool subtree = false, Node* parent = nullptr) const;
|
||||
WebIDL::ExceptionOr<GC::Ref<Node>> clone_single_node(Document&) const;
|
||||
WebIDL::ExceptionOr<GC::Ref<Node>> clone_node_binding(bool subtree);
|
||||
|
||||
// NOTE: This is intended for the JS bindings.
|
||||
|
@ -263,7 +263,7 @@ public:
|
|||
virtual void removed_from(Node*);
|
||||
virtual void children_changed() { }
|
||||
virtual void adopted_from(Document&) { }
|
||||
virtual WebIDL::ExceptionOr<void> cloned(Node&, bool) { return {}; }
|
||||
virtual WebIDL::ExceptionOr<void> cloned(Node&, bool) const { return {}; }
|
||||
|
||||
Layout::Node const* layout_node() const { return m_layout_node; }
|
||||
Layout::Node* layout_node() { return m_layout_node; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue