Skip to content

Commit 7d96fba

Browse files
committed
d attribute has different syntax than property
1 parent 3827d13 commit 7d96fba

File tree

2 files changed

+39
-3
lines changed

2 files changed

+39
-3
lines changed

master/paths.html

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ <h3 id="TheDProperty">Specifying path data: the <span class='property'>'d'</span
231231
If the path data string contains no valid commands, then the behavior
232232
is the same as the <span class='prop-value'>none</span> value.</p>
233233

234+
<p>When <a>'d'</a> is parsed as an attribute, it is parsed according to the
235+
<a href="#PathDataBNF">svg-path</a> <a href="types.html#syntax">EBNF
236+
grammar</a>, instead of the CSS grammar given above.</p>
237+
234238
<p>
235239
For animation, two <a>'d'</a> property values can only be
236240
interpolated smoothly when the path data strings contain have the
@@ -253,12 +257,40 @@ <h3 id="TheDProperty">Specifying path data: the <span class='property'>'d'</span
253257
<a href="https://drafts.csswg.org/web-animations/#animation-interpolation">interpolated</a>
254258
separately <a href="https://drafts.csswg.org/web-animations/#real-number-animation-type">as
255259
real numbers</a>. Flags and booleans must be interpolated as
256-
fractions between zero and one, with any non-zero value considered
257-
to be a value of one/true.
260+
integer values clamped between zero and one.
258261
</p>
259262

260263
</div>
261264

265+
<div class='ready-for-wider-review'>
266+
267+
<h3 id="TheDAttribute">The <span class="attr-name">'d'</span> attribute</h3>
268+
269+
<dl class="attrdef-list">
270+
<dt>
271+
<table class="attrdef def">
272+
<tr>
273+
<th>Name</th>
274+
<th>Value</th>
275+
<th>Initial value</th>
276+
<th>Animatable</th>
277+
</tr>
278+
<tr>
279+
<td><dfn id="TermD" data-dfn-type="element-attr" data-dfn-for="path" data-export="">d</dfn></td>
280+
<td>"<span class="attr-value">path data</span>"</td>
281+
<td>As if not specified.</td>
282+
<td>yes</td>
283+
</tr>
284+
</table>
285+
</dt>
286+
</dl>
287+
288+
<p>
289+
The contents of the attribute must match the svg-path EBNF grammar defined below, and errors within the string are handled according to the rules in the Path Data Error Handling section. If the path data string contains no valid commands, then the behavior is the same as if the attribute was not specified.
290+
</p>
291+
292+
<h3 id="PathData">Path data</h3>
293+
262294
<p>The following sections list the commands that can be used
263295
in path data strings. Those that
264296
draw straight line segments include the <a href="paths.html#PathDataLinetoCommands">lineto commands</a>

master/types.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,11 @@ <h2 id="syntax">Attribute syntax</h2>
143143
unitless length and angles to be used in presentation attribute while
144144
disallowing them in corresponding property values.</p>
145145

146-
<p class="note">Note that all <a>presentation attributes</a>, since they are
146+
<p>The <a>'d'</a> presentation attribute is an exception, it is parsed
147+
according to the <a href="paths.html#PathDataBNF">svg-path</a>
148+
<a href="types.html#syntax">EBNF grammar</a>.</p>
149+
150+
<p class="note">Note that all other <a>presentation attributes</a>, since they are
147151
defined by reference to their corresponding CSS properties, are defined using
148152
the CSS Value Definition Syntax.</p>
149153

0 commit comments

Comments
 (0)