1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 22:25:07 +00:00
serenity/Userland/Libraries/LibWeb/DOM/StaticNodeList.h
Andreas Kling 6f433c8656 LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocated
This is a monster patch that turns all EventTargets into GC-allocated
PlatformObjects. Their C++ wrapper classes are removed, and the LibJS
garbage collector is now responsible for their lifetimes.

There's a fair amount of hacks and band-aids in this patch, and we'll
have a lot of cleanup to do after this.
2022-09-06 00:27:09 +02:00

32 lines
712 B
C++

/*
* Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/NonnullRefPtrVector.h>
#include <LibWeb/DOM/Node.h>
#include <LibWeb/DOM/NodeList.h>
namespace Web::DOM {
class StaticNodeList : public NodeList {
public:
static NonnullRefPtr<NodeList> create(Vector<JS::Handle<Node>> static_nodes);
virtual ~StaticNodeList() override = default;
virtual u32 length() const override;
virtual Node const* item(u32 index) const override;
virtual bool is_supported_property_index(u32) const override;
private:
StaticNodeList(Vector<JS::Handle<Node>> static_nodes);
Vector<JS::Handle<Node>> m_static_nodes;
};
}