| 
									
										
										
										
											2022-02-12 16:38:54 +03:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2022, DerpyCrabs <derpycrabs@gmail.com> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <AK/Vector.h>
 | 
					
						
							| 
									
										
										
										
											2022-09-04 01:59:58 +02:00
										 |  |  | #include <LibWeb/Bindings/LegacyPlatformObject.h>
 | 
					
						
							| 
									
										
										
										
											2022-02-12 16:38:54 +03:00
										 |  |  | #include <LibWeb/Geometry/DOMRect.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Web::Geometry { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // https://drafts.fxtf.org/geometry-1/#DOMRectList
 | 
					
						
							| 
									
										
										
										
											2022-09-04 01:59:58 +02:00
										 |  |  | class DOMRectList final : public Bindings::LegacyPlatformObject { | 
					
						
							|  |  |  |     WEB_PLATFORM_OBJECT(DOMRectList, Bindings::LegacyPlatformObject); | 
					
						
							| 
									
										
										
										
											2022-02-12 16:38:54 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2022-09-25 18:03:02 -06:00
										 |  |  |     static JS::NonnullGCPtr<DOMRectList> create(JS::Realm&, Vector<JS::Handle<DOMRect>>); | 
					
						
							| 
									
										
										
										
											2022-02-12 16:38:54 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-04 01:59:58 +02:00
										 |  |  |     virtual ~DOMRectList() override; | 
					
						
							| 
									
										
										
										
											2022-02-12 16:38:54 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     u32 length() const; | 
					
						
							|  |  |  |     DOMRect const* item(u32 index) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-04 01:59:58 +02:00
										 |  |  |     virtual bool is_supported_property_index(u32) const override; | 
					
						
							|  |  |  |     virtual JS::Value item_value(size_t index) const override; | 
					
						
							| 
									
										
										
										
											2022-02-12 16:38:54 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							| 
									
										
										
										
											2022-09-25 18:03:02 -06:00
										 |  |  |     DOMRectList(JS::Realm&, Vector<JS::NonnullGCPtr<DOMRect>>); | 
					
						
							| 
									
										
										
										
											2022-02-12 16:38:54 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-10 06:56:59 -05:00
										 |  |  |     virtual void initialize(JS::Realm&) override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-04 01:59:58 +02:00
										 |  |  |     Vector<JS::NonnullGCPtr<DOMRect>> m_rects; | 
					
						
							| 
									
										
										
										
											2022-02-12 16:38:54 +03:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |