Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-shapes-1] Define <basic-shape> with CSS value definition syntax #7390

Closed
cdoublev opened this issue Jun 20, 2022 · 1 comment · May be fixed by #9727
Closed

[css-shapes-1] Define <basic-shape> with CSS value definition syntax #7390

cdoublev opened this issue Jun 20, 2022 · 1 comment · May be fixed by #9727

Comments

@cdoublev
Copy link
Collaborator

I would like to get <basic-shape> defined using the CSS value definition syntax so that it can be be extracted by w3c/reffy, similarly as <color> is defined with its sub-productions.

<basic-shape> = <basic-shape-rect> | <circle()> | <ellipse()> | <polygon()> | <path()>

@cdoublev
Copy link
Collaborator Author

cdoublev commented Dec 19, 2022

<basic-shape> is defined in CSS Shapes 1 with the following functions:

  • circle(<shape-radius>? [at <position>]?)
  • ellipse([<shape-radius>{2} ]? [at <position>]?)
  • inset(<length-percentage>{1,4} [round <'border-radius'>]?)
  • polygon(<'fill-rule'>? , [<length-percentage> <length-percentage>]#)
  • rect([<length-percentage> | auto ]{4} [round <'border-radius'>]?)
  • xywh(<length-percentage>{2} <length-percentage [0,∞]>{2} [round <'border-radius'>]?)
  • path(<'fill-rule'>? , <string>)

CSS Shapes 2 extends this list with shape(<'fill-rule'>? from <coordinate-pair>, <shape-command>#).


<basic-shape> is used in:

For clip-path, CSS Masking links <basic-shape> to CSS Shapes 1 and does not restrict its value.

For offset-path, Motion links <basic-shape> to CSS Shapes 1 and does not restrict its value. path() and polygon() are problematic because they take <'fill-rule'>, which seems meaningless for offset-path.

For shape-outside in CSS Shapes 1 and shape-inside in CSS Shapes 2, the spec restricts <basic-shape> to inset(), circle(), ellipse(), polygon(). Why rect(), xywh(), path(), would be invalid?

For shape-inside in CSS Round Display 1, <basic-shape> is not linked and its value is not restricted.

Aside: CSS Round Dispplay 1 says that CSS Shapes 2 define the shape-inside property [...which] is extended with a new value named display, but it is already included in the value definition of shape-inside in CSS Shapes 2.

For shape-inside and shape-substract in SVG 2, <basic-shape> is not linked and its value is restricted to circle(), ellipse(), polygon(). The spec has Issue 76: do not re-specify shape-inside but reference CSS Shapes, and its value definition is different than in CSS Shapes 2. inset() is explicitly not allowed. Why? And does it mean that rect(), xywh(), path(), are not allowed? Why?


I propose:

  • to define in CSS Shapes 1 that basic shapes in CSS are represented by the <basic-shape> type, defined with <basic-shape> = <basic-shape-rect> | <circle()> | <ellipse()> | <polygon()> | <path()>
  • to accept all <basic-shapes> for shape-outside in CSS Shapes 1 and for shape-inside in CSS Shapes 2
  • to define that for all <basic shape>s, if they accept a <'fill-rule'>, it is ignored for offset-path in Motion

Edited suggested changes, after w3c/fxtf-drafts@b1fd570.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants