1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 03:18:11 +00:00

LibWeb: Sketch out a very basic SVG <clipPath> element

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 :^)
This commit is contained in:
Andreas Kling 2022-04-10 19:05:12 +02:00
parent c6e79124c7
commit e81594d9a1
8 changed files with 68 additions and 0 deletions

View file

@ -267,6 +267,8 @@
#include <LibWeb/Bindings/ResizeObserverPrototype.h>
#include <LibWeb/Bindings/SVGCircleElementConstructor.h>
#include <LibWeb/Bindings/SVGCircleElementPrototype.h>
#include <LibWeb/Bindings/SVGClipPathElementConstructor.h>
#include <LibWeb/Bindings/SVGClipPathElementPrototype.h>
#include <LibWeb/Bindings/SVGElementConstructor.h>
#include <LibWeb/Bindings/SVGElementPrototype.h>
#include <LibWeb/Bindings/SVGEllipseElementConstructor.h>
@ -484,6 +486,7 @@
ADD_WINDOW_OBJECT_INTERFACE(SubtleCrypto) \
ADD_WINDOW_OBJECT_INTERFACE(SVGElement) \
ADD_WINDOW_OBJECT_INTERFACE(SVGCircleElement) \
ADD_WINDOW_OBJECT_INTERFACE(SVGClipPathElement) \
ADD_WINDOW_OBJECT_INTERFACE(SVGEllipseElement) \
ADD_WINDOW_OBJECT_INTERFACE(SVGGeometryElement) \
ADD_WINDOW_OBJECT_INTERFACE(SVGGraphicsElement) \