Skip to content

Commit 0ac66d4

Browse files
committed
[css-animations] Define <keyframes-name> and how idents/strings are compared. Make animation-name refer to <keyframes-name> directly. Fixes #118
1 parent 2a2691b commit 0ac66d4

File tree

2 files changed

+48
-2489
lines changed

2 files changed

+48
-2489
lines changed

css-animations/Overview.bs

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ Keyframes</h2>
218218
defined as follows:
219219

220220
<pre>
221-
@keyframes = @keyframes [ <<custom-ident>> | <<string>> ] { <<rule-list>> }
221+
@keyframes = @keyframes <<keyframes-name>> { <<rule-list>> }
222+
223+
<dfn>&lt;keyframes-name></dfn> = <<custom-ident>> | <<string>>
222224

223225
<dfn>&lt;keyframe-block></dfn> = <<keyframe-selector>># { <<declaration-list>> }
224226

@@ -234,6 +236,46 @@ Keyframes</h2>
234236
None of the properties interact with the cascade
235237
(so using ''!important'' on them is invalid and will cause the property to be ignored).
236238

239+
A ''@keyframes'' block has a name given by the <<custom-ident>> or <<string>> in its prelude.
240+
The two syntaxes are equivalent in functionality;
241+
the name is the value of the ident or string.
242+
As normal for <<custom-ident>>s and <<string>>s,
243+
the names are fully <a>case-sensitive</a>;
244+
two names are equal only if they are codepoint-by-codepoint equal.
245+
The <<custom-ident>> additionally excludes the ''none'' keyword.
246+
247+
<div class=example>
248+
For example, the following two ''@keyframes'' rules have the same name,
249+
so the first will be ignored:
250+
251+
<pre class=lang-css>
252+
@keyframes foo { ... }
253+
@keyframes "foo" { ... }
254+
</pre>
255+
256+
On the other hand,
257+
the following ''@keyframes'' rule's name is <em>different</em> from the previous two rules:
258+
259+
<pre class=lang-css>
260+
@keyframes FOO { ... }
261+
</pre>
262+
263+
The following ''@keyframes'' rules are invalid
264+
because they use disallowed <<custom-ident>> values:
265+
266+
<pre class=lang-css>
267+
@keyframes initial { ... }
268+
@keyframes None { ... }
269+
</pre>
270+
271+
However, those names *can* be specified with a <<string>>,
272+
so the following are both <em>valid</em>:
273+
274+
<pre class=lang-css>
275+
@keyframes "initial" { ... }
276+
@keyframes "None" { ... }
277+
</div>
278+
237279
The <<keyframe-selector>> for a <<keyframe-block>> consists of a comma-separated list of percentage values or the keywords ''from'' or ''to''. The selector is used to specify the percentage along the duration of the animation that the keyframe represents. The keyframe itself is specified by the block of property values declared on the selector. The keyword ''from'' is equivalent to the value ''0%''. The keyword ''to'' is equivalent to the value ''100%''.
238280
Values less than ''0%'' or higher than ''100%'' are invalid
239281
and cause their <<keyframe-block>> to be ignored.
@@ -425,7 +467,7 @@ The 'animation-name' property</h3>
425467

426468
<pre class='propdef'>
427469
Name: animation-name
428-
Value: <<single-animation-name>>#
470+
Value: [ none | <<keyframes-name>> ]#
429471
Initial: none
430472
Applies to: all elements, ::before and ::after pseudo-elements
431473
Inherited: none
@@ -436,8 +478,6 @@ The 'animation-name' property</h3>
436478
Canonical order: per grammar
437479
</pre>
438480

439-
<dfn>&lt;single-animation-name></dfn> = none | <<custom-ident>> | <<string>>
440-
441481
The values of 'animation-name' have the following meanings:
442482

443483
<dl dfn-type=value dfn-for=animation-name>
@@ -446,19 +486,11 @@ The 'animation-name' property</h3>
446486
No keyframes are specified at all, so there will be no animation.
447487
Any other animations properties specified for this animation have no effect.
448488

449-
<dt><dfn><<custom-ident>></dfn>
450-
<dd>
451-
The animation will use the keyframes with the name specified by the <<custom-ident>>,
452-
if they exist. If no such keyframes exist, there is no animation.
453-
454-
The <a href="https://www.w3.org/TR/css3-values/#common-keywords">CSS-wide keywords</a>
455-
and keywords defined by this property are not valid animation names.
456-
<dt><dfn><<string>></dfn>
489+
<dt><dfn><<keyframes-name>></dfn>
457490
<dd>
458-
The animation will use the keyframes with the name specified by the
459-
<<string>>, if they exist. If no such keyframes exist, there is no
460-
animation.
461-
</dd>
491+
The animation will use the keyframes with the name specified by the <<keyframes-name>>,
492+
if they exist.
493+
If no ''@keyframes'' rule with tha name exists, there is no animation.
462494
</dl>
463495

464496
<h3 id="animation-duration">

0 commit comments

Comments
 (0)