Tue, 03 Apr 2012 12:09:39 -0700
Copy clearer wording on list repetition from css3-transitions (which was in turn partly taken from css3-background).
1 <!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01//EN'
2 'http://www.w3.org/TR/html4/strict.dtd'>
4 <html lang="en">
5 <head>
6 <title>CSS Animations</title>
7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8 <link rel="stylesheet" type="text/css" href="../default.css">
9 <link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-ED.css">
10 </head>
12 <body>
14 <div class="head">
15 <!--logo-->
17 <h1>CSS Animations</h1>
19 <h2 class="no-num no-toc">[LONGSTATUS] [DATE]</h2>
20 <dl>
21 <dt>This version:
22 <dd><a href="[VERSION]">http://dev.w3.org/csswg/css3-animations/</a>
23 <!--http://www.w3.org/TR/[YEAR]/WD-[SHORTNAME]-[CDATE]-->
24 <dt>Latest version:
25 <dd><a
26 href="http://www.w3.org/TR/css3-animations/">[LATEST]</a>
27 <dt>Editor's draft:
28 <dd><a href="http://dev.w3.org/csswg/[SHORTNAME]/">http://dev.w3.org/csswg/[SHORTNAME]/</a>
30 <dt>Previous version:
31 <dd><a href="http://www.w3.org/TR/2012/WD-css3-animations-20120403/">
32 http://www.w3.org/TR/2012/WD-css3-animations-20120403/</a>
33 <dt id="editors-list">Editors:
34 <dd><a href="mailto:dino@apple.com">Dean Jackson</a> (<a
35 href="http://www.apple.com/">Apple Inc</a>)
36 <dd><a href="mailto:hyatt@apple.com">David Hyatt</a> (<a
37 href="http://www.apple.com/">Apple Inc</a>)
38 <dd><a href="mailto:cmarrin@apple.com">Chris Marrin</a> (<a
39 href="http://www.apple.com/">Apple Inc</a>)
40 <dd><a href="mailto:sylvaing@microsoft.com">Sylvain Galineau</a>
41 (<a class=org href="http://www.microsoft.com/">Microsoft</a>)
42 <dd class=vcard><a class=fn href="http://dbaron.org/">L. David Baron</a>
43 (<a class=org href="http://www.mozilla.org/">Mozilla</a>)
45 <dt>Issues list:
46 <dd><a href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&product=CSS&component=Animations&resolution=---&cmdtype=doit">in Bugzilla</a>
48 <dt>Discussion:</dt>
49 <dd><a href="http://lists.w3.org/Archives/Public/www-style/">www-style@w3.org</a> with subject line “<kbd>[[SHORTNAME]] <var>… message topic …</var></kbd>”
51 <dt>Test suite:
52 <dd>none yet
53 </dl>
55 <!--copyright-->
57 <hr title="Separator for header">
58 </div>
60 <h2 class="no-num no-toc" id="abstract">Abstract</h2>
62 <p>This CSS module describes a way for authors to animate the values of CSS properties over time, using keyframes.
63 The behavior of these keyframe animations can be controlled by specifying their duration, number of repeats,
64 and repeating behavior.
65 </p>
67 <h2 class="no-num no-toc" id="status">Status of this document</h2>
68 <!--status-->
71 <h2 class="no-num no-toc" id="contents">Table of contents</h2>
72 <!--toc-->
75 <h2 id="introduction">Introduction</h2>
77 <p><em>This section is not normative.</em>
79 <p>
80 CSS Transitions [[!CSS3-TRANSITIONS]] provide a way to interpolate CSS property values
81 when they change as a result of underlying property changes. This provides an easy way to do simple animation,
82 but the start and end states of the animation are controlled by the existing property values,
83 and transitions provide little control to the author on how the animation progresses.
84 </p>
85 <p>
86 This proposal introduces <em>defined animations</em>, in which the author can
87 specify the changes in CSS properties over time as a set of keyframes. Animations are similar to transitions
88 in that they change the presentational value of CSS properties over time.
89 The principal difference is that while transitions trigger <i>implicitly</i> when property values change, animations
90 are <i>explicitly</i> executed when the animation properties are applied. Because of this, animations require explicit
91 values for the properties being animated. These values are specified using animation keyframes, described below.
92 </p>
93 <p>
94 Many aspects of the animation can be controlled, including how many times the animation iterates, whether or not
95 it alternates between the begin and end values, and whether or not the animation should be running or paused.
96 An animation can also delay its start time.
97 </p>
99 <h2 id="animations">Animations</h2>
101 <p>
102 CSS Animations affect computed property values. During the execution of an animation, the
103 computed value for a property is controlled by the animation. This overrides the value
104 specified in the normal styling system.
105 </p>
107 <p>
108 In the case of multiple animations specifying behavior for the same property, the animation
109 defined last will override the previously defined animations.
110 </p>
112 <p>
113 An animation does not affect the computed value before the application of the animation,
114 before the animation delay has expired, and after the end of the animation.
115 </p>
117 <div class="figure">
118 <img src="sandwich.png" alt="">
119 </div>
120 <p class="caption">
121 Computation of animated property values
122 </p>
124 <p>
125 The diagram above shows how property values are computed. The intrinsic style is shown at the
126 top of the diagram. The computed value is derived from intrinsic style at the times when an
127 animation is not running and also when an animation is delayed (see below for specification of
128 animation delay). During an animation, the computed style is derived from the animated value.
129 </p>
131 <p>
132 The start time of an animation is the latter of two moments: the time at which the style is
133 resolved that specifies the animation, or the time the document's load event is fired.
134 Therefore, an animation specified in the document style sheet will begin at the document load.
135 An animation specified on an element by modifying the style after the document has loaded will
136 start when the style is resolved. That may be immediately in the case of a pseudo style rule
137 such as hover, or may be when the scripting engine returns control to the browser (in the case
138 of style applied by script).
139 </p>
141 <p>
142 An animation applies to an element if the element has a value for
143 <code class="property">'animation-name'</code> that references a valid
144 keyframes rule. Once an animation has started it continues until it ends
145 or the <code class="property">'animation-name'</code> is removed. The values
146 used for the keyframes and animation properties are snapshotted at the
147 time the animation starts. Changing them during the execution of the
148 animation has no effect. Note also, that changing the value of
149 <code class="property">'animation-name'</code> does not necessarily
150 restart an animation (e.g., if a list of animations are applied and
151 one is removed from the list, only that animation will stop; The other
152 animations will continue). In order to restart an animation, it must be
153 removed then reapplied.
154 </p>
156 <p>
157 The end of the animation is defined by the combination of the
158 <code class="property">'animation-duration'</code>,
159 <code class="property">'animation-iteration-count'</code> and
160 <code class="property">'animation-fill-mode'</code> properties.
161 </p>
163 <div class="example">
164 <p style="display:none">
165 Example(s):
166 </p>
167 <pre>
168 div {
169 animation-name: diagonal-slide;
170 animation-duration: 5s;
171 animation-iteration-count: 10;
172 }
174 @keyframes diagonal-slide {
176 from {
177 left: 0;
178 top: 0;
179 }
181 to {
182 left: 100px;
183 top: 100px;
184 }
186 }
188 </pre>This will produce an animation that moves an element from (0, 0) to (100px, 100px) over five seconds and repeats itself nine times (for a total of ten iterations).
189 </div>
191 <h2>Keyframes</h2>
192 <p>
193 Keyframes are used to specify the values for the animating properties at various points
194 during the animation. The keyframes specify the behavior of one cycle of the animation;
195 the animation may iterate one or more times.
196 </p>
197 <p>
198 Keyframes are specified using a specialized CSS at-rule. A <code
199 class="property">@keyframes</code> rule consists of the keyword
200 "@keyframes", followed by an identifier giving a name for the animation
201 (which will be referenced using <code class="property">'animation-name'</code>),
202 followed by a set of style rules (delimited by curly braces).
203 </p>
204 <p>
205 The <i>keyframe selector</i> for a keyframe style rule consists of a
206 comma-separated list of percentage values or the keywords 'from' or
207 'to'. The selector is used to specify the percentage along the duration
208 of the animation that the keyframe represents. The
209 keyframe itself is specified by the block of property values declared on
210 the selector. The keyword 'from' is equivalent to the value 0%. The
211 keyword 'to' is equivalent to the value 100%. Note that the percentage
212 unit specifier must be used on percentage values. Therefore, "0" is an
213 invalid keyframe selector.
214 </p>
215 <p>
216 If a 0% or "from" keyframe is not specified, then the user agent
217 constructs a 0% keyframe using the computed values of the properties
218 being animated. If a 100% or "to" keyframe is not specified, then the user agent
219 constructs a 100% keyframe using the computed values of the properties
220 being animated.
221 </p>
222 <p>
223 The <i>keyframe declaration</i> for a keyframe rule consists of
224 properties and values. Properties that are unable to be
225 animated are ignored in these rules, with the exception of <code
226 class="property">'animation-timing-function'</code>, the behavior
227 of which is described below.
228 </p>
229 <p class="note">
230 NOTE: describe what happens if a property is not present in all keyframes.
231 </p>
232 <p>
233 The @keyframes rule that is used by an animation will be the last one encountered in sorted rules order
234 that matches the name of the animation specified by the <code class="property">'animation-name'</code> property.
235 <code class="css">@keyframes</code> rules do not cascade;
236 therefore an animation will never derive keyframes from more than one <code class="css">@keyframes</code> rule.
237 </p>
238 <p>
239 To determine the set of keyframes, all of the values in the selectors are sorted in increasing order by time.
240 If there are any duplicates, then the last keyframe specified inside the <code class="css">@keyframes</code> rule
241 will be used to provide the keyframe information for that time. There is no cascading within a
242 <code class="css">@keyframes</code> rule if multiple keyframes specify the same keyframe selector values.
243 </p>
244 <p>
245 If property is not specified for a keyframe, or is specified but invalid, the animation of that property proceeds
246 as if that keyframe did not exist. Conceptually, it is as if a set of keyframes is constructed for each property
247 that is present in any of the keyframes, and an animation is run independently for each property.
248 </p>
249 <div class="example">
250 <p style="display:none">
251 Example(s):
252 </p>
253 <pre>
254 @keyframes wobble {
255 0% {
256 left: 100px;
257 }
259 40% {
260 left: 150px;
261 }
263 60% {
264 left: 75px;
265 }
267 100% {
268 left: 100px;
269 }
270 }
272 </pre>Four keyframes are specified for the animation named "wobble". In the first keyframe, shown at the beginning of the animation cycle, the 'left' value of the animation is 100px. By 40% of the animation duration, 'left' value has animated to 150px. At 60% of the animation duration, the 'left' value has animated back to 75px. At the end of the animation cycle, the 'left' value has returned to 100px. The diagram below shows the state of the animation if it were given a duration of 10s.
273 <div class="figure">
274 <img src="animation1.png" alt="">
275 </div>
276 <p class="caption">
277 Animations states specified by keyframes
278 </p>
279 </div>
281 <p>
282 The following is the grammar for the keyframes rule.
283 </p>
285 <pre>
287 keyframes_rule: KEYFRAMES_SYM S+ IDENT S* '{' S* keyframes_blocks '}' S*;
289 keyframes_blocks: [ keyframe_selector '{' S* declaration? [ ';' S* declaration? ]* '}' S* ]* ;
291 keyframe_selector: [ FROM_SYM | TO_SYM | PERCENTAGE ] S* [ ',' S* [ FROM_SYM | TO_SYM | PERCENTAGE ] S* ]*;
293 @{K}{E}{Y}{F}{R}{A}{M}{E}{S} {return KEYFRAMES_SYM;}
294 {F}{R}{O}{M} {return FROM_SYM;}
295 {T}{O} {return TO_SYM;}
296 </pre>
297 <!-- ======================================================================================================= -->
298 <h3 id="timing-functions"><a id="id=timing-functions-for-keyframes-">
299 Timing functions for keyframes
300 </a></h3>
301 <p>
302 A keyframe style rule may also declare the timing function that is to be used as the animation moves to the next keyframe.
303 </p>
304 <div class="example">
305 <p style="display:none">
306 Example(s):
307 </p>
308 <pre>
309 @keyframes bounce {
311 from {
312 top: 100px;
313 animation-timing-function: ease-out;
314 }
316 25% {
317 top: 50px;
318 animation-timing-function: ease-in;
319 }
321 50% {
322 top: 100px;
323 animation-timing-function: ease-out;
324 }
326 75% {
327 top: 75px;
328 animation-timing-function: ease-in;
329 }
331 to {
332 top: 100px;
333 }
335 }
337 </pre>Five keyframes are specified for the animation named "bounce". Between the first and second keyframe (i.e., between 0% and 25%) an "ease-out" timing function is used. Between the second and third keyframe (i.e., between 25% and 50%) an "ease-in" timing function is used. And so on. The effect will appear as an element that moves up the page 50px, slowing down as it reaches its highest point then speeding up as it falls back to 100px. The second half of the animation behaves in a similar manner, but only moves the element 25px units up the page. A timing function specified on the "to" or 100% keyframe is ignored
338 </div>
339 <p>
340 See <a href="#animation-timing-function_tag">the <code class="property">'animation-timing-function'</code>
341 property</a> for more information.
342 </p><!-- ======================================================================================================= -->
344 <!-- ======================================================================================================= -->
345 <h3 id="animation-name-property"><a id="the-animation-name-property-">
346 The <code class="property">'animation-name'</code> Property
347 </a></h3>
348 <p>
349 The <code class="property">'animation-name'</code> property defines a
350 list of animations that apply. Each name is used to select the keyframe at-rule
351 that provides the property values for the animation. If the name does
352 not match any keyframe at-rule, there are no properties to be animated
353 and the animation will not execute. Furthermore, if the animation name
354 is 'none' then there will be no animation. This can be used to override
355 any animations coming from the cascade. If animations are attempting to
356 modify the same property, then the animation closest to the end of the
357 list of names wins.
358 </p>
359 <p id="list-matching">
360 Each animation listed by name should have a corresponding value
361 for the other animation properties listed below. In the case where the
362 lists of values for the other animation properties do not have
363 the same length, the length of the 'animation-name' list
364 determines the number of items in each list examined when
365 starting transitions. The lists are matched up from the first
366 value: excess values at the end are not used. If one of the
367 other properties doesn't have enough comma-separated values to
368 match the number of values of 'animation-name', the UA must
369 calculate its used value by repeating the list of values until
370 there are enough. This truncation or repetition does not affect
371 the computed value.
372 <span class="note">
373 Note: This is analogous to the behavior of the 'background-*'
374 properties, with 'background-image' analogous to
375 'animation-name'.
376 </span>
377 </p>
379 <table class="propdef">
380 <tbody>
381 <tr>
382 <td>
383 <em>Name:</em>
384 </td>
385 <td>
386 <dfn id="animation-name">animation-name</dfn>
387 </td>
388 </tr>
389 <tr>
390 <td>
391 <em>Value:</em>
392 </td>
393 <td>
394 [ none | IDENT ] [, [ none | IDENT ] ]*
395 </td>
396 </tr>
397 <tr>
398 <td>
399 <em>Initial:</em>
400 </td>
401 <td>
402 none
403 </td>
404 </tr>
405 <tr>
406 <td>
407 <em>Applies to:</em>
408 </td>
409 <td>
410 all elements, :before and :after pseudo elements
411 </td>
412 </tr>
413 <tr>
414 <td>
415 <em>Inherited:</em>
416 </td>
417 <td>
418 no
419 </td>
420 </tr>
421 <tr>
422 <td>
423 <em>Percentages:</em>
424 </td>
425 <td>
426 N/A
427 </td>
428 </tr>
429 <tr>
430 <td>
431 <em>Media:</em>
432 </td>
433 <td>
434 visual
435 </td>
436 </tr>
437 <tr>
438 <td>
439 <em>Computed value:</em>
440 </td>
441 <td>
442 Same as specified value.
443 </td>
444 </tr>
445 </tbody>
446 </table>
448 <!--
449 <p>
450 It is possible for elements to have multiple animations running that change the same property or properties. In this case the animations combine in a manner defined by the property. For example, animations on <code class="property">'opacity'</code> will add together and animations on <code class="property">'transform'</code> will have their transformation matrices multiplied.
451 </p>
452 <div class="example">
453 <p style="display:none">
454 Example(s):
455 </p>
456 <pre>
457 @keyframes 'border-bloat' {
458 from {
459 border-width: 0;
460 }
461 to {
462 border-width: 10px;
463 }
464 }
466 @keyframes 'border-diet' {
467 from {
468 border-width: 4px;
469 }
470 to {
471 border-width: 2px;
472 }
473 }
475 div {
476 animation-name: 'border-bloat', 'border-diet';
477 animation-duration: 10s, 4s;
478 }
479 </pre>
480 <p>
481 The above example has two animations executing on the same property, <code class="property">'border-width'</code>. The animations are additive. That is, the
482 resulting value for the property will be the addition of the values from the
483 two animations.
484 </p>
485 <p>
486 At time '0s' the element's border will be 4px wide (0px from 'border-bloat' plus 4px from 'border-diet').
487 At time '4s' the element's border will be 6px wide (4px from 'border-bloat' plus 2px from 'border-diet').
488 At time '10s' the element's border will be 10px wide (10px from 'border-bloat' and no addition from
489 'border-diet' as it is no longer executing).
490 </p>
491 </div>
492 -->
495 <!-- ======================================================================================================= -->
496 <h3 id="animation-duration-property"><a id="the-animation-duration-property-">
497 The <code class="property">'animation-duration'</code> Property
498 </a></h3>
499 <p>
500 The <code class="property">'animation-duration'</code> property defines the length of time that an animation takes to complete one cycle.
501 </p>
502 <table class="propdef">
503 <tbody>
504 <tr>
505 <td>
506 <em>Name:</em>
507 </td>
508 <td>
509 <dfn id="animation-duration">animation-duration</dfn>
510 </td>
511 </tr>
512 <tr>
513 <td>
514 <em>Value:</em>
515 </td>
516 <td>
517 <time> [, <time>]*
518 </td>
519 </tr>
520 <tr>
521 <td>
522 <em>Initial:</em>
523 </td>
524 <td>
525 0s
526 </td>
527 </tr>
528 <tr>
529 <td>
530 <em>Applies to:</em>
531 </td>
532 <td>
533 all elements, :before and :after pseudo elements
534 </td>
535 </tr>
536 <tr>
537 <td>
538 <em>Inherited:</em>
539 </td>
540 <td>
541 no
542 </td>
543 </tr>
544 <tr>
545 <td>
546 <em>Percentages:</em>
547 </td>
548 <td>
549 N/A
550 </td>
551 </tr>
552 <tr>
553 <td>
554 <em>Media:</em>
555 </td>
556 <td>
557 visual
558 </td>
559 </tr>
560 <tr>
561 <td>
562 <em>Computed value:</em>
563 </td>
564 <td>
565 Same as specified value.
566 </td>
567 </tr>
568 </tbody>
569 </table>
571 <p>
572 By default the value is '0s', meaning that the animation cycle is
573 immediate. A negative value for <code
574 class="property">'animation-duration'</code> is treated as '0s'. In this
575 case <code class="property">'animation-fill-mode'</code> still applies,
576 so an animation that fills backwards will show the value of the 0%
577 keyframe during any delay period, and an animation that fill forwards
578 will retain the value specified at the 100% keyframe, even if the
579 animation was instantaneous. Also, animation events are still fired.
580 </p>
582 <!-- ======================================================================================================= -->
583 <h3 id="animation-timing-function-property"><a id="animation-timing-function_tag">
584 The <code class="property">'animation-timing-function'</code> Property
585 </a></h3>
586 <p>
587 The <code class="property">'animation-timing-function'</code> property describes how the animation will progress over one cycle of its duration. See the <code class="property">'transition-timing-function'</code> property [[!CSS3-TRANSITIONS]] for a complete description of timing function calculation.
588 </p>
589 <table class="propdef">
590 <tbody>
591 <tr>
592 <td>
593 <em>Name:</em>
594 </td>
595 <td>
596 <dfn id="animation-timing-function">animation-timing-function</dfn>
597 </td>
598 </tr>
599 <tr>
600 <td>
601 <em>Value:</em>
602 </td>
603 <td>
604 [ ease | linear | ease-in | ease-out | ease-in-out | step-start | step-end | steps(<number>[, [ start | end ] ]?) | cubic-bezier(<number>, <number>, <number>, <number>) ] [, [ ease | linear | ease-in | ease-out | ease-in-out | step-start | step-end | steps(<number>[, [ start | end ] ]?) | cubic-bezier(<number>, <number>, <number>, <number>)] ]*
605 </td>
606 </tr>
607 <tr>
608 <td>
609 <em>Initial:</em>
610 </td>
611 <td>
612 ease
613 </td>
614 </tr>
615 <tr>
616 <td>
617 <em>Applies to:</em>
618 </td>
619 <td>
620 all elements, :before and :after pseudo elements
621 </td>
622 </tr>
623 <tr>
624 <td>
625 <em>Inherited:</em>
626 </td>
627 <td>
628 no
629 </td>
630 </tr>
631 <tr>
632 <td>
633 <em>Percentages:</em>
634 </td>
635 <td>
636 N/A
637 </td>
638 </tr>
639 <tr>
640 <td>
641 <em>Media:</em>
642 </td>
643 <td>
644 visual
645 </td>
646 </tr>
647 <tr>
648 <td>
649 <em>Computed value:</em>
650 </td>
651 <td>
652 Same as specified value.
653 </td>
654 </tr>
655 </tbody>
656 </table>
658 <p>
659 For a keyframed animation, the <code class="property">'animation-timing-function'</code> applies
660 between keyframes, not over the entire animation. For example, in the case of an ease-in-out timing function, an animation will ease in at the start of the keyframe and ease out at the end of the keyframe. A <code class="property">'animation-timing-function'</code> defined within a keyframe block applies to that keyframe, otherwise the timing function specified for the animation is used.
661 </p>
663 <!-- ======================================================================================================= -->
664 <h3 id="animation-iteration-count-property"><a id="the-animation-iteration-count-property-">
665 The <code class="property">'animation-iteration-count'</code> Property
666 </a></h3>
667 <p>
668 The <code class="property">'animation-iteration-count'</code> property defines the number of times
669 an animation cycle is played. The default value is one, meaning the animation will play from
670 beginning to end once. A value of <code class="css">'infinite'</code> will cause the animation to
671 repeat forever. Non-integer numbers will cause the animation to end part-way through a cycle.
672 Negative values of <code class="property">'animation-iteration-count'</code> are invalid.
673 This property is often used with an <code class="property">'animation-direction'</code> value of
674 <code class="css">alternate</code>, which will cause the animation to play in reverse on alternate cycles.
675 </p>
676 <table class="propdef">
677 <tbody>
678 <tr>
679 <td>
680 <em>Name:</em>
681 </td>
682 <td>
683 <dfn id="animation-iteration-count">animation-iteration-count</dfn>
684 </td>
685 </tr>
686 <tr>
687 <td>
688 <em>Value:</em>
689 </td>
690 <td>
691 [ infinite | <number> ] [, [ infinite | <number> ] ]*
692 </td>
693 </tr>
694 <tr>
695 <td>
696 <em>Initial:</em>
697 </td>
698 <td>
699 1
700 </td>
701 </tr>
702 <tr>
703 <td>
704 <em>Applies to:</em>
705 </td>
706 <td>
707 all elements, :before and :after pseudo elements
708 </td>
709 </tr>
710 <tr>
711 <td>
712 <em>Inherited:</em>
713 </td>
714 <td>
715 no
716 </td>
717 </tr>
718 <tr>
719 <td>
720 <em>Percentages:</em>
721 </td>
722 <td>
723 N/A
724 </td>
725 </tr>
726 <tr>
727 <td>
728 <em>Media:</em>
729 </td>
730 <td>
731 visual
732 </td>
733 </tr>
734 <tr>
735 <td>
736 <em>Computed value:</em>
737 </td>
738 <td>
739 Same as specified value.
740 </td>
741 </tr>
742 </tbody>
743 </table><!-- ======================================================================================================= -->
744 <h3 id="animation-direction-property"><a id="the-animation-direction-property-">
745 The <code class="property">'animation-direction'</code> Property
746 </a></h3>
747 <p>
748 The <code class="property">'animation-direction'</code> property defines whether or not the animation should play in reverse on some or all cycles. When an animation is played in reverse the timing functions are also reversed. For example, when played in reverse an ease-in animation would appear to be an ease-out animation.
749 </p>
750 <table class="propdef">
751 <tbody>
752 <tr>
753 <td>
754 <em>Name:</em>
755 </td>
756 <td>
757 <dfn id="animation-direction">animation-direction</dfn>
758 </td>
759 </tr>
760 <tr>
761 <td>
762 <em>Value:</em>
763 </td>
764 <td>
765 [ normal | reverse | alternate | alternate-reverse ] [, [ normal | reverse | alternate | alternate-reverse ] ]*
766 </td>
767 </tr>
768 <tr>
769 <td>
770 <em>Initial:</em>
771 </td>
772 <td>
773 normal
774 </td>
775 </tr>
776 <tr>
777 <td>
778 <em>Applies to:</em>
779 </td>
780 <td>
781 all elements, :before and :after pseudo elements
782 </td>
783 </tr>
784 <tr>
785 <td>
786 <em>Inherited:</em>
787 </td>
788 <td>
789 no
790 </td>
791 </tr>
792 <tr>
793 <td>
794 <em>Percentages:</em>
795 </td>
796 <td>
797 N/A
798 </td>
799 </tr>
800 <tr>
801 <td>
802 <em>Media:</em>
803 </td>
804 <td>
805 visual
806 </td>
807 </tr>
808 <tr>
809 <td>
810 <em>Computed value:</em>
811 </td>
812 <td>
813 Same as specified value.
814 </td>
815 </tr>
816 </tbody>
817 </table>
818 <dl>
819 <dt>normal</dt>
820 <dd>All iterations of the animation are played as specified.</dd>
821 <dt>reverse</dt>
822 <dd>All iterations of the animation are played in the reverse direction from the way they were specified.</dd>
823 <dt>alternate</dt>
824 <dd>The animation cycle iterations that are odd counts are played in the normal direction, and the animation cycle iterations that are even counts are played in a reverse direction.</dd>
825 <dt>alternate-reverse</dt>
826 <dd>The animation cycle iterations that are odd counts are played in the reverse direction, and the animation cycle iterations that are even counts are played in a normal direction.</dd>
827 </dl>
828 <!-- ======================================================================================================= -->
829 <h3 id="animation-play-state-property"><span id="the-animation-play-state-property-">
830 The <code class="property">'animation-play-state'</code> Property
831 </a></h3>
833 <p>
834 The <code class="property">'animation-play-state'</code> property defines whether the animation is running or paused. A running animation can be paused by setting this property to <code class="css">'paused'</code>. To continue running a paused animation this property can be set to <code class="css">'running'</code>. A paused animation will continue to display the current value of the animation in a static state, as if the time of the animation is constant. When a paused animation is resumed, it restarts from the current value, not necessarily from the beginning of the animation.
835 </p>
836 <table class="propdef">
837 <tbody>
838 <tr>
839 <td>
840 <em>Name:</em>
841 </td>
842 <td>
843 <dfn id="animation-play-state">animation-play-state</dfn>
844 </td>
845 </tr>
846 <tr>
847 <td>
848 <em>Value:</em>
849 </td>
850 <td>
851 [ running | paused ] [, [ running | paused ] ]*
852 </td>
853 </tr>
854 <tr>
855 <td>
856 <em>Initial:</em>
857 </td>
858 <td>
859 running
860 </td>
861 </tr>
862 <tr>
863 <td>
864 <em>Applies to:</em>
865 </td>
866 <td>
867 all elements, :before and :after pseudo elements
868 </td>
869 </tr>
870 <tr>
871 <td>
872 <em>Inherited:</em>
873 </td>
874 <td>
875 no
876 </td>
877 </tr>
878 <tr>
879 <td>
880 <em>Percentages:</em>
881 </td>
882 <td>
883 N/A
884 </td>
885 </tr>
886 <tr>
887 <td>
888 <em>Media:</em>
889 </td>
890 <td>
891 visual
892 </td>
893 </tr>
894 <tr>
895 <td>
896 <em>Computed value:</em>
897 </td>
898 <td>
899 Same as specified value.
900 </td>
901 </tr>
902 </tbody>
903 </table><!-- ======================================================================================================= -->
904 <h3 id="animation-delay-property"><a id="the-animation-delay-property-">
905 The <code class="property">'animation-delay'</code> Property
906 </a></h3>
907 <p>
908 The <code class="property">'animation-delay'</code> property defines
909 when the animation will start. It allows an animation to begin
910 execution some time after it is applied. An <code
911 class="property">'animation-delay'</code> value of '0s' means the
912 animation will execute as soon as it is applied. Otherwise, the value
913 specifies an offset from the moment the animation is applied, and the
914 animation will delay execution by that offset.
915 </p>
916 <p>
917 If the value for <code class="property">'animation-delay'</code> is a
918 negative time offset then the animation will execute the moment it is
919 applied, but will appear to have begun execution at the specified
920 offset. That is, the animation will appear to begin part-way through
921 its play cycle. In the case where an animation has implied starting
922 values and a negative <code class="property">'animation-delay'</code>,
923 the starting values are taken from the moment the animation is applied.
924 </p>
925 <table class="propdef">
926 <tbody>
927 <tr>
928 <td>
929 <em>Name:</em>
930 </td>
931 <td>
932 <dfn id="animation-delay">animation-delay</dfn>
933 </td>
934 </tr>
935 <tr>
936 <td>
937 <em>Value:</em>
938 </td>
939 <td>
940 <time> [, <time>]*
941 </td>
942 </tr>
943 <tr>
944 <td>
945 <em>Initial:</em>
946 </td>
947 <td>
948 0s
949 </td>
950 </tr>
951 <tr>
952 <td>
953 <em>Applies to:</em>
954 </td>
955 <td>
956 all elements, :before and :after pseudo elements
957 </td>
958 </tr>
959 <tr>
960 <td>
961 <em>Inherited:</em>
962 </td>
963 <td>
964 no
965 </td>
966 </tr>
967 <tr>
968 <td>
969 <em>Percentages:</em>
970 </td>
971 <td>
972 N/A
973 </td>
974 </tr>
975 <tr>
976 <td>
977 <em>Media:</em>
978 </td>
979 <td>
980 visual
981 </td>
982 </tr>
983 <tr>
984 <td>
985 <em>Computed value:</em>
986 </td>
987 <td>
988 Same as specified value.
989 </td>
990 </tr>
991 </tbody>
992 </table><!-- ======================================================================================================= -->
993 <h3 id="animation-fill-mode-property"><a id="the-animation-fill-mode-property-">
994 The <code class="property">'animation-fill-mode'</code> Property
995 </a></h3>
996 <p>
997 The <code class="property">'animation-fill-mode'</code> property defines
998 what values are applied by the animation outside the time it is executing.
999 By default, an animation will not affect property values between the
1000 time it is applied (the <code class="property">'animation-name'</code> property is
1001 set on an element) and the time it begins execution (which is determined by
1002 the <code class="property">'animation-delay'</code> property). Also, by
1003 default an animation does not affect property values after the animation
1004 ends (determined by the <code class="property">'animation-duration'</code> property).
1005 The value of <code class="property">'animation-fill-mode'</code> can
1006 override this behavior.
1007 </p>
1008 <p>
1009 If the value for <code class="property">'animation-fill-mode'</code> is
1010 <code class="css">'backwards'</code>, then the animation will
1011 apply the property values defined in its 0% or 'from' keyframe as soon
1012 as the animation is applied, during the period defined by
1013 <code class="property">'animation-delay'</code>.
1014 </p>
1015 <p>
1016 If the value for <code class="property">'animation-fill-mode'</code>
1017 is <code class="css">'forwards'</code>, then the animation will
1018 apply the property values defined in its last executing keyframe after
1019 the final iteration of the animation, until the animation style is
1020 removed. The last executing keyframe is the 'to' or '100%' keyframe,
1021 unless the animation has <code
1022 class="property">'animation-direction'</code> set to <code
1023 class="css">'alternate'</code> and both a finite and even
1024 iteration count, in which case it is the 'from' or '0%' keyframe.
1025 </p>
1026 <p>
1027 If the value for <code class="property">'animation-fill-mode'</code>
1028 is <code class="css">'both'</code>, then the animation will
1029 follow the rules for both 'forwards' and 'backwards'. That is, it will
1030 extend the animation properties in both directions.
1031 </p>
1032 <table class="propdef">
1033 <tbody>
1034 <tr>
1035 <td>
1036 <em>Name:</em>
1037 </td>
1038 <td>
1039 <dfn id="animation-fill-mode">animation-fill-mode</dfn>
1040 </td>
1041 </tr>
1042 <tr>
1043 <td>
1044 <em>Value:</em>
1045 </td>
1046 <td>
1047 [ none | forwards | backwards | both ] [, [ none | forwards | backwards | both ] ]*
1048 </td>
1049 </tr>
1050 <tr>
1051 <td>
1052 <em>Initial:</em>
1053 </td>
1054 <td>
1055 none
1056 </td>
1057 </tr>
1058 <tr>
1059 <td>
1060 <em>Applies to:</em>
1061 </td>
1062 <td>
1063 all elements, :before and :after pseudo elements
1064 </td>
1065 </tr>
1066 <tr>
1067 <td>
1068 <em>Inherited:</em>
1069 </td>
1070 <td>
1071 no
1072 </td>
1073 </tr>
1074 <tr>
1075 <td>
1076 <em>Percentages:</em>
1077 </td>
1078 <td>
1079 N/A
1080 </td>
1081 </tr>
1082 <tr>
1083 <td>
1084 <em>Media:</em>
1085 </td>
1086 <td>
1087 visual
1088 </td>
1089 </tr>
1090 <tr>
1091 <td>
1092 <em>Computed value:</em>
1093 </td>
1094 <td>
1095 Same as specified value.
1096 </td>
1097 </tr>
1098 </tbody>
1099 </table><!-- ======================================================================================================= -->
1100 <h3 id="animation-shorthand-property"><a id="the-animation-shorthand-property-">
1101 The <code class="property">'animation'</code> Shorthand Property
1102 </a></h3>
1103 <p>
1104 The <code class="property">'animation'</code> shorthand property
1105 combines seven of the animation properties into a single property.
1106 </p>
1107 <p>
1108 Note that order is important in this property. The first value that can be
1109 parsed as a time is assigned to the animation-duration. The second value that
1110 can be parsed as a time is assigned to animation-delay.
1111 </p>
1112 <p class="issue">
1113 An alternative proposal is to accept the font shorthand approach of
1114 using a "/" character between the values of the same type. e.g. 2s/4s would
1115 mean a duration of 2 seconds and a delay of 4 seconds.
1116 </p>
1117 <table class="propdef">
1118 <tbody>
1119 <tr>
1120 <td>
1121 <em>Name:</em>
1122 </td>
1123 <td>
1124 <dfn id="animation">animation</dfn>
1125 </td>
1126 </tr>
1127 <tr>
1128 <td>
1129 <em>Value:</em>
1130 </td>
1131 <td>
1132 [<animation-name> ||
1133 <animation-duration> ||
1134 <animation-timing-function> ||
1135 <animation-delay> ||
1136 <animation-iteration-count> ||
1137 <animation-direction> ||
1138 <animation-fill-mode>]
1139 [, [<animation-name> ||
1140 <animation-duration> ||
1141 <animation-timing-function> ||
1142 <animation-delay> ||
1143 <animation-iteration-count> ||
1144 <animation-direction> ||
1145 <animation-fill-mode>] ]*
1146 </td>
1147 </tr>
1148 <tr>
1149 <td>
1150 <em>Initial:</em>
1151 </td>
1152 <td>
1153 see individual properties
1154 </td>
1155 </tr>
1156 <tr>
1157 <td>
1158 <em>Applies to:</em>
1159 </td>
1160 <td>
1161 all elements, :before and :after pseudo elements
1162 </td>
1163 </tr>
1164 <tr>
1165 <td>
1166 <em>Inherited:</em>
1167 </td>
1168 <td>
1169 no
1170 </td>
1171 </tr>
1172 <tr>
1173 <td>
1174 <em>Percentages:</em>
1175 </td>
1176 <td>
1177 N/A
1178 </td>
1179 </tr>
1180 <tr>
1181 <td>
1182 <em>Media:</em>
1183 </td>
1184 <td>
1185 visual
1186 </td>
1187 </tr>
1188 <tr>
1189 <td>
1190 <em>Computed value:</em>
1191 </td>
1192 <td>
1193 Same as specified value.
1194 </td>
1195 </tr>
1196 </tbody>
1197 </table><!-- ======================================================================================================= -->
1198 <h2 id="animation-events"><a id="animation-events-">
1199 Animation Events
1200 </a></h2>
1201 <p>
1202 Several animation related events are available through the <a
1203 href="http://www.w3.org/TR/DOM-Level-2-Events/events.html">DOM Event
1204 system</a>. The start and end of an animation, and the end of each
1205 iteration of an animation all generate DOM events. An element can have
1206 multiple properties being animated simultaneously. This can occur either
1207 with a single <code class="property">animation-name</code> value with
1208 keyframes containing multiple properties, or with multiple <code
1209 class="property">animation-name</code> values. For the purposes of
1210 events, each <code class="property">animation-name</code> specifies a
1211 single animation. Therefore an event will be generated for each <code
1212 class="property">animation-name</code> value and not necessarily for
1213 each property being animated.
1214 </p>
1215 <p>
1216 The time the animation has been running is sent with each event
1217 generated. This allows the event handler to determine the current
1218 iteration of a looping animation or the current position of an
1219 alternating animation. This time does not include any time the animation
1220 was in the <code>paused</code> play state.
1221 </p>
1222 <dl>
1223 <dt>
1224 <b>Interface <i><a id="Events-AnimationEvent" name='Events-AnimationEvent'>AnimationEvent</a></i></b>
1225 </dt>
1226 <dd>
1227 <p>
1228 The <code>AnimationEvent</code> interface provides specific contextual information associated with Animation events.
1229 </p>
1230 <dl>
1231 <dt>
1232 <br>
1233 <b>IDL Definition</b>
1234 </dt>
1235 <dd>
1236 <div class='idl-code'>
1237 <pre>
1238 interface AnimationEvent : Event {
1239 readonly attribute DOMString animationName;
1240 readonly attribute float elapsedTime;
1241 void initAnimationEvent(in DOMString typeArg,
1242 in boolean canBubbleArg,
1243 in boolean cancelableArg,
1244 in DOMString animationNameArg,
1245 in float elapsedTimeArg);
1246 };
1247 </pre>
1248 </div>
1249 </dd>
1250 <dt>
1251 <b>Attributes</b>
1252 </dt>
1253 <dd>
1254 <dl>
1255 <dt>
1256 <code class='attribute-name'><a id="Events-AnimationEvent-animationName" name='Events-AnimationEvent-animationName'>animationName</a></code> of type <code>DOMString</code>, readonly
1257 </dt>
1258 <dd>
1259 The value of the <code class="property">animation-name</code> property of the
1260 animation that fired the event.
1261 </dd>
1262 </dl>
1263 <dl>
1264 <dt>
1265 <code class='attribute-name'><a id="Events-AnimationEvent-elapsedTime" name='Events-AnimationEvent-elapsedTime'>elapsedTime</a></code> of type <code>float</code>, readonly
1266 </dt>
1267 <dd>
1268 The amount of time the animation has been running, in
1269 seconds, when this event fired, excluding any time the
1270 animation was paused. For an "animationstart" event, the
1271 elapsedTime is zero unless there was a negative value for
1272 <code class="property">animation-delay</code>, in which
1273 case the event will be fired with an elapsedTime of (-1 *
1274 delay).
1275 </dd>
1276 </dl>
1277 </dd>
1278 <dt>
1279 <b>Methods</b>
1280 </dt>
1281 <dd>
1282 <dl>
1283 <dt>
1284 <code class='method-name'><a id="Events-AnimationEvent-initAnimationEvent" name='Events-AnimtionEvent-initAnimationEvent'>initAnimationEvent</a></code>
1285 </dt>
1286 <dd>
1287 <div class='method'>
1288 The <code>initAnimationEvent</code> method is used to initialize the value of an <code>AnimationEvent</code> created through the <a href='http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-DocumentEvent'><code>DocumentEvent</code></a> interface. This method may only be called before the <code>AnimationEvent</code> has been dispatched via the <code>dispatchEvent</code> method, though it may be called multiple times during that phase if necessary. If called multiple times, the final invocation takes precedence.
1289 <div class='parameters'>
1290 <b>Parameters</b>
1291 <div class='paramtable'>
1292 <dl>
1293 <dt>
1294 <code class='parameter-name'>typeArg</code> of type <code>DOMString</code>
1295 </dt>
1296 <dd>
1297 Specifies the event type.<br>
1298 </dd>
1299 <dt>
1300 <code class='parameter-name'>canBubbleArg</code> of type <code>boolean</code>
1301 </dt>
1302 <dd>
1303 Specifies whether or not the event can bubble.<br>
1304 </dd>
1305 <dt>
1306 <code class='parameter-name'>cancelableArg</code> of type <code>boolean</code>
1307 </dt>
1308 <dd>
1309 Specifies whether or not the event's default action can be prevented.
1310 </dd>
1311 <dt>
1312 <code class='parameter-name'>animationNameArg</code> of type <code>DOMString</code>
1313 </dt>
1314 <dd>
1315 Specifies the <a href='http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Event'><code>Event</code></a>'s animation name.<br>
1316 </dd>
1317 <dt>
1318 <code class='parameter-name'>elapsedTimeArg</code> of type <code>float</code>
1319 </dt>
1320 <dd>
1321 Specifies the amount of time, in seconds, the animation has been running at the time of initialization.
1322 </dd>
1323 </dl>
1324 </div>
1325 </div><!-- parameters -->
1326 <div>
1327 <b>No Return Value</b>
1328 </div>
1329 <div>
1330 <b>No Exceptions</b>
1331 </div>
1332 </div><!-- method -->
1333 </dd>
1334 </dl>
1335 </dd>
1336 </dl>
1337 </dd>
1338 </dl>
1339 <p>
1340 The different types of Animation events that can occur are:
1341 </p>
1342 <dl>
1343 <dt>
1344 <b>animationstart</b>
1345 </dt>
1346 <dd>
1347 The 'animationstart' event occurs at the start of the animation. If there is an
1348 <code class="property">animation-delay</code> then this event will fire once the delay period
1349 has expired. A negative delay will cause the event to fire with an elapsedTime equal to
1350 the absolute value of the delay.
1351 <ul>
1352 <li>Bubbles: Yes
1353 </li>
1354 <li>Cancelable: No
1355 </li>
1356 <li>Context Info: animationName
1357 </li>
1358 </ul>
1359 </dd>
1360 <dt>
1361 <b>animationend</b>
1362 </dt>
1363 <dd>
1364 The 'animationend' event occurs when the animation finishes.
1365 <ul>
1366 <li>Bubbles: Yes
1367 </li>
1368 <li>Cancelable: No
1369 </li>
1370 <li>Context Info: animationName, elapsedTime
1371 </li>
1372 </ul>
1373 </dd>
1374 <dt>
1375 <b>animationiteration</b>
1376 </dt>
1377 <dd>
1378 The 'animationiteration' event occurs at the end of each iteration of an animation for which <code>animation-iteration-count</code> is greater than one. This event does not occur for animations with an iteration count of one.
1379 <ul>
1380 <li>Bubbles: Yes
1381 </li>
1382 <li>Cancelable: No
1383 </li>
1384 <li>Context Info: animationName, elapsedTime
1385 </li>
1386 </ul>
1387 </dd>
1388 </dl>
1389 <!-- ======================================================================================================= -->
1390 <h2 id="dom-interfaces"><a id="dom-interfaces-">
1391 DOM Interfaces
1392 </a></h2>
1393 <p>
1394 CSS animation is exposed to the CSSOM through a pair of new interfaces
1395 describing the keyframes.
1396 </p>
1397 <dl>
1398 <dt>
1399 <b>Interface <i><a id="DOM-CSSRule" name='DOM-CSSRule'>CSSRule</a></i></b>
1400 </dt>
1401 <dd>
1402 <p>
1403 The following 2 rule types are added to the <code>CSSRule</code> interface. They provide identification for the new keyframe and keyframes rules.
1404 </p>
1405 <dl>
1407 <dt>
1408 <b>IDL Definition</b>
1409 </dt>
1410 <dd>
1411 <div class='idl-code'>
1412 <pre>
1413 interface CSSRule {
1414 ...
1415 const unsigned short KEYFRAMES_RULE = 7;
1416 const unsigned short KEYFRAME_RULE = 8;
1417 ...
1418 };</pre>
1419 </div>
1420 </dd> <!-- IDL -->
1421 </dl>
1422 </dd>
1424 <dt>
1425 <b>Interface <i><a id="DOM-CSSKeyframeRule" name='DOM-CSSKeyframeRule'>CSSKeyframeRule</a></i></b>
1426 </dt>
1427 <dd>
1428 <p>
1429 The <code>CSSKeyframeRule</code> interface represents the style rule for a single key.
1430 </p>
1431 <dl>
1432 <dt>
1433 <br>
1434 <b>IDL Definition</b>
1435 </dt>
1436 <dd>
1437 <div class='idl-code'>
1438 <pre>
1439 interface CSSKeyframeRule : CSSRule {
1440 attribute DOMString keyText;
1441 readonly attribute CSSStyleDeclaration style;
1442 };
1443 </pre>
1444 </div><br>
1445 </dd>
1446 <dt>
1447 <b>Attributes</b>
1448 </dt>
1449 <dd>
1450 <dl>
1451 <dt>
1452 <code class='attribute-name'><a id="DOM-CSSKeyframeRule-keyText" name='DOM-CSSKeyframeRule-keyText'>keyText</a></code> of type <code>DOMString</code>
1453 </dt>
1454 <dd>
1455 This attribute represents the key as the string representation of a floating point number between 0 and 1. If the value
1456 in the CSS style is <code>from</code> this value will be 0, and if the value in the CSS style is <code>to</code> this
1457 value will be 1.<br>
1458 </dd>
1459 </dl>
1460 </dd>
1461 <dd>
1462 <dl>
1463 <dt>
1464 <code class='attribute-name'><a id="DOM-CSSKeyframeRule-style" name='DOM-CSSKeyframeRule-style'>style</a></code> of type <code>CSSStyleDeclaration</code>
1465 </dt>
1466 <dd>
1467 This attribute represents the style associated with this keyframe.<br>
1468 </dd>
1469 </dl>
1470 </dd>
1471 <dt>
1472 <b>No Methods</b>
1473 </dt>
1474 </dl>
1475 </dd>
1476 </dl>
1477 <dl>
1478 <dt>
1479 <b>Interface <i><a id="DOM-CSSKeyframesRule" name='DOM-CSSKeyframesRule'>CSSKeyframesRule</a></i></b>
1480 </dt>
1481 <dd>
1482 <p>
1483 The <code>CSSKeyframesRule</code> interface represents a complete set of keyframes for a single animation.
1484 </p>
1485 <dl>
1486 <dt>
1487 <br>
1488 <b>IDL Definition</b>
1489 </dt>
1490 <dd>
1491 <div class='idl-code'>
1492 <pre>
1493 interface CSSKeyframesRule : CSSRule {
1494 attribute DOMString name;
1495 readonly attribute CSSRuleList cssRules;
1497 void appendRule(in DOMString rule);
1498 void deleteRule(in DOMString key);
1499 CSSKeyframeRule findRule(in DOMString key);
1500 };
1501 </pre>
1502 </div><br>
1503 </dd>
1504 <dt>
1505 <b>Attributes</b>
1506 </dt>
1507 <dd>
1508 <dl>
1509 <dt>
1510 <code class='attribute-name'><a id="DOM-CSSKeyframesRule-name" name='DOM-CSSKeyframesRule-name'>name</a></code> of type <code>DOMString</code>
1511 </dt>
1512 <dd>
1513 This attribute is the name of the keyframes, used by the <code>animation-name</code> property.<br>
1514 </dd>
1515 </dl>
1516 </dd>
1517 <dd>
1518 <dl>
1519 <dt>
1520 <code class='attribute-name'><a id="DOM-CSSKeyframeRules-cssRules" name='DOM-CSSKeyframeRules-cssRules'>cssRules</a></code> of type <code>CSSRuleList</code>
1521 </dt>
1522 <dd>
1523 This attribute gives access to the keyframes in the list.<br>
1524 </dd>
1525 </dl>
1526 </dd>
1527 <dt>
1528 <b>Methods</b>
1529 </dt>
1530 <dd>
1531 <dl>
1532 <!-- ======================================================================================================= -->
1533 <dt>
1534 <code class='method-name'><a id="DOM-CSSKeyframesRule-appendRule" name='DOM-CSSKeyframesRule-appendRule'>appendRule</a></code>
1535 </dt>
1536 <dd>
1537 <div class='method'>
1538 The <code>appendRule</code> method appends the passed CSSKeyframeRule into the list at the passed key.
1539 <div class='parameters'>
1540 <b>Parameters</b>
1541 <div class='paramtable'>
1542 <dl>
1543 <dt>
1544 <code class='parameter-name'>rule</code> of type <code>DOMString</code>
1545 </dt>
1546 <dd>
1547 The rule to be appended, expressed in the same syntax as one entry in the
1548 <code>@keyframes</code> rule.
1549 </dd>
1550 </dl>
1551 </div>
1552 </div><!-- parameters -->
1553 <div class='return-value'>
1554 <b>No Return Value</b>
1555 </div>
1556 <div>
1557 <b>No Exceptions</b>
1558 </div>
1559 </div><!-- ======================================================================================================= -->
1560 </dd>
1561 <dt>
1562 <code class='method-name'><a id="DOM-CSSKeyframesRule-deleteRule" name='DOM-CSSKeyframesRule-deleteRule'>deleteRule</a></code>
1563 </dt>
1564 <dd>
1565 <div class='method'>
1566 The <code>deleteRule</code> method deletes the CSSKeyframeRule with the passed key. If a rule with this key
1567 does not exist, the method does nothing.
1568 <div class='parameters'>
1569 <b>Parameters</b>
1570 <div class='paramtable'>
1571 <dl>
1572 <dt>
1573 <code class='parameter-name'>key</code> of type <code>DOMString</code>
1574 </dt>
1575 <dd>
1576 The key which describes the rule to be deleted. The key must
1577 resolve to a number between 0 and 1, or the rule is ignored.<br>
1578 </dd>
1579 </dl>
1580 </div>
1581 </div><!-- parameters -->
1582 <div class='return-value'>
1583 <b>No Return Value</b>
1584 </div>
1585 <div>
1586 <b>No Exceptions</b>
1587 </div>
1588 </div><!-- ======================================================================================================= -->
1589 </dd>
1590 <dt>
1591 <code class='method-name'><a id="DOM-CSSKeyframesRule-findRule" name='DOM-CSSKeyframesRule-findRule'>findRule</a></code>
1592 </dt>
1593 <dd>
1594 <div class='method'>
1595 The <code>findRule</code> method returns the rule with a key matching the passed key. If no such rule
1596 exists, a null value is returned.
1597 <div class='parameters'>
1598 <b>Parameters</b>
1599 <div class='paramtable'>
1600 <dl>
1601 <dt>
1602 <code class='parameter-name'>key</code> of type <code>DOMString</code>
1603 </dt>
1604 <dd>
1605 The key which described the rule to find. The key must
1606 resolve to a number between 0 and 1, or the rule is ignored.<br>
1607 </dd>
1608 </dl>
1609 </div>
1610 </div><!-- parameters -->
1611 <div class='return-value'>
1612 <b>Return Value</b>
1613 <div class='returnvalue'>
1614 <dl>
1615 <dt>
1616 <code>CSSKeyframeRule</code>
1617 </dt>
1618 <dd>
1619 The found rule.<br>
1620 </dd>
1621 </dl>
1622 </div>
1623 </div>
1624 <div>
1625 <b>No Exceptions</b>
1626 </div>
1627 </div><!-- ======================================================================================================= -->
1628 </dd>
1629 </dl><!-- method -->
1630 </dd>
1631 </dl>
1632 </dd>
1633 </dl>
1635 <h2 id="acknowledgments">Acknowledgments</h2>
1637 <p>Thanks especially to the feedback from
1638 Tab Atkins,
1639 Estelle Weyl,
1640 and all the rest of the
1641 <a href="http://lists.w3.org/Archives/Public/www-style/">www-style</a> community.</p>
1643 <h2>References</h2>
1645 <h3 class="no-num">Normative references</h3>
1646 <!--normative-->
1648 <h3 class="no-num">Other references</h3>
1649 <!--informative-->
1653 <h2 class="no-num">Property index</h2>
1654 <!-- properties -->
1658 <h2 class="no-num" id="index">Index</h2>
1659 <!--index-->
1661 </body>
1662 </html>
1663 <!-- Keep this comment at the end of the file
1664 Local variables:
1665 mode: sgml
1666 sgml-default-doctype-name:"html"
1667 sgml-minimize-attributes:t
1668 End:
1669 -->