Closed Bug 1714238 Opened 4 years ago Closed 8 months ago

Share data structure for SVGPathData::mData and nsStyleSVGRest::mD

Categories

(Core :: SVG, enhancement)

All
Unspecified
enhancement

Tracking

()

RESOLVED FIXED
129 Branch
Tracking Status
firefox129 --- fixed

People

(Reporter: boris, Assigned: emilio)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

We should use the similar data structure for both SVGPathData::mData and nsStyleSVGReset::mD (which is added by Bug 1340422). For now we still need a conversion from SVGPathData::mData to nsStyleSVGReset::mD when handling SVG d attribute on path element. If we share the same data structue (e.g. use StylePathComand everywhere), we can avoid unwanted conversion, for optimization.

Note: nsStyleSVGReset::mD uses the same data structure with offset-path path() function.

Summary: Share data structure for SVGPathData::mD and nsStyleSVGRest::mD → Share data structure for SVGPathData::mData and nsStyleSVGRest::mD
Blocks: 1744599
Assignee: nobody → boris.chiou
No longer blocks: 1744599
Depends on: 1745149
No longer depends on: 1388931

I update the dependency because this bug is still dependent on the removal of SVGPathSeg code, so we don't have to keep SVGPathData::mData for the DOM API. However, the shipment of d property is not strongly dependent on this bug (i.e. we just need to do some more conversions). So shipping the d property without this should be fine.

Blocks: svg-enhance

This removes a bunch of special and complex code from the SVG path code,
and simplifies fixing stuff like bug 1903361.

Assignee: boris.chiou → emilio

Hey Brian / Daniel, just sanity-checking... I don't think there's a good reason why our CSS animation behavior and SMIL behavior for path interpolation is different right? https://phabricator.services.mozilla.com/D214594 in particular shows the behavior difference. I'm aligning on the CSS behavior of always absolutizing paths before interpolation, rather than the SMIL behavior which is relativizing or absolutizing depending on which one is the right side of the interpolation (this code).

I guess https://svgwg.org/svg2-draft/paths.html#DProperty doesn't say how to interpolate one way or the other...

Flags: needinfo?(dholbert)
Flags: needinfo?(brian)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #4)

I'm aligning on the CSS behavior of always absolutizing paths before interpolation, rather than the SMIL behavior which is relativizing or absolutizing depending on which one is the right side of the interpolation

That sounds fine to me. I don't recall there being a particular reason to prefer the behavior that you're replacing here (and it sounds like it doesn't have any impact on the geometry, if I'm understanding correctly)

Flags: needinfo?(dholbert)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ff2a3385da3e Use a single SVG path representation. r=boris,longsonr,webidl,smaug https://hg.mozilla.org/integration/autoland/rev/2233e7aef1d7 Fix some tentative WPT tests to align with CSS animations and new Gecko behavior / Safari. r=longsonr
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/46868 for changes under testing/web-platform/tests

(In reply to Emilio Cobos Álvarez (:emilio) from comment #4)

Hey Brian / Daniel, just sanity-checking... I don't think there's a good reason why our CSS animation behavior and SMIL behavior for path interpolation is different right?

I'm afraid I don't recall any particular reason for aligning with the value on the RHS. It looks like heycam wrote that code. I think aligning with CSS is fine, particularly because the SVG spec doesn't even seem to require converting between relative/absolute commands ("exactly the same number and types of path data commands", emphasis added)

Flags: needinfo?(brian)
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
Upstream PR merged by moz-wptsync-bot
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: