Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 48f0a2d2fe553bb66088d7158e509f6c01b44321
      
https://github.com/WebKit/WebKit/commit/48f0a2d2fe553bb66088d7158e509f6c01b44321
  Author: Nikolas Zimmermann <[email protected]>
  Date:   2026-08-19 (Wed, 19 Aug 2026)

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

  Log Message:
  -----------
  [LBSE] Cache the SVG viewport size used for length resolution
https://bugs.webkit.org/show_bug.cgi?id=322055

Reviewed by Said Abou-Hallawa.

SVGLengthContext::computeViewportSize() resolves a descendant's viewport
size from the nearest <svg> by recomputing currentViewBoxRect() on every
call. During a transform animation this runs once per shape per frame,
even though the viewport is invariant across the flush and identical for
all shapes under the same <svg>.

Cache the derived size - mirroring the existing logic used already for
m_cachedViewportSizeExcludingZoom.

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/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::computeViewportSize const):
* Source/WebCore/svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::viewportSizeForLengthResolution const):
* Source/WebCore/svg/SVGSVGElement.h:

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



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

Reply via email to