Summary
Explainer for adding getPathData(), setPathData(), and getPathSegmentAtLength() to SVGPathElement in Chromium.
Explainer: SVG/SVGPathDataAPI/explainer.md
Problem
Chrome removed the old SVGPathSegList API in Chrome 48 (2015). The SVG WG specified a simpler replacement in the SVG Paths spec, but it was never implemented — leaving Chrome with no native segment-level path access for 10+ years. Developers must use polyfills or manual string parsing.
Proposed API
getPathData(settings) — returns path segments as {type, values} plain objects
setPathData(pathData) — sets path from an array of {type, values} objects
getPathSegmentAtLength(distance) — returns the segment at a given path length
Supports normalization ({normalize: true}) to reduce all commands to M, L, C, Z.
Status
- Firefox: Shipped in v137 (Jan 2025)
- Safari: Not yet (still ships old
SVGPathSegList)
- Chrome: Not yet — this explainer proposes implementation
Related links
Please file feedback on this issue. See the explainer for full details.
Summary
Explainer for adding
getPathData(),setPathData(), andgetPathSegmentAtLength()toSVGPathElementin Chromium.Explainer: SVG/SVGPathDataAPI/explainer.md
Problem
Chrome removed the old
SVGPathSegListAPI in Chrome 48 (2015). The SVG WG specified a simpler replacement in the SVG Paths spec, but it was never implemented — leaving Chrome with no native segment-level path access for 10+ years. Developers must use polyfills or manual string parsing.Proposed API
getPathData(settings)— returns path segments as{type, values}plain objectssetPathData(pathData)— sets path from an array of{type, values}objectsgetPathSegmentAtLength(distance)— returns the segment at a given path lengthSupports normalization (
{normalize: true}) to reduce all commands to M, L, C, Z.Status
SVGPathSegList)Related links
Please file feedback on this issue. See the explainer for full details.