| 
									
										
										
										
											2023-05-31 00:50:12 +01:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2023, Preston Taylor <95388976+PrestonLTaylor@users.noreply.github.com> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibWeb/SVG/SVGGraphicsElement.h>
 | 
					
						
							| 
									
										
										
										
											2024-01-27 16:23:22 +00:00
										 |  |  | #include <LibWeb/SVG/SVGViewport.h>
 | 
					
						
							| 
									
										
										
										
											2023-05-31 00:50:12 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace Web::SVG { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-27 16:23:22 +00:00
										 |  |  | class SVGSymbolElement final : public SVGGraphicsElement | 
					
						
							|  |  |  |     , public SVGViewport { | 
					
						
							| 
									
										
										
										
											2023-05-31 00:50:12 +01:00
										 |  |  |     WEB_PLATFORM_OBJECT(SVGSymbolElement, SVGGraphicsElement); | 
					
						
							| 
									
										
										
										
											2023-11-19 19:47:52 +01:00
										 |  |  |     JS_DECLARE_ALLOCATOR(SVGSymbolElement); | 
					
						
							| 
									
										
										
										
											2023-05-31 00:50:12 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     virtual ~SVGSymbolElement() override = default; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     void apply_presentational_hints(CSS::StyleProperties& style) const override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-27 16:23:22 +00:00
										 |  |  |     virtual Optional<ViewBox> view_box() const override { return m_view_box; } | 
					
						
							|  |  |  |     virtual Optional<PreserveAspectRatio> preserve_aspect_ratio() const override | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         // FIXME: Support the `preserveAspectRatio` attribute on <symbol>.
 | 
					
						
							|  |  |  |         return {}; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2023-07-31 18:37:44 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-31 00:50:12 +01:00
										 |  |  | private: | 
					
						
							|  |  |  |     SVGSymbolElement(DOM::Document&, DOM::QualifiedName); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-07 08:41:28 +02:00
										 |  |  |     virtual void initialize(JS::Realm&) override; | 
					
						
							| 
									
										
										
										
											2023-05-31 00:50:12 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-19 19:42:31 +02:00
										 |  |  |     virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-31 00:50:12 +01:00
										 |  |  |     bool is_direct_child_of_use_shadow_tree() const; | 
					
						
							| 
									
										
										
										
											2023-07-31 18:37:44 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-19 18:10:36 +13:00
										 |  |  |     virtual void attribute_changed(FlyString const& name, Optional<String> const& value) override; | 
					
						
							| 
									
										
										
										
											2023-07-31 18:37:44 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     Optional<ViewBox> m_view_box; | 
					
						
							| 
									
										
										
										
											2023-05-31 00:50:12 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |