1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:37:34 +00:00

LibWeb: Make LiveNodeList store a NonnullGCPtr<Node const> root

This allows us to improve the const-correctness in RadioNodeList, which
has been made possible as of: 5f0ccfb499 now that a GC-visit accepts a
const GC pointer.
This commit is contained in:
Shannon Booth 2023-12-21 22:36:37 +13:00 committed by Andreas Kling
parent 0a7e4a0d22
commit 1defc4595b
7 changed files with 12 additions and 11 deletions

View file

@ -24,7 +24,7 @@ public:
Descendants,
};
[[nodiscard]] static JS::NonnullGCPtr<NodeList> create(JS::Realm&, Node& root, Scope, Function<bool(Node const&)> filter);
[[nodiscard]] static JS::NonnullGCPtr<NodeList> create(JS::Realm&, Node const& root, Scope, Function<bool(Node const&)> filter);
virtual ~LiveNodeList() override;
virtual u32 length() const override;
@ -33,7 +33,7 @@ public:
virtual bool is_supported_property_index(u32) const override;
protected:
LiveNodeList(JS::Realm&, Node& root, Scope, Function<bool(Node const&)> filter);
LiveNodeList(JS::Realm&, Node const& root, Scope, Function<bool(Node const&)> filter);
Node* first_matching(Function<bool(Node const&)> const& filter) const;
@ -42,7 +42,7 @@ private:
JS::MarkedVector<Node*> collection() const;
JS::NonnullGCPtr<Node> m_root;
JS::NonnullGCPtr<Node const> m_root;
Function<bool(Node const&)> m_filter;
Scope m_scope { Scope::Descendants };
};