2021-10-02 16:33:45 -03:00
|
|
|
/*
|
2023-02-27 21:05:39 -03:00
|
|
|
* Copyright (c) 2021-2023, Luke Wilde <lukew@serenityos.org>
|
2024-10-04 08:19:50 -03:00
|
|
|
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
|
2021-10-02 16:33:45 -03:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2024-01-09 20:05:03 -03:00
|
|
|
#include <LibWeb/Bindings/PlatformObject.h>
|
2025-07-19 23:35:33 -03:00
|
|
|
#include <LibWeb/Export.h>
|
2021-10-02 16:33:45 -03:00
|
|
|
|
|
|
|
|
namespace Web::DOM {
|
|
|
|
|
|
|
|
|
|
// https://dom.spec.whatwg.org/#nodelist
|
2025-07-19 23:35:33 -03:00
|
|
|
class WEB_API NodeList : public Bindings::PlatformObject {
|
2024-01-09 20:05:03 -03:00
|
|
|
WEB_PLATFORM_OBJECT(NodeList, Bindings::PlatformObject);
|
2021-10-02 16:33:45 -03:00
|
|
|
|
|
|
|
|
public:
|
2022-09-01 11:30:26 -03:00
|
|
|
virtual ~NodeList() override;
|
2021-10-02 16:33:45 -03:00
|
|
|
|
|
|
|
|
virtual u32 length() const = 0;
|
|
|
|
|
virtual Node const* item(u32 index) const = 0;
|
|
|
|
|
|
2024-07-25 03:15:51 -03:00
|
|
|
virtual Optional<JS::Value> item_value(size_t index) const override;
|
2021-10-02 16:33:45 -03:00
|
|
|
|
|
|
|
|
protected:
|
2022-09-25 19:15:49 -03:00
|
|
|
explicit NodeList(JS::Realm&);
|
2023-01-10 08:56:59 -03:00
|
|
|
|
2023-08-07 03:41:28 -03:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2021-10-02 16:33:45 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|