Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8c0c37ea12f307d85187524b5d7266b02a4f7b1b
      
https://github.com/WebKit/WebKit/commit/8c0c37ea12f307d85187524b5d7266b02a4f7b1b
  Author: Nikolas Zimmermann <[email protected]>
  Date:   2026-07-06 (Mon, 06 Jul 2026)

  Changed paths:
    M Source/WebCore/rendering/svg/RenderSVGRoot.cpp
    M Source/WebCore/rendering/svg/RenderSVGViewportContainer.cpp
    M Source/WebCore/svg/SVGSVGElement.cpp
    M Source/WebCore/svg/SVGSVGElement.h

  Log Message:
  -----------
  [LBSE] Cache the SVG viewport size used for the transform reference box
https://bugs.webkit.org/show_bug.cgi?id=318546

Reviewed by Rob Buis.

currentViewportSizeExcludingZoom() resolves to the SVG root's content box on
every call, but the viewport is constant after layout. The default SVG
transform-box is view-box, so every transformed shape's reference box re-queried
it per frame -- from both updateLocalTransform() and during paint in
computeRendererTransformForSVG().

Cache it on SVGSVGElement - flush in RenderSVGRoot::layout() and
RenderSVGViewportContainer::updateLayoutSizeIfNeeded(), which run on
resize/zoom/viewBox changes.

Covered by existing tests.

* Source/WebCore/rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::layout):
* Source/WebCore/rendering/svg/RenderSVGViewportContainer.cpp:
(WebCore::RenderSVGViewportContainer::updateLayoutSizeIfNeeded):
* Source/WebCore/svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::currentViewportSizeExcludingZoom const):
(WebCore::SVGSVGElement::computeCurrentViewportSizeExcludingZoom const):
* Source/WebCore/svg/SVGSVGElement.h:

Canonical link: https://commits.webkit.org/316545@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to