Skip to content

Commit 52f7565

Browse files
committed
[css-animations] Change ordering requirements for parsing keywords within the animation shorthand to prioritize animation-name lowest, and also require nonambiguous serialization with allowance for being non-minimal (which we could perhaps tighten later).
Fixes: http://lists.w3.org/Archives/Public/www-style/2014Jan/0325.html http://lists.w3.org/Archives/Public/www-style/2011Apr/0344.html
1 parent 1b13581 commit 52f7565

2 files changed

Lines changed: 51 additions & 6 deletions

File tree

css-animations/Overview.html

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,18 +1458,41 @@ <h3 id=animation-shorthand-property><span class=secno>4.10. </span> The
14581458
</table>
14591459

14601460
<div class=prod> <dfn id=single-animation>&lt;single-animation&gt;</dfn> =
1461-
&lt;single-animation-name&gt; || <span>&lt;time&gt;</span> ||
1462-
&lt;single-animation-timing-function&gt; || <span>&lt;time&gt;</span> ||
1463-
&lt;single-animation-iteration-count&gt; ||
1461+
<span>&lt;time&gt;</span> || &lt;single-animation-timing-function&gt; ||
1462+
<span>&lt;time&gt;</span> || &lt;single-animation-iteration-count&gt; ||
14641463
&lt;single-animation-direction&gt; || &lt;single-animation-fill-mode&gt;
1465-
|| &lt;single-animation-play-state&gt;</div>
1464+
|| &lt;single-animation-play-state&gt; || &lt;single-animation-name&gt;</div>
14661465

14671466
<p> Note that order is important within each animation definition: the
14681467
first value in each &lt;single-animation&gt; that can be parsed as a
14691468
<var>&lt;time&gt;</var> is assigned to the animation-duration, and the
14701469
second value in each &lt;single-animation&gt; that can be parsed as a
14711470
<var>&lt;time&gt;</var> is assigned to animation-delay.
14721471

1472+
<p> Note that order is also important within each animation definition for
1473+
distinguishing &lt;single-animation-name&gt; values from other keywords.
1474+
When parsing, keywords that are valid for properties other than ‘<a
1475+
href="#animation-name"><code class=property>animation-name</code></a>
1476+
must be accepted for those properties rather than for ‘<a
1477+
href="#animation-name"><code class=property>animation-name</code></a>’.
1478+
Furthermore, when serializing, default values of other properties must be
1479+
output in at least the cases necessary to distinguish an ‘<a
1480+
href="#animation-name"><code class=property>animation-name</code></a>
1481+
that could be a value of another property, and may be output in additional
1482+
cases. <span class=example> For example, a value parsed from ‘<code
1483+
class=css>animation: 3s none backwards</code>’ (where ‘<a
1484+
href="#animation-fill-mode"><code
1485+
class=property>animation-fill-mode</code></a>’ is ‘<code
1486+
class=css>none</code>’ and ‘<a href="#animation-name"><code
1487+
class=property>animation-name</code></a>’ is ‘<code
1488+
class=css>backwards</code>’) must not be serialized as ‘<code
1489+
class=css>animation: 3s backwards</code>’ (where ‘<a
1490+
href="#animation-fill-mode"><code
1491+
class=property>animation-fill-mode</code></a>’ is ‘<code
1492+
class=css>backwards</code>’ and ‘<a href="#animation-name"><code
1493+
class=property>animation-name</code></a>’ is ‘<code
1494+
class=css>none</code>’). </span>
1495+
14731496
<p class=issue> Need to also explain how order is important in terms of
14741497
animation-name versus keywords, and probably also adjust the canonical
14751498
order to match.

css-animations/Overview.src.html

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,14 +1037,14 @@ <h3 id="animation-shorthand-property">
10371037

10381038
<div class="prod">
10391039
<dfn id="single-animation">&lt;single-animation&gt;</dfn> =
1040-
&lt;single-animation-name&gt; ||
10411040
<span>&lt;time&gt;</span> ||
10421041
&lt;single-animation-timing-function&gt; ||
10431042
<span>&lt;time&gt;</span> ||
10441043
&lt;single-animation-iteration-count&gt; ||
10451044
&lt;single-animation-direction&gt; ||
10461045
&lt;single-animation-fill-mode&gt; ||
1047-
&lt;single-animation-play-state&gt;
1046+
&lt;single-animation-play-state&gt; ||
1047+
&lt;single-animation-name&gt;
10481048
</div>
10491049

10501050
<p>
@@ -1057,6 +1057,28 @@ <h3 id="animation-shorthand-property">
10571057
is assigned to animation-delay.
10581058
</p>
10591059

1060+
<p>
1061+
Note that order is also important within each animation definition
1062+
for distinguishing &lt;single-animation-name&gt; values
1063+
from other keywords.
1064+
When parsing, keywords that are valid for
1065+
properties other than 'animation-name'
1066+
must be accepted for those properties
1067+
rather than for 'animation-name'.
1068+
Furthermore, when serializing,
1069+
default values of other properties must be output
1070+
in at least the cases necessary to distinguish an
1071+
'animation-name' that could be a value of another property,
1072+
and may be output in additional cases.
1073+
<span class="example">
1074+
For example, a value parsed from ''animation: 3s none backwards''
1075+
(where 'animation-fill-mode' is ''none'' and
1076+
'animation-name' is ''backwards'')
1077+
must not be serialized as ''animation: 3s backwards''
1078+
(where 'animation-fill-mode' is ''backwards'' and
1079+
'animation-name' is ''none'').
1080+
</span>
1081+
10601082
<p class="issue">
10611083
Need to also explain how order is important in terms of animation-name
10621084
versus keywords, and probably also adjust the canonical order to

0 commit comments

Comments
 (0)