Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 57169084beb9ad1b37ed2ea3a1ee463f79cc46d7
      
https://github.com/WebKit/WebKit/commit/57169084beb9ad1b37ed2ea3a1ee463f79cc46d7
  Author: Nikolas Zimmermann <[email protected]>
  Date:   2026-08-06 (Thu, 06 Aug 2026)

  Changed paths:
    M LayoutTests/platform/mac-tahoe-wk2-lbse-text/TestExpectations
    M Source/WebCore/rendering/CSSFilterRenderer.cpp

  Log Message:
  -----------
  [LBSE] Do not seed the filter region with the object bounding box for pure 
<filter> references
https://bugs.webkit.org/show_bug.cgi?id=321129

Reviewed by Rob Buis.

CSSFilterRenderer::expandFilterRegionForSVGReferences() started from the object
bounding box and united it with each referenced <filter> region. The bounding 
box
seed is only meaningful for the CSS shorthand functions, which operate on the
source graphic; a referenced <filter> brings its own region, and that region 
alone
decides where the filter paints.

For an element with a very large bounding box and a small userSpaceOnUse filter
region, the union grew far past the image buffer limits, so the region was 
clamped
and the resulting scale made the filter output vanish. This is what happened to
filterRegion_1 through filterRegion_6 in svg/batik/filters/filterRegions.svg, 
whose
rects are 20000000 units wide and sit at y=3000 while the filter region is
(20, 30, 50, 40). The legacy engine takes the region from the <filter> element
alone and does not have this problem.

When every function in the chain is a <filter> reference, drop the bounding box 
and
keep only the referenced regions. The reference box is unchanged, so 
objectBoundingBox
filter units still resolve as before. The code path is guarded by
FilterRenderingOption::ApplyToSVGRenderer, so HTML/CSS filters are
unaffected.

Fixes svg/batik/filters/filterRegions.svg.

* LayoutTests/platform/mac-tahoe-wk2-lbse-text/TestExpectations:
* Source/WebCore/rendering/CSSFilterRenderer.cpp:
(WebCore::CSSFilterRenderer::expandFilterRegionForSVGReferences):

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



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

Reply via email to