Bug 244163

Summary: spreadMethod="reflect" doesn't work on radial gradients
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ahmad.saleem792, karlcow, sabouhallawa, simon.fraser, webkit-bug-importer, zimmermann
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=232731
Attachments:
Description Flags
Repro case
none
rendering in safari, firefox, chrome none

Myles C. Maxfield
Reported 2022-08-20 14:54:02 PDT
Created attachment 461772 [details] Repro case Open the attached SVG file in WebKit and Chrome. spreadMethod="reflect" doesn't seem to be applied.
Attachments
Repro case (658 bytes, image/svg+xml)
2022-08-20 14:54 PDT, Myles C. Maxfield
no flags
rendering in safari, firefox, chrome (1.58 MB, image/png)
2026-01-13 23:15 PST, Karl Dubost
no flags
Radar WebKit Bug Importer
Comment 1 2022-08-20 14:54:25 PDT
Ahmad Saleem
Comment 2 2023-06-14 17:00:44 PDT
This seems to be duplicate of bug 223083 and bug 232731. bug 232731 seems to be broad in context talking about all possible methods, so I think we can mark other this and bug 223083 as duplicate of bug 232731. @Said / Myles - any comment, before I do so and in bug 232731, we can also add 189739 as 'See Also' to follow development on WPE and GTK.
Karl Dubost
Comment 3 2026-01-13 23:11:55 PST
https://svgwg.org/svg2-draft/pservers.html#RadialGradientElementSpreadMethodAttribute spreadMethod = "pad | reflect | repeat" Indicates what happens if the gradient starts or ends inside the bounds of the object(s) being painted by the gradient. Has the same values and meanings as the ‘spreadMethod’ attribute on ‘linearGradient’ element. initial value pad Animatable yes https://searchfox.org/wubkat/rev/021be8e5aefd8742e091c6369be13fd745207359/Source/WebCore/rendering/svg/RenderSVGResourceRadialGradient.cpp#70 ```cpp platformSpreadMethodFromSVGType(m_attributes->spreadMethod()), ``` and https://searchfox.org/wubkat/rev/021be8e5aefd8742e091c6369be13fd745207359/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp#50-64 ```cpp GradientSpreadMethod RenderSVGResourceGradient::platformSpreadMethodFromSVGType(SVGSpreadMethodType method) const { switch (method) { case SVGSpreadMethodUnknown: case SVGSpreadMethodPad: return GradientSpreadMethod::Pad; case SVGSpreadMethodReflect: return GradientSpreadMethod::Reflect; case SVGSpreadMethodRepeat: return GradientSpreadMethod::Repeat; } ASSERT_NOT_REACHED(); return GradientSpreadMethod::Pad; } ``` https://searchfox.org/wubkat/rev/021be8e5aefd8742e091c6369be13fd745207359/Source/WebCore/rendering/svg/legacy/LegacyRenderSVGResourceGradient.cpp#364-378 ```cpp GradientSpreadMethod LegacyRenderSVGResourceGradient::platformSpreadMethodFromSVGType(SVGSpreadMethodType method) { switch (method) { case SVGSpreadMethodUnknown: case SVGSpreadMethodPad: return GradientSpreadMethod::Pad; case SVGSpreadMethodReflect: return GradientSpreadMethod::Reflect; case SVGSpreadMethodRepeat: return GradientSpreadMethod::Repeat; } ASSERT_NOT_REACHED(); return GradientSpreadMethod::Pad; } ``` It seems ro be defined, so why is it not applied.
Karl Dubost
Comment 4 2026-01-13 23:15:08 PST
Created attachment 478002 [details] rendering in safari, firefox, chrome This renders differently in Safari.
Karl Dubost
Comment 5 2026-01-13 23:16:06 PST
On Bug 232731 Ahmad seems to have the start of a patch.
Karl Dubost
Comment 6 2026-01-13 23:24:21 PST
*** This bug has been marked as a duplicate of bug 122856 ***
Note You need to log in before you can comment on or make changes to this bug.