StaticNodeList.h 808 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/DOM/Node.h>
  8. #include <LibWeb/DOM/NodeList.h>
  9. namespace Web::DOM {
  10. class StaticNodeList final : public NodeList {
  11. WEB_PLATFORM_OBJECT(StaticNodeList, NodeList);
  12. public:
  13. static WebIDL::ExceptionOr<JS::NonnullGCPtr<NodeList>> create(JS::Realm&, Vector<JS::Handle<Node>>);
  14. virtual ~StaticNodeList() override;
  15. virtual u32 length() const override;
  16. virtual Node const* item(u32 index) const override;
  17. virtual bool is_supported_property_index(u32) const override;
  18. private:
  19. StaticNodeList(JS::Realm&, Vector<JS::Handle<Node>>);
  20. virtual void visit_edges(Cell::Visitor&) override;
  21. Vector<JS::NonnullGCPtr<Node>> m_static_nodes;
  22. };
  23. }