Closed Bug 1340422 Opened 7 years ago Closed 3 years ago

Implement path() on `d` property on SVG path element

Categories

(Core :: SVG, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: 709922234, Assigned: boris)

References

(Blocks 3 open bugs, )

Details

(Keywords: dev-doc-complete, Whiteboard: [layout:backlog], [wptsync upstream])

Attachments

(12 files, 1 obsolete file)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
245.56 KB, image/png
Details
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0
Build ID: 20170201180315
http://codepen.io/airen/pen/wgNEQo

Can create tween animation
Your syntax is invalid, the path keyword is incorrect. Nevertheless even without path we don't currently support this SVG 2 feature.
Component: Activity Streams: General → SVG
Product: Firefox → Core
Priority: -- → P3
See Also: → 1383650
Blocks: svg2
Summary: Implement `d` css property → Implement `d` property on SVG path element
Status: UNCONFIRMED → NEW
Ever confirmed: true

This should be addressed in https://github.com/w3c/svgwg/issues/320. Not merged yet, so let's wait.

To be clear, d property/attribute doesn't support path() function, so Gecko cannot render the path correctly.

Summary: Implement `d` property on SVG path element → Implement path() on `d` property on SVG path element
Type: defect → enhancement
Whiteboard: [layout:backlog]

Now that we triage by severity, setting this bug's priority to P2 to represent near-term backlog status. See https://wiki.mozilla.org/Platform/Layout#Backlog_Tracking_in_Bugzilla

Priority: P3 → P2

We parse the attribute and store into CSS.

Attachment #9159527 - Attachment description: Bug 1340422 - Add SVG d property in CSS. → Bug 1340422 - Part 1: Add SVG d property in CSS.
Attachment #9159528 - Attachment description: Bug 1340422 - Map SVG d property to CSS. → Bug 1340422 - Part 2: Map SVG d attribute to CSS.

Use the style value when building the SVG path and its display items.
Besides, we should also invalid the cache when there are any CSS updates.

Unfortunately, we still have to convert the cpp version into rust version.
However, it's still better than parsing it again.

Now we have d property, so the list of auto completion should include d
property when typing 'd'. We need to add more tabs or up/down keys to
choose the keyword we want.

Attachment #9223073 - Attachment description: Bug 1340422 - Enable pref on nightly. → Bug 1340422 - Part 10: Enable pref on nightly.
Assignee: nobody → boris.chiou
Status: NEW → ASSIGNED

This will be merged into part 3 after getting r+.

Blocks: 1714238

When using a mpath elememt which linked to a external path element, we use
GetDistancesFromOriginToEndsOfVisibleSegments() to do a quick check if we
really need to build the path (note: see
SVGMotionSMILAnimationFunction::RebuildPathAndVerticesFromMpathElem),
so we have to get the d property value from style in this function.

Attachment #9223073 - Attachment description: Bug 1340422 - Part 10: Enable pref on nightly. → Bug 1340422 - Part 11: Enable pref on nightly.
Attachment #9224096 - Attachment is obsolete: true
Attachment #9222743 - Attachment description: Bug 1340422 - Part 4: Resolve SVG Mark points of path from CSS. → Bug 1340422 - Part 4: Resolve SVG Marker points of path from CSS.
Blocks: 1715387
Blocks: 1715404
Pushed by bchiou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8e60664181ba
Part 1: Add SVG d property in CSS. r=emilio
https://hg.mozilla.org/integration/autoland/rev/44fd66676b8c
Part 2: Map SVG d attribute to CSS. r=emilio
https://hg.mozilla.org/integration/autoland/rev/8ae9761a40ee
Part 3: Resolve SVG path from CSS. r=emilio
https://hg.mozilla.org/integration/autoland/rev/22a2ccbad39c
Part 4: Resolve SVG Marker points of path from CSS. r=emilio
https://hg.mozilla.org/integration/autoland/rev/a1b8cf1afda3
Part 5: Factor out some utility inline functions in SVGPathData.cpp. r=emilio
https://hg.mozilla.org/integration/autoland/rev/1321ace60cdd
Part 6: Factor out part of Elliptical arc implementation. r=emilio
https://hg.mozilla.org/integration/autoland/rev/f3fd6d964758
Part 7: Notify style system when SMIL animation changes d attribute. r=emilio
https://hg.mozilla.org/integration/autoland/rev/b6d681d6d66d
Part 8: Optimize attribute mapping by not parsing svg path string again. r=emilio
https://hg.mozilla.org/integration/autoland/rev/b26fb23539f7
Part 9: Update devtool tests for auto-completion. r=jdescottes
https://hg.mozilla.org/integration/autoland/rev/4ee3b8eb9c61
Part 10: Use style for GetDistancesFromOriginToEndsOfVisibleSegments(). r=emilio
https://hg.mozilla.org/integration/autoland/rev/52f82029a1e5
Part 11: Enable pref on nightly. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/29318 for changes under testing/web-platform/tests
Whiteboard: [layout:backlog] → [layout:backlog], [wptsync upstream]

Hooray! Happy to see this fixed :)

Upstream PR merged by moz-wptsync-bot

This doesn't appear fixed, or maybe there's another bug?
https://codepen.io/therealmarcone/pen/OJjeBpw draws the path in Chrome, but not in Firefox 94.0.2 nor in 78.15.0esr.

(In reply to marco.nelissen from comment #25)

This doesn't appear fixed, or maybe there's another bug?
https://codepen.io/therealmarcone/pen/OJjeBpw draws the path in Chrome, but not in Firefox 94.0.2 nor in 78.15.0esr.

Did you enable the preference (i.e. layout.css.d-property.enabled)? I saw a path inside the button. The preference is enabled on only Nightly channel now.

The result on Nightly for the test in comment 25.

No, I didn't enable the preference, because I didn't realize that was necessary in order to actually enable a bugfix from 6 months ago in a build from 2 days ago. Will it ever be enabled by default?

(In reply to marco.nelissen from comment #28)

No, I didn't enable the preference, because I didn't realize that was necessary in order to actually enable a bugfix from 6 months ago in a build from 2 days ago. Will it ever be enabled by default?

Yes. We would like to enable it by default after finishing Bug 1714238 and Bug 1715387.

Blocks: 1744599
Regressions: 1864378
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: