mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 22:12:44 +00:00 
			
		
		
		
	 b9afea40e6
			
		
	
	
		b9afea40e6
		
	
	
	
	
		
			
			This will allow resolving paths that use sizes that are relative to the viewport. This necessarily removes the on element caching, which has been redundant for a while as computed paths are stored on the paintable.
		
			
				
	
	
		
			32 lines
		
	
	
	
		
			861 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
	
		
			861 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <LibWeb/Geometry/DOMPoint.h>
 | |
| #include <LibWeb/SVG/SVGGraphicsElement.h>
 | |
| 
 | |
| namespace Web::SVG {
 | |
| 
 | |
| // https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement
 | |
| class SVGGeometryElement : public SVGGraphicsElement {
 | |
|     WEB_PLATFORM_OBJECT(SVGGeometryElement, SVGGraphicsElement);
 | |
| 
 | |
| public:
 | |
|     virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
 | |
| 
 | |
|     virtual Gfx::Path get_path(CSSPixelSize viewport_size) = 0;
 | |
| 
 | |
|     float get_total_length();
 | |
|     JS::NonnullGCPtr<Geometry::DOMPoint> get_point_at_length(float distance);
 | |
| 
 | |
| protected:
 | |
|     SVGGeometryElement(DOM::Document& document, DOM::QualifiedName qualified_name);
 | |
| 
 | |
|     virtual void initialize(JS::Realm&) override;
 | |
| };
 | |
| 
 | |
| }
 |