mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-08 16:12:23 +02:00
Previously, any SVG geometry attribute change would mark the entire document layout tree as dirty, triggering a full layout pass even though only the SVG subtree was affected. This made SVG geometry animations unnecessarily expensive. Fix this by stopping `needs_layout_update` propagation at the SVGSVGBox boundary and tracking dirty SVG roots separately on the Document. When `update_layout()` finds that only SVG roots need relayout (and the document layout root is clean), it runs SVGFormattingContext on each dirty SVG root in a fresh LayoutState and commits the results directly, bypassing the full document layout pass entirely. This results in a substantial performance improvement on pages with animated SVGs, such as https://www.cloudflare.com/, https://www.duolingo.com/, and our GC graph explorer page.
37 KiB
37 KiB