ladybird/Userland/Libraries/LibWeb/DOM/NodeList.h

34 lines
809 B
C
Raw Normal View History

/*
* Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
2022-09-01 16:30:26 +02:00
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
2022-09-01 16:30:26 +02:00
#include <LibWeb/Bindings/LegacyPlatformObject.h>
namespace Web::DOM {
// https://dom.spec.whatwg.org/#nodelist
2022-09-01 16:30:26 +02:00
class NodeList : public Bindings::LegacyPlatformObject {
WEB_PLATFORM_OBJECT(NodeList, Bindings::LegacyPlatformObject);
public:
2022-09-01 16:30:26 +02:00
virtual ~NodeList() override;
virtual u32 length() const = 0;
virtual Node const* item(u32 index) const = 0;
2022-09-01 16:30:26 +02:00
virtual JS::Value item_value(size_t index) const override;
virtual bool is_supported_property_index(u32) const override;
protected:
explicit NodeList(JS::Realm&);
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
};
}