| 
									
										
										
										
											2022-02-11 15:52:42 +00:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibWeb/SVG/SVGGeometryElement.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Web::SVG { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // https://www.w3.org/TR/SVG11/shapes.html#RectElement
 | 
					
						
							|  |  |  | class SVGRectElement final : public SVGGeometryElement { | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  |     WEB_PLATFORM_OBJECT(SVGRectElement, SVGGeometryElement); | 
					
						
							| 
									
										
										
										
											2023-11-19 19:47:52 +01:00
										 |  |  |     JS_DECLARE_ALLOCATOR(SVGRectElement); | 
					
						
							| 
									
										
										
										
											2022-02-11 15:52:42 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2022-02-11 15:52:42 +00:00
										 |  |  |     virtual ~SVGRectElement() override = default; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-09 20:18:41 +01:00
										 |  |  |     virtual void attribute_changed(FlyString const& name, Optional<String> const& old_value, Optional<String> const& value) override; | 
					
						
							| 
									
										
										
										
											2022-02-11 15:52:42 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-03 20:15:06 +00:00
										 |  |  |     virtual Gfx::Path get_path(CSSPixelSize viewport_size) override; | 
					
						
							| 
									
										
										
										
											2022-02-11 15:52:42 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-02 14:04:59 +02:00
										 |  |  |     JS::NonnullGCPtr<SVGAnimatedLength> x() const; | 
					
						
							|  |  |  |     JS::NonnullGCPtr<SVGAnimatedLength> y() const; | 
					
						
							|  |  |  |     JS::NonnullGCPtr<SVGAnimatedLength> width() const; | 
					
						
							|  |  |  |     JS::NonnullGCPtr<SVGAnimatedLength> height() const; | 
					
						
							|  |  |  |     JS::NonnullGCPtr<SVGAnimatedLength> rx() const; | 
					
						
							|  |  |  |     JS::NonnullGCPtr<SVGAnimatedLength> ry() const; | 
					
						
							| 
									
										
										
										
											2022-03-21 14:34:02 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-11 15:52:42 +00:00
										 |  |  | private: | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  |     SVGRectElement(DOM::Document&, DOM::QualifiedName); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-07 08:41:28 +02:00
										 |  |  |     virtual void initialize(JS::Realm&) override; | 
					
						
							| 
									
										
										
										
											2023-01-10 06:28:20 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-10 10:52:14 +01:00
										 |  |  |     Gfx::FloatSize calculate_used_corner_radius_values() const; | 
					
						
							| 
									
										
										
										
											2022-02-11 15:52:42 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     Optional<float> m_x; | 
					
						
							|  |  |  |     Optional<float> m_y; | 
					
						
							|  |  |  |     Optional<float> m_width; | 
					
						
							|  |  |  |     Optional<float> m_height; | 
					
						
							|  |  |  |     Optional<float> m_radius_x; | 
					
						
							|  |  |  |     Optional<float> m_radius_y; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |