Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 834967406989dc98e038dc03a810f085db79738a
      
https://github.com/WebKit/WebKit/commit/834967406989dc98e038dc03a810f085db79738a
  Author: Nikolas Zimmermann <[email protected]>
  Date:   2026-06-12 (Fri, 12 Jun 2026)

  Changed paths:
    A LayoutTests/svg/transforms/transformed-container-self-outline-expected.svg
    A LayoutTests/svg/transforms/transformed-container-self-outline.svg
    M Source/WebCore/rendering/RenderLayerSVGAdditions.cpp

  Log Message:
  -----------
  [LBSE] Position non-layered transformed SVG content in the paint transform 
recursion
https://bugs.webkit.org/show_bug.cgi?id=316943

Reviewed by Rob Buis.

An SVG renderer with a 2D transform but no RenderLayer is painted by walking
the transform recursion in paintRendererByApplyingTransformForSVG() rather than
through the RenderLayer paint paths. This makes that recursion position 
containers,
text and shape content correctly without a self-painting layer.

computeRendererTransform() undoes the alignReferenceBox shift that
transformReferenceBoxRect() applies to non-layer renderers. That correction was
keyed on RenderSVGModelObject, which excludes RenderSVGText - it now applies to
every non-layered isSVGLayerAwareRenderer(), so text is covered too.

paintRendererByApplyingTransformForSVG() folds its separate container and leaf
branches into a shared paintInScope() helper. A renderer paints its own content
at paintOffset + currentSVGLayoutLocation(), so at a transform-scope root the
self offset is (nominal - current), placing content at its visual top-left.
This drives shapes, images, text and a container's own outline uniformly -
containers also recurse into their children from the nominal origin, with the
anonymous outermost viewport starting at (0, 0).

The code stays dormant until requiresLayer() becomes conditional.
Add a test for outlines on transformed containers that was broken in the
conditional layer LBSE variant, and is now fixed.

Tests: svg/transforms/transformed-container-self-outline.svg

* LayoutTests/svg/transforms/transformed-container-self-outline-expected.svg: 
Added.
* LayoutTests/svg/transforms/transformed-container-self-outline.svg: Added.
* Source/WebCore/rendering/RenderLayerSVGAdditions.cpp:
(WebCore::RenderLayer::computeRendererTransformForSVG const):
(WebCore::RenderLayer::paintRendererByApplyingTransformForSVG):

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



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

Reply via email to