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

  Changed paths:
    A 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/repaint/marker-markerUnits-dynamic-update-repaint-expected.txt
    A 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/repaint/marker-orient-dynamic-update-repaint-expected.txt
    M Source/WebCore/rendering/ReferencedSVGResources.cpp
    M Source/WebCore/rendering/svg/RenderSVGModelObject.h
    M Source/WebCore/rendering/svg/RenderSVGShape.cpp

  Log Message:
  -----------
  [LBSE] Dynamic marker attribute change must repaint the referencing element's 
old bounds
https://bugs.webkit.org/show_bug.cgi?id=318684

Reviewed by Rob Buis.

Changing a marker's markerUnits or orient resizes the element that references 
it, but a
referencing shape without a layer gets no post-layout position update, so 
resourceChanged()
only repainted its new (current) bounds. A shrinking marker then left its 
former area behind.

Record the visual overflow, including markers, at the end of 
RenderSVGShape::layout() via the
new updateCachedVisualOverflowRect(), so the old bounds are cached while the 
geometry is still
current. On a marker change, resourceChanged() repaints those old bounds before 
invalidating the
cache and recomputing the new ones. The extra repaint is gated to markers, 
since gradients and
patterns do not change the client's bounds.

Fixes svg/repaint/marker-markerUnits-dynamic-update-repaint.html and
svg/repaint/marker-orient-dynamic-update-repaint.html, with more accurate 
repaint rects
than the legacy engine had. The repaint rects dump tests were created instead 
of trying to
catch the repaint issue in a reftest to also cover that we're not overpainting.

* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/repaint/marker-markerUnits-dynamic-update-repaint-expected.txt:
 Added.
* 
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/repaint/marker-orient-dynamic-update-repaint-expected.txt:
 Added.
* Source/WebCore/rendering/ReferencedSVGResources.cpp:
(WebCore::CSSSVGResourceElementClient::resourceChanged):
* Source/WebCore/rendering/svg/RenderSVGModelObject.h:
(WebCore::RenderSVGModelObject::updateCachedVisualOverflowRect):
* Source/WebCore/rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::layout):

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



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

Reply via email to