NodeList.h 761 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Noncopyable.h>
  8. #include <AK/RefCounted.h>
  9. #include <LibWeb/Bindings/Wrappable.h>
  10. #include <LibWeb/Forward.h>
  11. namespace Web::DOM {
  12. // https://dom.spec.whatwg.org/#nodelist
  13. class NodeList
  14. : public RefCounted<NodeList>
  15. , public Bindings::Wrappable {
  16. AK_MAKE_NONCOPYABLE(NodeList);
  17. AK_MAKE_NONMOVABLE(NodeList);
  18. public:
  19. using WrapperType = Bindings::NodeListWrapper;
  20. virtual ~NodeList() override = default;
  21. virtual u32 length() const = 0;
  22. virtual Node const* item(u32 index) const = 0;
  23. virtual bool is_supported_property_index(u32) const = 0;
  24. protected:
  25. NodeList() = default;
  26. };
  27. }