mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 22:22:45 +00:00 
			
		
		
		
	 e81594d9a1
			
		
	
	
		e81594d9a1
		
	
	
	
	
		
			
			This element doesn't actually support anything at the moment, but it still massively speeds up painting performance on Wikipedia! :^) How? Because we no longer paint SVG <path> elements found inside <clipPath> elements. SVGClipPathElement::create_layout_node() returns nullptr which stops the layout tree builder from recursing further into the subtree, and so the <path> element never gets a layout or paint box. Mousing over Wikipedia now barely break 50% CPU usage on my machine :^)
		
			
				
	
	
		
			23 lines
		
	
	
	
		
			508 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
	
		
			508 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <LibWeb/SVG/SVGElement.h>
 | |
| 
 | |
| namespace Web::SVG {
 | |
| 
 | |
| class SVGClipPathElement final : public SVGElement {
 | |
| public:
 | |
|     using WrapperType = Bindings::SVGClipPathElementWrapper;
 | |
| 
 | |
|     SVGClipPathElement(DOM::Document&, DOM::QualifiedName);
 | |
|     virtual ~SVGClipPathElement();
 | |
| 
 | |
|     virtual RefPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
 | |
| };
 | |
| 
 | |
| }
 |