| 
									
										
										
										
											2021-10-02 20:33:45 +01:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2021, Luke Wilde <lukew@serenityos.org> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibWeb/DOM/Node.h>
 | 
					
						
							|  |  |  | #include <LibWeb/DOM/NodeList.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Web::DOM { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-01 16:30:26 +02:00
										 |  |  | class StaticNodeList final : public NodeList { | 
					
						
							|  |  |  |     WEB_PLATFORM_OBJECT(StaticNodeList, NodeList); | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     GC_DECLARE_ALLOCATOR(StaticNodeList); | 
					
						
							| 
									
										
										
										
											2022-09-01 16:30:26 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-02 20:33:45 +01:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     [[nodiscard]] static GC::Ref<NodeList> create(JS::Realm&, Vector<GC::Root<Node>>); | 
					
						
							| 
									
										
										
										
											2021-10-02 20:33:45 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-01 16:30:26 +02:00
										 |  |  |     virtual ~StaticNodeList() override; | 
					
						
							| 
									
										
										
										
											2021-10-02 20:33:45 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     virtual u32 length() const override; | 
					
						
							|  |  |  |     virtual Node const* item(u32 index) const override; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     StaticNodeList(JS::Realm&, Vector<GC::Root<Node>>); | 
					
						
							| 
									
										
										
										
											2022-09-01 16:30:26 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     virtual void visit_edges(Cell::Visitor&) override; | 
					
						
							| 
									
										
										
										
											2021-10-02 20:33:45 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     Vector<GC::Ref<Node>> m_static_nodes; | 
					
						
							| 
									
										
										
										
											2021-10-02 20:33:45 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |