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

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

  Log Message:
  -----------
  [LBSE] Apply filters specified on the outermost <svg>
https://bugs.webkit.org/show_bug.cgi?id=321427

Reviewed by Alejandro G. Castro.

A filter on an outermost <svg> was either dropped entirely or set up with the 
wrong
geometry under the layer-based SVG engine.

RenderLayer::shouldPaintWithFilters() bailed out for any SVG root referencing a
<filter>. That is correct for the legacy engine, where LegacyRenderSVGRoot 
applies
the referenced filter itself through 
SVGRenderingContext::prepareToRenderSVGContent()
and the layer must not apply it a second time. The layer-based engine has no 
such path,
RenderSVGRoot relies on its layer, exactly like an HTML box with 'filter: 
url(...)' -
so the filter was silently never applied. Fix that behavior for LBSE.

RenderLayerFilters::beginFilterEffect() then treated RenderSVGRoot as a renderer
whose filter lives in SVG user space, seeding the filter region and the 
reference
box from objectBoundingBox() and scaling by the accumulated SVG ancestor 
transform.
The outermost <svg> is a replaced element in the CSS box tree: its filter 
resolves
against its border box, in its container's coordinate system, not against the 
SVG
user space its children live in - fix that too.

Fixes svg/filters/filter-specified-on-svg-root.html and 
svg/filters/filter-image-ref-root.html.

* LayoutTests/platform/mac-tahoe-wk2-lbse-text/TestExpectations:
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::shouldPaintWithFilters const):
(WebCore::RenderLayer::paintLayerContents):
* Source/WebCore/rendering/RenderLayerFilters.cpp:
(WebCore::RenderLayerFilters::beginFilterEffect):
(WebCore::RenderLayerFilters::applyFilterEffect):

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



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

Reply via email to