Closed Bug 1945312 Opened 3 months ago Closed 3 months ago

Let new path data API ride the trains

Categories

(Core :: SVG, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
137 Branch
Tracking Status
relnote-firefox --- 137+
firefox137 --- fixed

People

(Reporter: longsonr, Assigned: longsonr)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

No description provided.
Assignee: nobody → longsonr
Status: NEW → ASSIGNED
Depends on: 1934525
Pushed by longsonr@gmail.com: https://hg.mozilla.org/integration/autoland/rev/20c8e2d40fd0 Let new path data API ride the trains r=emilio
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch

Added to our 137 beta release notes with this wording:

Support for the SVG 2 path API is now available.

Adding the relnote flag and keeping it open until we ship to the release channel.

relnote-firefox: --- → ?

Hey! I’m documenting this API on MDN and have a few questions:

What user-facing methods/interfaces were implemented: getPathData, setPathData, and getPathSegmentAtLength?

Is there a way to construct an SVGPathSegment sequence to use it in the setPathData method? My attempts to use an array similar to what the polyfill uses:

const pathData = [
  { type: "M", values: [0, 0] },
  { type: "h", values: [64] },
  { type: "v", values: [64] },
  { type: "h", values: [-64] },
  { type: "Z", values: [] }
]

And then setting it to the path path.setPathData(pathData) end up with an error:

Uncaught TypeError: SVGPathElement.setPathData: Element of argument 1 does not implement interface SVGPathSegment.

I can only successfully setPathData that I just got via getPathData. But I’m trying to show an example of constructing it.

Thanks!

Flags: needinfo?(longsonr)

What user-facing methods/interfaces were implemented: getPathData, setPathData, and getPathSegmentAtLength?

All of the above.

Is there a way to construct an SVGPathSegment sequence to use it in the setPathData method?

Not as far as I'm aware. See https://github.com/w3c/svgwg/issues/964

You'd need to get a SVGPathSegment from getPathData or getPathSegmentAtLength.

Flags: needinfo?(longsonr)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: