NodeList.h 794 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2021-2023, Luke Wilde <lukew@serenityos.org>
  3. * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <LibWeb/Bindings/PlatformObject.h>
  9. namespace Web::DOM {
  10. // https://dom.spec.whatwg.org/#nodelist
  11. class NodeList : public Bindings::PlatformObject {
  12. WEB_PLATFORM_OBJECT(NodeList, Bindings::PlatformObject);
  13. public:
  14. virtual ~NodeList() override;
  15. virtual u32 length() const = 0;
  16. virtual Node const* item(u32 index) const = 0;
  17. virtual WebIDL::ExceptionOr<JS::Value> item_value(size_t index) const override;
  18. virtual bool is_supported_property_index(u32) const override;
  19. protected:
  20. explicit NodeList(JS::Realm&);
  21. virtual void initialize(JS::Realm&) override;
  22. };
  23. }