Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6fd2e01a5273642242a6a11bc3345348eb2b7319
      
https://github.com/WebKit/WebKit/commit/6fd2e01a5273642242a6a11bc3345348eb2b7319
  Author: Nikolas Zimmermann <[email protected]>
  Date:   2026-06-13 (Sat, 13 Jun 2026)

  Changed paths:
    M Source/WebCore/rendering/svg/SVGBoundingBoxComputation.cpp
    M Source/WebCore/rendering/svg/SVGTransformComputation.h

  Log Message:
  -----------
  [LBSE] Include descendant transforms in SVG visual overflow
https://bugs.webkit.org/show_bug.cgi?id=317071

Reviewed by Rob Buis.

The SVG visual overflow rect ignored the transforms of non-layer
descendants. Such a descendant paints directly into its container, so its
transformed bounds belong to the container's overflow. Ignoring them
under-sized the box and clipped content whose painted position is shifted by
a nested transformed <g> or nested <svg> with viewBox.

The fix stops computeVisualOverflowRect from passing IgnoreTransformations so
descendant transforms are included, while 
objectBoundingBoxWithoutTransformations
keeps its flattened convention.

Because computeAccumulatedTransform stops at the parent of stopAtRenderer, it
baked that renderer's own transform into the result - this is necessary for
getCTM()/getScreenCTM() but double-counts in the bounding-box recursion once
the container is mapped by its parent, so a new StopAtRendererTransform enum
(default Include) lets that recursion pass Exclude.

Finally, the viewport-container overflow clip is now requested at origin (0,0)
so it lands in the box's local space fixing overflow clipping both under
conditional and forced layer creation.

* Source/WebCore/rendering/svg/SVGBoundingBoxComputation.cpp:
(WebCore::SVGBoundingBoxComputation::handleRootOrContainer const):
(WebCore::SVGBoundingBoxComputation::computeVisualOverflowRect):
* Source/WebCore/rendering/svg/SVGTransformComputation.h:
(WebCore::SVGTransformComputation::computeAccumulatedTransform const):

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



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

Reply via email to