[css-shapes-1] Implement shape() function for clip-path
Categories
(Core :: CSS Parsing and Computation, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox126 | --- | fixed |
People
(Reporter: dholbert, Assigned: boris)
References
(Blocks 2 open bugs)
Details
(Keywords: dev-doc-complete)
Attachments
(3 files)
css-shapes-2 defines a shape() function:
https://drafts.csswg.org/css-shapes-2/#shape-function
...which the spec seems to describe as being syntactic sugar for the harder-to-read path() function.
Some tests already exist for this, e.g. this test which happens to be part of the interop-2023-cssmasking effort:
https://wpt.fyi/results/css/css-masking/parsing/clip-path-shape-parsing.html
(Here's the pull request that added that test, for reference.)
(Note that all of our current subtest passes in that^ test are trivial; they're just testing for invalid syntax to be rejected. We do reject it, because we don't recognize the syntax at all.)
| Reporter | ||
Updated•3 years ago
|
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 1•2 years ago
|
||
We will handle the interpolation between shape() and path() later in
this patch series.
Also, PathCommand will reuse GenericShapeCommand. We will do that in the
next patch.
| Assignee | ||
Comment 2•2 years ago
|
||
Also, we don't have Unkonwn type, so we have to do some minor
refactoring in BuildPath(), and templatize this function so we can use
it for both shape() and path().
This patch doesn't change the behavior.
Note that we instantiate BuildPath() with CSSFloat for now. Once we
instantiate it for StyleAngle and LengthPercentage (i.e. shape()), we
have to tweak this function more. Let's do that in the next patch.
| Assignee | ||
Comment 3•2 years ago
|
||
| Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
Comment 6•2 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/7f73d7224fdc
https://hg.mozilla.org/mozilla-central/rev/266fe352539f
https://hg.mozilla.org/mozilla-central/rev/27f7a56246fb
Comment 9•2 years ago
|
||
:boris could you consider nominating this for a release note? (Process info)
We could include it in the nightly release notes.
| Assignee | ||
Comment 10•2 years ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: This is a new feature on Firefox. We support shape() function on clip-path property now. It provides a better CSS syntax for path commands (compared with path(), which uses SVG Path string syntax).
[Affects Firefox for Android]: Yes
[Suggested wording]: Support shape() function on clip-path property.
[Links (documentation, blog post, etc)]:
https://drafts.csswg.org/css-shapes-2/#shape-function
https://drafts.fxtf.org/css-masking-1/#the-clip-path
Comment 11•2 years ago
|
||
Thanks, added to the Fx126 nightly release notes, please allow 30 minutes for the site to update.
Keeping the relnote-firefox flag as ? to keep it on the radar for inclusion in the final Fx126 release notes
Updated•2 years ago
|
Comment 12•1 year ago
|
||
MDN docs have been updated and the shape() function documentation is now available. The related work can be tracked via the doc issue https://github.com/mdn/content/issues/33081.
Thanks a lot Boris for your timely help with all my questions!
Comment 13•1 year ago
|
||
Removing from the Nightly release notes as this has been included for more than 3 cycles now.
| Reporter | ||
Comment 14•11 months ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #0)
css-shapes-2 defines a
shape()function:
https://drafts.csswg.org/css-shapes-2/#shape-function
This moved from css-shapes-2 to css-shapes-1. The spec text is now here:
https://drafts.csswg.org/css-shapes-1/#shape-function
| Reporter | ||
Updated•11 months ago
|
Description
•