mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 15:42:44 +00:00 
			
		
		
		
	 28b771560a
			
		
	
	
		28b771560a
		
	
	
	
	
		
			
			This makes SVG-in-HTML behave quite a bit better by following general replaced layout rules. It also turns <svg> elements into inline-level boxes instead of block-level boxes.
		
			
				
	
	
		
			22 lines
		
	
	
	
		
			531 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
	
		
			531 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <LibWeb/Layout/ReplacedBox.h>
 | |
| #include <LibWeb/Painting/SVGSVGPaintable.h>
 | |
| 
 | |
| namespace Web::Layout {
 | |
| 
 | |
| SVGSVGBox::SVGSVGBox(DOM::Document& document, SVG::SVGSVGElement& element, NonnullRefPtr<CSS::StyleProperties> properties)
 | |
|     : ReplacedBox(document, element, move(properties))
 | |
| {
 | |
| }
 | |
| 
 | |
| RefPtr<Painting::Paintable> SVGSVGBox::create_paintable() const
 | |
| {
 | |
|     return Painting::SVGSVGPaintable::create(*this);
 | |
| }
 | |
| 
 | |
| }
 |