| 
									
										
										
										
											2023-04-04 18:32:09 -04:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-23 18:58:42 +02:00
										 |  |  | #include <LibWeb/DOM/Document.h>
 | 
					
						
							| 
									
										
										
										
											2023-04-04 18:32:09 -04:00
										 |  |  | #include <LibWeb/Forward.h>
 | 
					
						
							|  |  |  | #include <LibWeb/Layout/ReplacedBox.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Web::Layout { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class VideoBox final | 
					
						
							|  |  |  |     : public ReplacedBox | 
					
						
							| 
									
										
										
										
											2023-08-23 18:58:42 +02:00
										 |  |  |     , public DOM::Document::ViewportClient { | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     GC_CELL(VideoBox, ReplacedBox); | 
					
						
							|  |  |  |     GC_DECLARE_ALLOCATOR(VideoBox); | 
					
						
							| 
									
										
										
										
											2023-04-04 18:32:09 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     virtual void prepare_for_replaced_layout() override; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     HTML::HTMLVideoElement& dom_node(); | 
					
						
							|  |  |  |     HTML::HTMLVideoElement const& dom_node() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     virtual GC::Ptr<Painting::Paintable> create_paintable() const override; | 
					
						
							| 
									
										
										
										
											2023-04-04 18:32:09 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							| 
									
										
										
										
											2024-12-20 16:35:12 +01:00
										 |  |  |     VideoBox(DOM::Document&, DOM::Element&, GC::Ref<CSS::ComputedProperties>); | 
					
						
							| 
									
										
										
										
											2023-04-04 18:32:09 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-23 18:58:42 +02:00
										 |  |  |     // ^Document::ViewportClient
 | 
					
						
							|  |  |  |     virtual void did_set_viewport_rect(CSSPixelRect const&) final; | 
					
						
							| 
									
										
										
										
											2023-04-04 18:32:09 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // ^JS::Cell
 | 
					
						
							|  |  |  |     virtual void finalize() override; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |