LibWeb: Make node cloning methods const

This commit is contained in:
Tim Ledbetter 2025-01-11 17:37:08 +00:00 committed by Jelle Raaijmakers
commit a467005855
Notes: github-actions[bot] 2025-01-11 22:11:18 +00:00
20 changed files with 23 additions and 23 deletions

View file

@ -612,7 +612,7 @@ void HTMLElement::attribute_changed(FlyString const& name, Optional<String> cons
#undef __ENUMERATE
}
WebIDL::ExceptionOr<void> HTMLElement::cloned(Web::DOM::Node& copy, bool clone_children)
WebIDL::ExceptionOr<void> HTMLElement::cloned(Web::DOM::Node& copy, bool clone_children) const
{
TRY(Base::cloned(copy, clone_children));
TRY(HTMLOrSVGElement::cloned(copy, clone_children));

View file

@ -137,7 +137,7 @@ protected:
virtual void initialize(JS::Realm&) override;
virtual void attribute_changed(FlyString const& name, Optional<String> const& old_value, Optional<String> const& value, Optional<FlyString> const& namespace_) override;
virtual WebIDL::ExceptionOr<void> cloned(DOM::Node&, bool) override;
virtual WebIDL::ExceptionOr<void> cloned(DOM::Node&, bool) const override;
virtual void inserted() override;
virtual void visit_edges(Cell::Visitor&) override;

View file

@ -1706,7 +1706,7 @@ void HTMLInputElement::apply_presentational_hints(GC::Ref<CSS::CascadedPropertie
}
// https://html.spec.whatwg.org/multipage/input.html#the-input-element%3Aconcept-node-clone-ext
WebIDL::ExceptionOr<void> HTMLInputElement::cloned(DOM::Node& copy, bool subtree)
WebIDL::ExceptionOr<void> HTMLInputElement::cloned(DOM::Node& copy, bool subtree) const
{
TRY(Base::cloned(copy, subtree));

View file

@ -183,7 +183,7 @@ public:
virtual void form_associated_element_was_removed(DOM::Node*) override;
virtual void form_associated_element_attribute_changed(FlyString const&, Optional<String> const&, Optional<FlyString> const&) override;
virtual WebIDL::ExceptionOr<void> cloned(Node&, bool) override;
virtual WebIDL::ExceptionOr<void> cloned(Node&, bool) const override;
GC::Ref<ValidityState const> validity() const;

View file

@ -78,7 +78,7 @@ void HTMLOrSVGElement<ElementBase>::attribute_changed(FlyString const& local_nam
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#dom-noncedelement-nonce
template<typename ElementBase>
WebIDL::ExceptionOr<void> HTMLOrSVGElement<ElementBase>::cloned(DOM::Node& copy, bool)
WebIDL::ExceptionOr<void> HTMLOrSVGElement<ElementBase>::cloned(DOM::Node& copy, bool) const
{
// The cloning steps for elements that include HTMLOrSVGElement given node, copy, and subtree
// are to set copy's [[CryptographicNonce]] to node's [[CryptographicNonce]].

View file

@ -26,7 +26,7 @@ public:
protected:
void attribute_changed(FlyString const&, Optional<String> const&, Optional<String> const&, Optional<FlyString> const&);
WebIDL::ExceptionOr<void> cloned(DOM::Node&, bool);
WebIDL::ExceptionOr<void> cloned(DOM::Node&, bool) const;
void inserted();
void visit_edges(JS::Cell::Visitor&);

View file

@ -651,7 +651,7 @@ void HTMLScriptElement::set_async(bool async)
}
// https://html.spec.whatwg.org/multipage/scripting.html#script-processing-model:concept-node-clone-ext
WebIDL::ExceptionOr<void> HTMLScriptElement::cloned(Node& copy, bool subtree)
WebIDL::ExceptionOr<void> HTMLScriptElement::cloned(Node& copy, bool subtree) const
{
TRY(Base::cloned(copy, subtree));

View file

@ -63,7 +63,7 @@ public:
[[nodiscard]] bool async() const;
void set_async(bool);
virtual WebIDL::ExceptionOr<void> cloned(Node&, bool) override;
virtual WebIDL::ExceptionOr<void> cloned(Node&, bool) const override;
private:
HTMLScriptElement(DOM::Document&, DOM::QualifiedName);

View file

@ -46,7 +46,7 @@ void HTMLTemplateElement::adopted_from(DOM::Document&)
}
// https://html.spec.whatwg.org/multipage/scripting.html#the-template-element:concept-node-clone-ext
WebIDL::ExceptionOr<void> HTMLTemplateElement::cloned(Node& copy, bool subtree)
WebIDL::ExceptionOr<void> HTMLTemplateElement::cloned(Node& copy, bool subtree) const
{
TRY(Base::cloned(copy, subtree));

View file

@ -24,7 +24,7 @@ public:
void set_template_contents(GC::Ref<DOM::DocumentFragment>);
virtual void adopted_from(DOM::Document&) override;
virtual WebIDL::ExceptionOr<void> cloned(Node& copy, bool clone_children) override;
virtual WebIDL::ExceptionOr<void> cloned(Node& copy, bool clone_children) const override;
private:
HTMLTemplateElement(DOM::Document&, DOM::QualifiedName);

View file

@ -136,7 +136,7 @@ void HTMLTextAreaElement::clear_algorithm()
}
// https://html.spec.whatwg.org/multipage/forms.html#the-textarea-element:concept-node-clone-ext
WebIDL::ExceptionOr<void> HTMLTextAreaElement::cloned(DOM::Node& copy, bool subtree)
WebIDL::ExceptionOr<void> HTMLTextAreaElement::cloned(DOM::Node& copy, bool subtree) const
{
TRY(Base::cloned(copy, subtree));

View file

@ -64,7 +64,7 @@ public:
virtual void reset_algorithm() override;
virtual void clear_algorithm() override;
virtual WebIDL::ExceptionOr<void> cloned(Node&, bool) override;
virtual WebIDL::ExceptionOr<void> cloned(Node&, bool) const override;
virtual void form_associated_element_was_inserted() override;
virtual void form_associated_element_was_removed(DOM::Node*) override;