@@ -75,7 +75,7 @@ Animations</h2>
7575
7676 If at one point in time there are multiple animations specifying behavior
7777 for the same property, the animation whose name occurs last in the value
78- of ‘ animation-name’ will override the other animations at that point.
78+ of ' animation-name' will override the other animations at that point.
7979
8080 An animation does not affect the computed value before the application of
8181 the animation, before the animation delay has expired, and after the end of
@@ -86,12 +86,12 @@ Animations</h2>
8686 <figcaption> Computation of animated property values</figcaption>
8787 </figure>
8888
89- The diagram above shows how property values are computed. The intrinsic
90- style is shown at the top of the diagram. The computed value is derived
91- from intrinsic style at the times when an animation is not running and
92- also when an animation is delayed (see below for specification of animation
93- delay). During an animation, the computed style is derived from the
94- animated value.
89+ The diagram above shows how property values are computed. The intrinsic
90+ style is shown at the top of the diagram. The computed value is derived
91+ from intrinsic style at the times when an animation is not running and
92+ also when an animation is delayed (see below for specification of animation
93+ delay). During an animation, the computed style is derived from the
94+ animated value.
9595
9696 The start time of an animation is the latter of two moments: the time at
9797 which the style is resolved that specifies the animation, or the time the
@@ -322,13 +322,28 @@ The 'animation-name' property</h3>
322322 Canonical order : per grammar
323323 </pre>
324324
325- <dfn><single-animation-name></dfn> = none | <<IDENT>>
325+ <dfn><single-animation-name></dfn> = none | <<custom-ident>>
326+
327+ The values of 'animation-name' have the following meanings:
328+
329+ <dl dfn-type=value dfn-for=animation-name>
330+ <dt> <dfn>none</dfn>
331+ <dd>
332+ No keyframes are specified at all, so there will be no animation.
333+ Any other animations properties specified for this animation have no effect.
334+
335+ <dt> <dfn><<custom-ident>></dfn>
336+ <dd>
337+ The animation will use the keyframes with the name specified by the <<custom-ident>> ,
338+ if they exist.
339+ If no such keyframes exist,
340+ there is no animation.
341+ </dl>
326342
327343<h3 id="animation-duration">
328344The 'animation-duration' property</h3>
329345
330- The 'animation-duration' property defines the length of time that an animation takes to
331- complete one cycle.
346+ The 'animation-duration' property defines duration of a single animation cycle.
332347
333348 <pre class='propdef'>
334349 Name : animation-duration
@@ -343,11 +358,19 @@ The 'animation-duration' property</h3>
343358 Canonical order : per grammar
344359 </pre>
345360
346- The initial value is ''0s'' , meaning that the animation takes no time. When the duration is ''0s''
347- 'animation-fill-mode' still applies, so an animation that fills backwards will show the value of
348- the ''0%'' keyframe during any delay period, and an animation that fills forwards will retain the
349- value specified at the ''100%'' keyframe, even if the animation was instantaneous. Also, animation
350- events are still fired. A negative 'animation-duration' value renders the declaration invalid.
361+ <dl>
362+ <dt> <dfn value for=animation-duration><<time>></dfn>
363+ <dd>
364+ The <<time>> specifies the length of time that an animation takes to complete one cycle.
365+ A negative <<time>> is invalid.
366+
367+ If the <<time>> is ''0s'' , like the initial value,
368+ the keyframes of the animation have no effect,
369+ but the animation itself still occurs instantaneously.
370+ That is, 'animation-fill-mode' applies as normal,
371+ filling backwards or forwards as appropriate,
372+ and animation events still fire.
373+ </dl>
351374
352375<h3 id="animation-timing-function">
353376The 'animation-timing-function' property</h3>
@@ -369,24 +392,27 @@ The 'animation-timing-function' property</h3>
369392 Canonical order : per grammar
370393 </pre>
371394
372- All the valid values of <dfn><single-timing-function></dfn> are defined by the 'transition-timing-function'
373- property [[!CSS3-TRANSITIONS]] .
395+ The values and meaning of <dfn><single-timing-function></dfn>
396+ are identical to those of <<single-transition-timing-function>> [[!CSS3-TRANSITIONS]] .
374397
375- For a keyframed animation, the 'animation-timing-function' applies between keyframes, not over the
376- entire animation. For example, in the case of an ''ease-in-out'' timing function, an animation will
377- ease in at the start of the keyframe and ease out at the end of the keyframe. An 'animation-timing-function'
378- defined within a keyframe block applies to that keyframe, otherwise the timing function specified for
379- the animation is used. In addition, only the first value of the property applies when it is used in
380- a keyframe block.
398+ The timing function specified applies to each iteration of the animation,
399+ not the entire animation in full.
400+ For example, if an animation has ''animation-timing-function: ease-in-out; animation-iteration-count: 2;'' ,
401+ it will ease in at the start,
402+ ease out as it approaches the end of its first iteration,
403+ ease in at the start of its second iteration,
404+ and ease out again as it approaches the end of the animation.
405+
406+ Note: Unlike other animation properties,
407+ 'animation-timing-function' has an effect when specified on an individual keyframe.
408+ See <a section href="#timing-functions"></a> for more detail on this.
381409
382410<h3 id="animation-iteration-count">
383411The 'animation-iteration-count' property</h3>
384412
385413 The 'animation-iteration-count' property specifies the number of times an animation cycle
386414 is played. The initial value is ''1'' , meaning the animation will play from beginning to end
387- once. A value of ''infinite'' will cause the animation to repeat forever. Non-integer numbers
388- will cause the animation to end part-way through a cycle. Negative values of
389- 'animation-iteration-count' are invalid. This property is often used in conjunction an
415+ once. This property is often used in conjunction with an
390416 'animation-direction' value of ''alternate'' , which will cause the animation to play in
391417 reverse on alternate cycles.
392418
@@ -405,6 +431,24 @@ The 'animation-iteration-count' property</h3>
405431
406432 <dfn><single-animation-iteration-count></dfn> = infinite | <<number>>
407433
434+ <dl dfn-type=value dfn-for=animation-iteration-count>
435+ <dt> <dfn>infinite</dfn>
436+ <dd>
437+ The animation will repeat forever.
438+
439+ <dt> <dfn><<number>></dfn>
440+ <dd>
441+ The animation will repeat the specified number of times.
442+ If the number is not an integer,
443+ the animation will end partway through its last cycle.
444+ Negative numbers are invalid.
445+
446+ A value of ''0'' is valid and,
447+ similar to an 'animation-duration' of ''0s'' ,
448+ causes the animation to occur instantaneously.
449+ </dl>
450+
451+
408452<h3 id="animation-direction">
409453The 'animation-direction' property</h3>
410454
@@ -459,11 +503,6 @@ The 'animation-direction' property</h3>
459503The 'animation-play-state' property</h3>
460504
461505 The 'animation-play-state' property defines whether the animation is running or paused.
462- A running animation can be paused by setting this property to ''paused'' . To continue
463- running a paused animation this property can be set to ''running'' . A paused animation will
464- continue to display the current value of the animation in a static state, as if the time
465- of the animation is constant. When a paused animation is resumed, it restarts from the
466- current value, not necessarily from the beginning of the animation.
467506
468507 <pre class='propdef'>
469508 Name : animation-play-state
@@ -480,19 +519,28 @@ The 'animation-play-state' property</h3>
480519
481520 <dfn><single-animation-play-state></dfn> = running | paused
482521
522+ <dl dfn-type=value dfn-for=animation-play-state>
523+ <dt> <dfn>running</dfn>
524+ <dd>
525+ While this property is set to ''running'' ,
526+ the animation proceeds as normal.
527+
528+ <dt> <dfn>paused</dfn>
529+ <dd>
530+ While this property is set to ''paused'' ,
531+ the animation is paused.
532+ The animation continues to apply to the element with the progress it had made before being paused.
533+ When unpaused (set back to ''running'' ),
534+ it restarts from where it left off,
535+ as if the "clock" that controls the animation had stopped and started again.
536+ </dl>
537+
483538<h3 id="animation-delay">
484539The 'animation-delay' property</h3>
485540
486541 The 'animation-delay' property defines when the animation will start. It allows an animation
487- to begin execution some time after it is applied. An 'animation-delay' value of ''0s'' means
488- the animation will execute as soon as it is applied. Otherwise, the value specifies an offset
489- from the moment the animation is applied, and the animation will delay execution by that offset.
490-
491- If the value for 'animation-delay' is a negative time offset then the animation will execute the
492- moment it is applied, but will appear to have begun execution at the specified offset. That is,
493- the animation will appear to begin part-way through its play cycle. In the case where an animation
494- has implied starting values and a negative 'animation-delay' , the starting values are taken from
495- the moment the animation is applied.
542+ to begin execution some time after it is applied,
543+ or to appear to have begun execution some time <em> before</em> it is applied.
496544
497545 <pre class='propdef'>
498546 Name : animation-delay
@@ -507,6 +555,24 @@ The 'animation-delay' property</h3>
507555 Canonical order : per grammar
508556 </pre>
509557
558+ <dl>
559+ <dt> <dfn value for=animation-delay><<time>></dfn>
560+ <dd>
561+ The <<time>> defines how long of a delay there is between the start of the animation
562+ (when the animation is applied to the element via these properties)
563+ and when it begins executing.
564+ A delay of ''0s'' (the initial value) means that the animation will execute as soon as it is applied.
565+
566+ A negative delay is <strong> valid</strong> .
567+ Similar to a delay of ''0s'' , it means that the animation executes immediately,
568+ but is automatically progressed by the absolute value of the delay,
569+ as if the animation had started the specified time in the past,
570+ and so it appears to start partway through its play-cycle already.
571+ If an animation's keyframes have an implied starting value,
572+ the values are taken from the time the animation starts,
573+ not some time in the past.
574+ </dl>
575+
510576<h3 id="animation-fill-mode">
511577The 'animation-fill-mode' property</h3>
512578
@@ -515,26 +581,8 @@ The 'animation-fill-mode' property</h3>
515581 values between the time it is applied (the ‘animation-name’ property is set on an
516582 element) and the time it begins execution (which is determined by the 'animation-delay'
517583 property). Also, by default an animation does not affect property values after the
518- animation ends (determined by the 'animation-duration' property). The 'animation-fill-mode'
519- property can override this behavior.
520-
521- If the value for 'animation-fill-mode' is ''backwards'' , then the animation will apply
522- the property values defined in the keyframe that will start the first iteration of the
523- animation, during the period defined by 'animation-delay' . These are either the values
524- of the ''from'' keyframe (when 'animation-direction' is ''normal'' or ''alternate'' ) or
525- those of the ''to'' keyframe (when 'animation-direction' is ''reverse'' or
526- ''alternate-reverse'' ).
527-
528- If the value for 'animation-fill-mode' is ''forwards'' , then after the animation ends (as
529- determined by its 'animation-iteration-count' ), the animation will apply the property values
530- for the time the animation ended. When 'animation-iteration-count' is an integer greater than
531- zero, the values applied will be those for the end of the last completed iteration of the
532- animation (rather than the values for the start of the iteration that would be next). When
533- 'animation-iteration-count' is zero, the values applied will be those that would start the
534- first iteration (just as when 'animation-fill-mode' is ''backwards'' ).
535-
536- If the value for 'animation-fill-mode' is ''both'' , then the animation will follow the rules
537- for both ''forwards'' and ''backwards'' . That is, it will extend the animation in both directions.
584+ animation ends (determined by the 'animation-duration' and 'animation-iteration-count' properties).
585+ The 'animation-fill-mode' property can override this behavior.
538586
539587 <pre class='propdef'>
540588 Name : animation-fill-mode
@@ -551,6 +599,50 @@ The 'animation-fill-mode' property</h3>
551599
552600 <dfn><single-animation-fill-mode></dfn> = none | forwards | backwards | both
553601
602+ <dl dfn-type=value dfn-for=animation-fill-mode>
603+ <dt> <dfn>none</dfn>
604+ <dd>
605+ The animation has no effect when it is applied but not executing.
606+
607+ <dt> <dfn>forwards</dfn>
608+ <dd>
609+ After the animation is done executing
610+ (has played the number of times specified by its 'animation-iteration-count' value)
611+ it continues to apply the values that it ended its last complete iteration with.
612+ This will be the values specified or implied for either its ''100%'' or ''0%'' keyframe,
613+ depending on the direction that the last complete iteration was executing in
614+ (per 'animation-direction' ).
615+ If the animation didn't complete an entire iteration
616+ (if the iteration count was ''0'' or a value less than 1)
617+ the values specified or implied for its ''0%'' keyframe are used.
618+
619+ Note: If 'animation-iteration-count' is a non-integer value,
620+ the animation will stop executing partway through its animation cycle,
621+ but a forwards fill will still apply the values of the ''100%'' keyframe,
622+ not whatever values were being applied at the time the animation stopped executing.
623+
624+ Issue: Why does it ignore the progress made by a non-integer iteration count?
625+
626+ Issue: What happens with ''animation-duration: 0; animation-iteration-count: infinite;'' ?
627+ The animation is instantaneous,
628+ but there is no "last complete iteration".
629+ In particular, you can't tell whether to use the 0% or 100% keyframe.
630+
631+ <dt> <dfn>backwards</dfn>
632+ <dd>
633+ Before the animation has begun executing
634+ (during the period specified by 'animation-delay' ),
635+ the animation applies the values that it will start the first iteration with.
636+ If the 'animation-direction' is ''normal'' or ''alternate'' ,
637+ the values specified or implied for its ''0%'' keyframe are used;
638+ if the 'animation-direction' is ''reverse'' or ''alternate-reverse'' ,
639+ the values specified or implied for its ''100%'' keyframe are used.
640+
641+ <dt> <dfn>both</dfn>
642+ <dd>
643+ The effects of both ''forwards'' and ''backwards'' fill apply.
644+ </dl>
645+
554646<h3 id="animation">
555647The 'animation' shorthand property</h3>
556648
@@ -560,7 +652,6 @@ The 'animation' shorthand property</h3>
560652 properties have lists of different lengths, a problem that cannot occur when they are defined using
561653 only the 'animation' shorthand.)
562654
563-
564655 <pre class='propdef'>
565656 Name : animation
566657 Value : <<single-animation>>#
@@ -611,6 +702,9 @@ Animation Events</h2>
611702 Any animation for which both a valid keyframe rule and a non-zero duration are defined will run
612703 and generate events; this includes animations with empty keyframe rules.
613704
705+ Issue: This contradicts the 'animation-delay' section,
706+ which says that a ''0s'' duration animation still fires events.
707+
614708 The time the animation has been running is sent with each event generated. This allows the event
615709 handler to determine the current iteration of a looping animation or the current position of an
616710 alternating animation. This time does not include any time the animation was in the ''paused''
@@ -791,8 +885,8 @@ Attributes</h4>
791885<h4 id="interface-csskeyframesrule-appendrule">
792886The <code>appendRule</code> method</h4>
793887
794- The <dfn method for="CSSKeyFramesRule">appendRule()</dfn> method appends the passed
795- <a idl>CSSKeyframeRule</a> into the list at the passed key.
888+ The <dfn method for="CSSKeyFramesRule">appendRule()</dfn> method appends the passed
889+ <a idl>CSSKeyframeRule</a> into the list at the passed key.
796890
797891 Parameters:
798892
0 commit comments