Skip to content

Commit ec435e7

Browse files
committed
Allow <<position>>
1 parent 5f4b6d5 commit ec435e7

File tree

1 file changed

+31
-18
lines changed

1 file changed

+31
-18
lines changed

css-shapes-2/Overview.bs

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,12 @@ Supported Shapes</h3>
170170
</ul>
171171
<dt>
172172
<pre class=prod>
173-
<dfn>shape()</dfn> = shape( [<<fill-rule>>]? from <<coordinate-pair>>, <<draw-command>>#)
173+
<dfn>shape()</dfn> = shape( [<<fill-rule>>]? from <<position>>, <<draw-command>>#)
174174
</pre>
175175
<dd dfn-type=value dfn-for="shape()">
176176
<ul>
177177
<li>
178-
The <<coordinate-pair>> represents the starting point for the first draw-command,
179-
in physical coordinates.
178+
The <<position>> represents the starting point for the first draw-command.
180179
<li>
181180
The sequence of <dfn><<draw-command>></dfn>s represent commands of an
182181
<a href="https://www.w3.org/TR/SVG11/paths.html#PathData">SVG Path</a>.
@@ -187,41 +186,55 @@ Supported Shapes</h3>
187186

188187
<dl>
189188
<dt><dfn><<coordinate-pair>></dfn> = <<length-percentage>>{2}
190-
<dd>Defines a pair of coordinates x & y.
191-
192-
<dt><dfn><<draw-command>></dfn> = <<move-command>> | <<line-command>> | <<hv-line-command>> |
193-
<<curve-command>> | <<smooth-command>> | <<arc-command>> | close
194189
<dd>
195-
Defines a single draw command, equivalent to an <a href="https://www.w3.org/TR/SVG/paths.html#PathDataGeneralInformation">SVG draw command</a>.
196-
<dt><dfn><<by-to>></dfn> = by | to
190+
Defines a pair of coordinates x & y.
191+
<dt><dfn><<target-position>></dfn> = by <<coordinate-pair>> | to <<position>>
197192
<dd>
198-
Represents the reference from which offsets are computed in <<draw-command>>s.
193+
Defines the end coordinates of a shape command.
199194
When ''to'' is present, the coordinates are relative to the top-left origin of the reference box.
200195
Otherwise ''by'' is present, the coordinates are relative to the end position of the previous command.
201196

202197
Note:
203198
<<percentage>> values are always computed relative to the reference box regardless of how offsets are computed.
199+
200+
<dt><dfn><<target-length-percentage>></dfn> = by <<coordinate-pair>> | to <<position>>
201+
<dd>
202+
Represents the reference from which offsets are computed in <<draw-command>>s.
203+
<dt><dfn><<draw-command>></dfn> = <<move-command>> | <<line-command>> | <<hline-command>> |
204+
<<vline-command>> | <<curve-command>> | <<smooth-command>> | <<arc-command>> | close
204205
<dd>
206+
Defines a single draw command, equivalent to an <a href="https://www.w3.org/TR/SVG/paths.html#PathDataGeneralInformation">SVG draw command</a>.
205207

206-
<dt><dfn><<move-command>></dfn> = move <<by-to>> <<coordinate-pair>>
208+
<dt><dfn><<move-command>></dfn> = move <<target-position>>
207209
<dd>
208210
Corresponds to a <a href="https://www.w3.org/TR/SVG/paths.html#PathDataMovetoCommands">moveto</a> command.
209-
<dt><dfn><<line-command>></dfn> = line <<by-to>> <<coordinate-pair>>
211+
<dt><dfn><<line-command>></dfn> = line <<target-position>>
210212
<dd>
211213
Corresponds to a <a href="https://www.w3.org/TR/SVG/paths.html#PathDataLinetoCommands">lineto</a> command.
212214
If '''x''' or '''y''' are present instead of a <<length-percentage>>, the line will be horizontal or vertical, respectively.
213-
<dt><dfn><<hv-line-command>></dfn> = [hline | vline] <<by-to>> <<length-percentage>>
215+
<dt><dfn><<hline-command>></dfn> = hline [[by <<length-percentage>>] | [to [<<length-percentage>> | left | center | right]]]
216+
<dd>
217+
Corresponds to a horizontal or <a href="https://www.w3.org/TR/SVG/paths.html#PathDataLinetoCommands">lineto</a> command.
218+
219+
The coordinates are computed in the same manner as <<target-position>>.
220+
<dt><dfn><<vline-command>></dfn> = vline [[by <<length-percentage>>] | [to [<<length-percentage>> | top | center | bottom]]]
214221
<dd>
215-
Corresponds to a horizontal or vertical <a href="https://www.w3.org/TR/SVG/paths.html#PathDataLinetoCommands">lineto</a> command.
216-
<dt><dfn><<curve-command>></dfn> = curve <<by-to>> <<coordinate-pair>> via <<coordinate-pair>>{1,2}
222+
Corresponds to a vertical <a href="https://www.w3.org/TR/SVG/paths.html#PathDataLinetoCommands">lineto</a> command.
223+
224+
The coordinates are computed in the same manner as <<target-position>>.
225+
<dt><dfn><<curve-command>></dfn> = curve [[to <<position>> via <<position>>{1,2}] | [by <<coordinate-pair>> via <<coordinate-pair>>{1, 2}]]
217226
<dd>
218-
Corresponds to a <a href="https://www.w3.org/TR/SVG/paths.html#PathDataQuadraticBezierCommands">quadratic curve</a> command if one <<coordinate-pair>> is provided,
227+
Corresponds to a <a href="https://www.w3.org/TR/SVG/paths.html#PathDataQuadraticBezierCommands">quadratic curve</a> command if one set of coordinats is provided,
219228
otherwise corresponds to a <a href="https://www.w3.org/TR/SVG/paths.html#PathDataCubicBezierCommands">cubic curve</a> command.
220-
<dt><dfn><<smooth-command>></dfn> = smooth <<by-to>> <<coordinate-pair>> [via <<coordinate-pair>>]?
229+
230+
The coordinates are computed in the same manner as <<target-position>>.
231+
<dt><dfn><<smooth-command>></dfn> = smooth [[to <<position>> [via <<position>>]?] | [[by <<coordinate-pair>> [via <<coordinate-pair>>]?]]
221232
<dd>
222233
Corresponds to a <a href="https://www.w3.org/TR/SVG/paths.html#PathDataCubicBezierCommands">smooth cubic curve</a> command if a second <<coordinate-pair>> is provided,
223234
otherwise corresponds to a <a href="https://www.w3.org/TR/SVG/paths.html#PathDataQuadraticBezierCommands">smooth quadratic curve</a> command.
224-
<dt><dfn><<arc-command>></dfn> = arc [<<by-to>> <<coordinate-pair>> <<arc-radius>> || <<arc-sweep>> || <<arc-large>> || <<angle>>]
235+
236+
The coordinates are computed in the same manner as <<target-position>>.
237+
<dt><dfn><<arc-command>></dfn> = arc [<<target-position>> || <<arc-radius>> || <<arc-sweep>> || <<arc-large>> || <<angle>>]
225238
<dd>
226239
Corresponds to an <a href="https://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands">arc</a> command.
227240
<dt><dfn><<arc-radius>></dfn> = of <<length-percentage>>{1, 2}

0 commit comments

Comments
 (0)