| 
									
										
										
										
											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
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibGfx/Bitmap.h>
 | 
					
						
							| 
									
										
										
										
											2020-07-26 15:08:16 +02:00
										 |  |  | #include <LibWeb/HTML/HTMLElement.h>
 | 
					
						
							| 
									
										
										
										
											2022-02-11 13:08:27 +00:00
										 |  |  | #include <LibWeb/SVG/AttributeParser.h>
 | 
					
						
							| 
									
										
										
										
											2020-07-23 09:44:42 -07:00
										 |  |  | #include <LibWeb/SVG/SVGGeometryElement.h>
 | 
					
						
							| 
									
										
										
										
											2020-07-19 23:01:53 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-23 09:44:42 -07:00
										 |  |  | namespace Web::SVG { | 
					
						
							| 
									
										
										
										
											2020-07-19 23:01:53 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-23 09:44:42 -07:00
										 |  |  | class SVGPathElement final : public SVGGeometryElement { | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  |     WEB_PLATFORM_OBJECT(SVGPathElement, SVGGeometryElement); | 
					
						
							| 
									
										
										
										
											2023-11-19 19:47:52 +01:00
										 |  |  |     JS_DECLARE_ALLOCATOR(SVGPathElement); | 
					
						
							| 
									
										
										
										
											2020-10-02 20:57:28 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2020-07-23 09:44:42 -07:00
										 |  |  |     virtual ~SVGPathElement() override = default; | 
					
						
							| 
									
										
										
										
											2020-07-19 23:01:53 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-19 18:10:36 +13:00
										 |  |  |     virtual void attribute_changed(FlyString const& name, Optional<String> const& value) override; | 
					
						
							| 
									
										
										
										
											2020-10-05 16:14:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-03 20:15:06 +00:00
										 |  |  |     virtual Gfx::Path get_path(CSSPixelSize viewport_size) override; | 
					
						
							| 
									
										
										
										
											2020-07-19 23:01:53 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  |     SVGPathElement(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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-19 23:01:53 -07:00
										 |  |  |     Vector<PathInstruction> m_instructions; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-05 19:02:54 +00:00
										 |  |  | Gfx::Path path_from_path_instructions(ReadonlySpan<PathInstruction>); | 
					
						
							| 
									
										
										
										
											2022-11-29 14:06:41 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-19 23:01:53 -07:00
										 |  |  | } |