Skip to content

[SVGPathDataAPI] Tracking issue for SVG Path Data API explainer #1289

@viralipurbey

Description

@viralipurbey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions