Skip to content

Commit

Permalink
d attribute has different syntax than property
Browse files Browse the repository at this point in the history
  • Loading branch information
ericwilligers committed Nov 5, 2018
1 parent 3827d13 commit 7d96fba
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
36 changes: 34 additions & 2 deletions master/paths.html
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ <h3 id="TheDProperty">Specifying path data: the <span class='property'>'d'</span
If the path data string contains no valid commands, then the behavior
is the same as the <span class='prop-value'>none</span> value.</p>

<p>When <a>'d'</a> is parsed as an attribute, it is parsed according to the
<a href="#PathDataBNF">svg-path</a> <a href="types.html#syntax">EBNF
grammar</a>, instead of the CSS grammar given above.</p>

<p>
For animation, two <a>'d'</a> property values can only be
interpolated smoothly when the path data strings contain have the
Expand All @@ -253,12 +257,40 @@ <h3 id="TheDProperty">Specifying path data: the <span class='property'>'d'</span
<a href="https://drafts.csswg.org/web-animations/#animation-interpolation">interpolated</a>
separately <a href="https://drafts.csswg.org/web-animations/#real-number-animation-type">as
real numbers</a>. Flags and booleans must be interpolated as
fractions between zero and one, with any non-zero value considered
to be a value of one/true.
integer values clamped between zero and one.
</p>

</div>

<div class='ready-for-wider-review'>

<h3 id="TheDAttribute">The <span class="attr-name">'d'</span> attribute</h3>

<dl class="attrdef-list">
<dt>
<table class="attrdef def">
<tr>
<th>Name</th>
<th>Value</th>
<th>Initial value</th>
<th>Animatable</th>
</tr>
<tr>
<td><dfn id="TermD" data-dfn-type="element-attr" data-dfn-for="path" data-export="">d</dfn></td>
<td>"<span class="attr-value">path data</span>"</td>
<td>As if not specified.</td>
<td>yes</td>
</tr>
</table>
</dt>
</dl>

<p>
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.
</p>

<h3 id="PathData">Path data</h3>

<p>The following sections list the commands that can be used
in path data strings. Those that
draw straight line segments include the <a href="paths.html#PathDataLinetoCommands">lineto commands</a>
Expand Down
6 changes: 5 additions & 1 deletion master/types.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ <h2 id="syntax">Attribute syntax</h2>
unitless length and angles to be used in presentation attribute while
disallowing them in corresponding property values.</p>

<p class="note">Note that all <a>presentation attributes</a>, since they are
<p>The <a>'d'</a> presentation attribute is an exception, it is parsed
according to the <a href="paths.html#PathDataBNF">svg-path</a>
<a href="types.html#syntax">EBNF grammar</a>.</p>

<p class="note">Note that all other <a>presentation attributes</a>, since they are
defined by reference to their corresponding CSS properties, are defined using
the CSS Value Definition Syntax.</p>

Expand Down

0 comments on commit 7d96fba

Please sign in to comment.