mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
LibWeb: Make NodeList GC-allocated
This commit is contained in:
parent
8f4ea4e308
commit
48e0066371
Notes:
sideshowbarker
2024-07-17 07:27:43 +09:00
Author: https://github.com/awesomekling
Commit: 48e0066371
Pull-request: https://github.com/SerenityOS/serenity/pull/14816
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/linusg ✅
16 changed files with 128 additions and 57 deletions
|
@ -12,11 +12,13 @@
|
|||
|
||||
namespace Web::DOM {
|
||||
|
||||
class StaticNodeList : public NodeList {
|
||||
public:
|
||||
static NonnullRefPtr<NodeList> create(Vector<JS::Handle<Node>> static_nodes);
|
||||
class StaticNodeList final : public NodeList {
|
||||
WEB_PLATFORM_OBJECT(StaticNodeList, NodeList);
|
||||
|
||||
virtual ~StaticNodeList() override = default;
|
||||
public:
|
||||
static JS::NonnullGCPtr<NodeList> create(HTML::Window&, Vector<JS::Handle<Node>>);
|
||||
|
||||
virtual ~StaticNodeList() override;
|
||||
|
||||
virtual u32 length() const override;
|
||||
virtual Node const* item(u32 index) const override;
|
||||
|
@ -24,9 +26,11 @@ public:
|
|||
virtual bool is_supported_property_index(u32) const override;
|
||||
|
||||
private:
|
||||
StaticNodeList(Vector<JS::Handle<Node>> static_nodes);
|
||||
StaticNodeList(HTML::Window&, Vector<JS::Handle<Node>>);
|
||||
|
||||
Vector<JS::Handle<Node>> m_static_nodes;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
Vector<Node&> m_static_nodes;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue