mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 08:12:43 +00:00 
			
		
		
		
	 0e12503586
			
		
	
	
		0e12503586
		
	
	
	
	
		
			
			As part of this move properties/methods to the correct subclass
(position related properties go under SVGTextPositioningElement).
SVG text element hierarchy:
  SVGTextContentElement
           ^- SVGTextPositioningElement
                     ^- SVGTextElement
                     ^- SVGTSpanElement
           ^- SVGTextPathElement (TODO)
           ^- SVGTRefElement (TODO)
		
	
			
		
			
				
	
	
		
			33 lines
		
	
	
	
		
			1,011 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
	
		
			1,011 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2023, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/Optional.h>
 | |
| #include <LibWeb/Layout/SVGGraphicsBox.h>
 | |
| #include <LibWeb/SVG/SVGTextPositioningElement.h>
 | |
| 
 | |
| namespace Web::Layout {
 | |
| 
 | |
| class SVGTextBox final : public SVGGraphicsBox {
 | |
|     JS_CELL(SVGTextBox, SVGGraphicsBox);
 | |
| 
 | |
| public:
 | |
|     SVGTextBox(DOM::Document&, SVG::SVGTextPositioningElement&, NonnullRefPtr<CSS::StyleProperties>);
 | |
|     virtual ~SVGTextBox() override = default;
 | |
| 
 | |
|     SVG::SVGTextPositioningElement& dom_node() { return static_cast<SVG::SVGTextPositioningElement&>(SVGGraphicsBox::dom_node()); }
 | |
|     SVG::SVGTextPositioningElement const& dom_node() const { return static_cast<SVG::SVGTextPositioningElement const&>(SVGGraphicsBox::dom_node()); }
 | |
| 
 | |
|     Optional<Gfx::AffineTransform> layout_transform() const;
 | |
| 
 | |
|     virtual JS::GCPtr<Painting::Paintable> create_paintable() const override;
 | |
| 
 | |
| private:
 | |
|     CSSPixelPoint viewbox_origin() const;
 | |
| };
 | |
| 
 | |
| }
 |