Closed Bug 1921501 Opened 1 year ago Closed 4 months ago

[css-shapes-1] Add <relative-control-point> to a quadratic or cubic Bézier curve

Categories

(Core :: Layout: Floats, defect)

defect
Points:
2

Tracking

()

RESOLVED FIXED
146 Branch
Tracking Status
firefox146 --- fixed

People

(Reporter: mozilla-apprentice, Assigned: sukil)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete, Whiteboard: css-shape-function)

Attachments

(2 files)

A resolution was made for csswg-drafts/#10667.

[css-shapes-2] In `shape()` It should be possible to specify control points relative to their point on the curve

  • RESOLVED: Add a from-start keyword that goes after the value and latches the coordinate to the beginning of the segment.

Discussion.

See Also: → 1931047

Basically, this bug is to add the <relative-control-point> I think: https://drafts.csswg.org/css-shapes-1/#typedef-shape-relative-control-point

Blocks: css-shapes-1, 1910328
No longer blocks: css-shapes-2
Summary: [css-shapes-2] In `shape()` It should be possible to specify control points relative to their point on the curve → [css-shapes-1] In `shape()` It should be possible to specify control points relative to their point on the curve
Points: --- → 2
Summary: [css-shapes-1] In `shape()` It should be possible to specify control points relative to their point on the curve → [css-shapes-1] Add <relative-control-point> to a quadratic or cubic Bézier curve
Whiteboard: css-shape-function
Assignee: nobody → sukil
Status: NEW → ASSIGNED
Attachment #9523110 - Attachment description: Bug 1921501 (part 1) - Support parsing of <control-point> in shape(). r=boris → Bug 1921501 (part 1) - Support parsing of <control-point> in shape(). r=boris,emilio
Attachment #9523111 - Attachment description: Bug 1921501 (part 2) - Update SVG path building to support <control-point> values. r=boris,longsonr → Bug 1921501 - Support parsing of <control-point> in shape(). r=boris,longsonr
Pushed by sukil@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/5e2d19711f6b https://hg.mozilla.org/integration/autoland/rev/ecac5b716016 Support parsing of <control-point> in shape(). r=boris,longsonr,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers
Pushed by sstanca@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/da5ff6686790 https://hg.mozilla.org/integration/autoland/rev/c9f81ba85234 Revert "Bug 1921501 - Support parsing of <control-point> in shape(). r=boris,longsonr,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers" for causing mochitests-plain failures in test_pathAnimInterpolation.xhtml.

Reverted this because it was causing mochitests-plain failures in test_pathAnimInterpolation.xhtml.

  • Revert link
  • Push with failures
  • Failure Log
  • Failure line: TEST-UNEXPECTED-FAIL | dom/svg/test/test_pathAnimInterpolation.xhtml | Path segment for interpolation from M100,100c10,20,30,40,50,60 to M100,100C70,80,90,100,110,120 - got "C40,50,60,70,130,140", expected "C90,100,110,120,130,140"
Flags: needinfo?(sukil)
Flags: needinfo?(sukil)
Pushed by sukil@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ee2f8cd405b3 https://hg.mozilla.org/integration/autoland/rev/b7364e977e63 Support parsing of <control-point> in shape(). r=boris,longsonr,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers
Pushed by smolnar@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f00d2014c9ac https://hg.mozilla.org/integration/autoland/rev/1e68e375a3b0 Revert "Bug 1921501 - Support parsing of <control-point> in shape(). r=boris,longsonr,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers" for causing wpt failures
Flags: needinfo?(sukil)
Pushed by sukil@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/bfd9bd69c475 https://hg.mozilla.org/integration/autoland/rev/4f999b7a355b Support parsing of <control-point> in shape(). r=boris,longsonr,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 146 Branch
Flags: needinfo?(sukil)
Keywords: dev-doc-needed
QA Whiteboard: [qa-triage-done-c147/b146]

Hi there,

I'm looking into documenting this addition on MDN, and I had a couple of questions:

  1. Is this feature behind a pref?

  2. Can you give me a simple example of valid syntax usage that will work? I understand the syntax in the specification, but I'm having trouble creating a working example. AFAICS, something like this should work:

    offset-path: shape(
     from 30% 60px, curve to 180px 180px with 90px 190px by 150px 150px with 100px 100px from start
    );
    
Flags: needinfo?(boris.chiou)

(In reply to Chris Mills [:cmills] from comment #12)

  1. Is this feature behind a pref?

Yes. It is layout.css.basic-shape-shape.enabled.

  1. Can you give me a simple example of valid syntax usage that will work? I understand the syntax in the specification, but I'm having trouble creating a working example. AFAICS, something like this should work:

    offset-path: shape(
     from 30% 60px, curve to 180px 180px with 90px 190px by 150px 150px with 100px 100px from start
    );
    

clip-path should be easier to understand:

#target {
  width: 200px;
  height: 200px;
  background: green;
  clip-path: shape(from center left,
                   curve by 200px 0 with 50% -50% from start / 50% 0 from origin,
                   curve by -200px 0 with 50% 100% from origin / -50% 50% from start,
                   close);
}
<div id=target></div>

Also, you can find some other examples in https://searchfox.org/firefox-main/source/testing/web-platform/tests/css/css-masking/clip-path.
Just try to look at the test file name: clip-path-shape-xxx.html

Flags: needinfo?(boris.chiou)

(In reply to Chris Mills [:cmills] from comment #12)

offset-path: shape(
 from 30% 60px, curve to 180px 180px with 90px 190px by 150px 150px with 100px 100px from start
);

If you want to make this work, perhaps you have to replace it with

shape(from 30% 60px,
      curve to 180px 180px with 90px 190px,
      curve by 150px 150px with 100px 100px from start);

In other words, need to add curve before by.

Thanks for your help, Boris.

I've documented this feature and added Fx rel notes in https://github.com/mdn/content/pull/42132.

Can you please review my PR and let me know if the technical content makes sense?

Flags: needinfo?(boris.chiou)

(In reply to Chris Mills [:cmills] from comment #15)

Thanks for your help, Boris.

I've documented this feature and added Fx rel notes in https://github.com/mdn/content/pull/42132.

Can you please review my PR and let me know if the technical content makes sense?

Just took a look quickly. I didn't see any specific issues there. I saw your example of using start, end, and origin, and they are good. However, we could add some more examples which omit the keywords to reflect this spec words:

If such component is not provided, the <coordinate-pair> is relative to the segment’s start.

This sentence may need more examples I guess.

Flags: needinfo?(boris.chiou)

(In reply to Boris Chiou [:boris] from comment #16)

Just took a look quickly. I didn't see any specific issues there. I saw your example of using start, end, and origin, and they are good. However, we could add some more examples which omit the keywords to reflect this spec words:

If such component is not provided, the <coordinate-pair> is relative to the segment’s start. 

This sentence may need more examples I guess.

Thanks for the review, Boris. I'm not convinced this requires extra examples, but it does need covering on the page. I've added a note to cover it.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: