LibWeb: Use GC::Ref<Node> in Range for start/end containers

Let's propagate the GC'ness of it all to the users of Range.
This commit is contained in:
Jelle Raaijmakers 2024-11-30 10:32:32 +01:00 committed by Andreas Kling
commit c87960f8f3
Notes: github-actions[bot] 2024-11-30 16:37:32 +00:00
6 changed files with 92 additions and 99 deletions

View file

@ -20,12 +20,10 @@ class AbstractRange : public Bindings::PlatformObject {
public:
virtual ~AbstractRange() override;
Node* start_container() { return m_start_container.ptr(); }
Node const* start_container() const { return m_start_container.ptr(); }
GC::Ref<Node> start_container() const { return m_start_container; }
WebIDL::UnsignedLong start_offset() const { return m_start_offset; }
Node* end_container() { return m_end_container.ptr(); }
Node const* end_container() const { return m_end_container.ptr(); }
GC::Ref<Node> end_container() const { return m_end_container; }
WebIDL::UnsignedLong end_offset() const { return m_end_offset; }
// https://dom.spec.whatwg.org/#range-collapsed
@ -36,7 +34,7 @@ public:
}
protected:
AbstractRange(Node& start_container, WebIDL::UnsignedLong start_offset, Node& end_container, WebIDL::UnsignedLong end_offset);
AbstractRange(GC::Ref<Node> start_container, WebIDL::UnsignedLong start_offset, GC::Ref<Node> end_container, WebIDL::UnsignedLong end_offset);
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;