Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 49d0165dc35c18492fe0b1ac841f86ec583a7bc0
https://github.com/WebKit/WebKit/commit/49d0165dc35c18492fe0b1ac841f86ec583a7bc0
Author: Nikolas Zimmermann <[email protected]>
Date: 2026-08-07 (Fri, 07 Aug 2026)
Changed paths:
M
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/W3C-SVG-1.1/masking-mask-01-b-expected.png
M
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/W3C-SVG-1.1/masking-path-01-b-expected.png
M
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/custom/absolute-sized-content-with-resources-expected.png
M
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/custom/grayscale-gradient-mask-2-expected.png
M
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/custom/grayscale-gradient-mask-expected.png
M
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/transforms/text-with-mask-with-svg-transform-expected.png
M
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/zoom/page/zoom-mask-with-percentages-expected.png
M Source/WebCore/rendering/RenderLayer.cpp
Log Message:
-----------
[LBSE] Masked SVG content is cut off at the edges of the transparency layer
bound
https://bugs.webkit.org/show_bug.cgi?id=321289
Reviewed by Simon Fraser.
RenderSVGResourceMasker sizes and draws its mask image over
enclosingIntRect(absoluteTransform.mapRect(decoratedBounds)), the enclosing
integer rect of the mask content bounds in device space. Perform the clip for
the transparency layer in the same way, otherwise the edge pixels of the masked
content are lost. SVG content below the SVG root is not snapped to device
pixels and its bound is in the local coordinate system that the CTM scales, so
do the rounding in the context's device space. The same applies to a clipper
applied as a mask.
The bound was wrong for SVG in a second way. An SVG renderer that is a box
(<text>, <foreignObject>)
used the CSS mask clip rect, which comes from the
border box and leaves out the SVG content that spills outside it. The visual
overflow rect already covers the mask resource, so use that instead.
*
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/W3C-SVG-1.1/masking-mask-01-b-expected.png:
*
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/W3C-SVG-1.1/masking-path-01-b-expected.png:
*
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/custom/absolute-sized-content-with-resources-expected.png:
*
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/custom/grayscale-gradient-mask-2-expected.png:
*
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/custom/grayscale-gradient-mask-expected.png:
*
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/transforms/text-with-mask-with-svg-transform-expected.png:
*
LayoutTests/platform/mac-tahoe-wk2-lbse-text/svg/zoom/page/zoom-mask-with-percentages-expected.png:
*
Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::clipRectForTransparencyLayer):
(WebCore::RenderLayer::beginTransparencyLayers):
(WebCore::RenderLayer::calculateClipRects const):
Canonical link:
https://flagged.apple.com:443/proxy?t2=Dw7v1I8od6&o=aHR0cHM6Ly9jb21taXRzLndlYmtpdC5vcmcvMzE4ODE2QG1haW4=&emid=d9bbf7b5-6a54-4b44-9193-205f732414c8&c=11
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications