LibWeb: Pass old parent's root to Node::removed_from()

This will allow nodes to access the root they've just been removed from.
This commit is contained in:
Andreas Kling 2025-01-23 17:37:18 +01:00 committed by Andreas Kling
commit 7269fc3e52
Notes: github-actions[bot] 2025-01-23 20:40:20 +00:00
39 changed files with 65 additions and 60 deletions

View file

@ -128,9 +128,9 @@ void SVGElement::update_use_elements_that_reference_this()
});
}
void SVGElement::removed_from(Node* parent)
void SVGElement::removed_from(Node* old_parent, Node& old_root)
{
Base::removed_from(parent);
Base::removed_from(old_parent, old_root);
remove_from_use_element_that_reference_this();
}

View file

@ -38,7 +38,7 @@ protected:
virtual WebIDL::ExceptionOr<void> cloned(DOM::Node&, bool) const override;
virtual void children_changed() override;
virtual void inserted() override;
virtual void removed_from(Node*) override;
virtual void removed_from(Node* old_parent, Node& old_root) override;
void update_use_elements_that_reference_this();
void remove_from_use_element_that_reference_this();

View file

@ -42,10 +42,10 @@ void SVGStyleElement::inserted()
Base::inserted();
}
void SVGStyleElement::removed_from(Node* old_parent)
void SVGStyleElement::removed_from(Node* old_parent, Node& old_root)
{
m_style_element_utils.update_a_style_block(*this);
Base::removed_from(old_parent);
Base::removed_from(old_parent, old_root);
}
// https://www.w3.org/TR/cssom/#dom-linkstyle-sheet

View file

@ -20,7 +20,7 @@ public:
virtual void children_changed() override;
virtual void inserted() override;
virtual void removed_from(Node*) override;
virtual void removed_from(Node* old_parent, Node& old_root) override;
CSS::CSSStyleSheet* sheet();
CSS::CSSStyleSheet const* sheet() const;