| 
									
										
										
										
											2020-07-19 23:01:53 -07:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2021-04-22 16:53:07 -07:00
										 |  |  |  * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org> | 
					
						
							| 
									
										
										
										
											2020-07-19 23:01:53 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2021-04-22 01:24:48 -07:00
										 |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							| 
									
										
										
										
											2020-07-19 23:01:53 -07:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-06 20:02:41 +02:00
										 |  |  | #include <LibWeb/Layout/BlockContainer.h>
 | 
					
						
							| 
									
										
										
										
											2020-10-05 16:14:36 -07:00
										 |  |  | #include <LibWeb/SVG/SVGElement.h>
 | 
					
						
							|  |  |  | #include <LibWeb/SVG/SVGGraphicsElement.h>
 | 
					
						
							| 
									
										
										
										
											2020-07-19 23:01:53 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-22 15:53:01 +01:00
										 |  |  | namespace Web::Layout { | 
					
						
							| 
									
										
										
										
											2020-07-19 23:01:53 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-18 22:13:26 +01:00
										 |  |  | class SVGBox : public Box { | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     GC_CELL(SVGBox, Box); | 
					
						
							| 
									
										
										
										
											2022-10-17 14:41:50 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-19 23:01:53 -07:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2024-12-20 16:35:12 +01:00
										 |  |  |     SVGBox(DOM::Document&, SVG::SVGElement&, GC::Ref<CSS::ComputedProperties>); | 
					
						
							| 
									
										
										
										
											2020-11-22 15:53:01 +01:00
										 |  |  |     virtual ~SVGBox() override = default; | 
					
						
							| 
									
										
										
										
											2020-07-19 23:01:53 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-21 09:12:05 -05:00
										 |  |  |     SVG::SVGElement& dom_node() { return as<SVG::SVGElement>(*Box::dom_node()); } | 
					
						
							|  |  |  |     SVG::SVGElement const& dom_node() const { return as<SVG::SVGElement>(*Box::dom_node()); } | 
					
						
							| 
									
										
										
										
											2021-09-17 23:12:16 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-18 16:26:05 +02:00
										 |  |  | private: | 
					
						
							|  |  |  |     virtual bool is_svg_box() const final { return true; } | 
					
						
							| 
									
										
										
										
											2020-07-19 23:01:53 -07:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-18 16:26:05 +02:00
										 |  |  | template<> | 
					
						
							|  |  |  | inline bool Node::fast_is<SVGBox>() const { return is_svg_box(); } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-19 23:01:53 -07:00
										 |  |  | } |