RESOLVED FIXED303972
REGRESSION (293922@main): Incorrect rendering of SVG path element arc command
https://bugs.webkit.org/show_bug.cgi?id=303972
Summary REGRESSION (293922@main): Incorrect rendering of SVG path element arc command
Suman Nepal
Reported 2025-12-10 21:51:42 PST
According to the SVG spec for elliptical arcs, if rx = 0 or ry = 0 then this arc is treated as a straight line segment (a "lineto") joining the endpoints. https://www.w3.org/TR/2011/REC-SVG11-20110816/implnote.html#ArcImplementationNotes so an element like <path d="M150,250 A120,140 0 0 1 220,240" fill="none" stroke="purple" stroke-width="3" /> should result in straight line. However in the recent version of safari, the path is simply not rendered. When combined with other path commands, this can cause completely different visuals for same commands from the previous version. Steps to reproduce: The following simple svg renders 2 vertical lines, and one curve using paths with arc commands. <svg width="350" height="350" style="background:#f8f8f8"> <circle cx="150" cy="250" r="4" fill="red" /> <text x="160" y="250" font-size="12" fill="red">M</text> <path d="M150,250 A0,80 0 0 0 150,150" fill="none" stroke="blue" stroke-width="3" /> <text x="155" y="200" font-size="12" fill="blue">Arc 1 (vertical)</text> <path d="M150,250 A120,140 0 0 1 220,240" fill="none" stroke="purple" stroke-width="3" /> <text x="200" y="255" font-size="12" fill="purple">Arc 2 (curved)</text> <path d="M220,240 A0,60 0 0 0 220,160" fill="none" stroke="orange" stroke-width="3" /> <text x="225" y="205" font-size="12" fill="orange">Arc 3 (vertical)</text> </svg> JSFiddle with above example : https://jsfiddle.net/djv69tc4/ Expected Results: The vertical lines should be rendered, and the shape should match as rendered in safari version < 26, firefox and chrome. Build 304274@main December 10, 2025 at 10:19 PM EST on macOS 26.1 More examples to compare : https://jsfiddle.net/y9qhtLx6/5/ https://www.oracle.com/webfolder/technetwork/jet/jetCookbook.html?component=funnelChart&demo=default
Attachments
rendering in safari, firefox, chrome (379.80 KB, image/png)
2025-12-15 15:50 PST, Karl Dubost
no flags
Radar WebKit Bug Importer
Comment 1 2025-12-11 09:27:57 PST
Said Abou-Hallawa
Comment 2 2025-12-15 15:35:53 PST
This is a regression of 293922@main.
Karl Dubost
Comment 3 2025-12-15 15:44:14 PST
Notes to myself: What does svg2 say as of today? https://svgwg.org/svg2-draft/paths.html#ArcOutOfRangeParameters ====================================== 9.5.1. Out-of-range elliptical arc parameters Arbitrary numerical values are permitted for all elliptical arc parameters (other than the boolean flags), but user agents must make the following adjustments for invalid values when rendering curves or calculating their geometry: If the endpoint (x, y) of the segment is identical to the current point (e.g., the endpoint of the previous segment), then this is equivalent to omitting the elliptical arc segment entirely. If either rx or ry is 0, then this arc is treated as a straight line segment (a "lineto") joining the endpoints. If either rx or ry have negative signs, these are dropped; the absolute value is used instead. If rx, ry and x-axis-rotation are such that there is no solution (basically, the ellipse is not big enough to reach from the current point to the new endpoint) then the ellipse is scaled up uniformly until there is exactly one solution (until the ellipse is just big enough). See the appendix section Correction of out-of-range radii for mathematical formula for this scaling operation. This forgiving yet consistent treatment of out-of-range values ensures that: The inevitable approximations arising from computer arithmetic cannot cause a valid set of values written by one SVG implementation to be treated as invalid when read by another SVG implementation. This would otherwise be a problem for common boundary cases such as a semicircular arc. Continuous animations that cause parameters to pass through invalid values are not a problem. The motion remains continuous. ======================================
Karl Dubost
Comment 4 2025-12-15 15:50:37 PST
Created attachment 477738 [details] rendering in safari, firefox, chrome Safari Technology Preview 233 21624.1.3 Firefox Nightly 147.0a1 14725.12.3 Google Chrome Canary 145.0.7576.0 7576.0
Karl Dubost
Comment 5 2025-12-15 15:52:02 PST
Thanks a lot Suman for finding this regression and providing a testcase.
Said Abou-Hallawa
Comment 6 2025-12-15 16:21:36 PST
EWS
Comment 7 2025-12-15 18:55:14 PST
Committed 304489@main (82b47451b7aa): <https://commits.webkit.org/304489@main> Reviewed commits have been landed. Closing PR #55439 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.