mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 08:52:44 +00:00 
			
		
		
		
	 92c08ad4ac
			
		
	
	
		92c08ad4ac
		
	
	
	
	
		
			
			Instead of trying to layout SVG boxes as if they are regular CSS boxes, let's invent an "SVG formatting context" and let it manage SVG boxes. To facilitate this, Layout::SVGBox no longer inherits from ReplacedBox, and is instead a simple, "inline-block" style BlockBox.
		
			
				
	
	
		
			27 lines
		
	
	
	
		
			788 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
	
		
			788 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <LibWeb/Layout/SVGGraphicsBox.h>
 | |
| #include <LibWeb/SVG/SVGSVGElement.h>
 | |
| 
 | |
| namespace Web::Layout {
 | |
| 
 | |
| class SVGSVGBox final : public SVGGraphicsBox {
 | |
| public:
 | |
|     SVGSVGBox(DOM::Document&, SVG::SVGSVGElement&, NonnullRefPtr<CSS::StyleProperties>);
 | |
|     virtual ~SVGSVGBox() override = default;
 | |
| 
 | |
|     SVG::SVGSVGElement& dom_node() { return verify_cast<SVG::SVGSVGElement>(SVGGraphicsBox::dom_node()); }
 | |
| 
 | |
|     virtual void before_children_paint(PaintContext& context, PaintPhase phase) override;
 | |
|     virtual void after_children_paint(PaintContext& context, PaintPhase phase) override;
 | |
| 
 | |
|     virtual bool can_have_children() const override { return true; }
 | |
| };
 | |
| 
 | |
| }
 |