Tue, 03 Apr 2012 08:58:54 -0700
Update 'Previous Version' links to reflect today's publication as WD.
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>
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 other properties do not have lists of the correct length, their values
363 are repeated to form a list with the same number of entries as
364 <code class="property">'animation-name'</code>.
365 </p>
366 <table class="propdef">
367 <tbody>
368 <tr>
369 <td>
370 <em>Name:</em>
371 </td>
372 <td>
373 <dfn id="animation-name">animation-name</dfn>
374 </td>
375 </tr>
376 <tr>
377 <td>
378 <em>Value:</em>
379 </td>
380 <td>
381 [ none | IDENT ] [, [ none | IDENT ] ]*
382 </td>
383 </tr>
384 <tr>
385 <td>
386 <em>Initial:</em>
387 </td>
388 <td>
389 none
390 </td>
391 </tr>
392 <tr>
393 <td>
394 <em>Applies to:</em>
395 </td>
396 <td>
397 all elements, :before and :after pseudo elements
398 </td>
399 </tr>
400 <tr>
401 <td>
402 <em>Inherited:</em>
403 </td>
404 <td>
405 no
406 </td>
407 </tr>
408 <tr>
409 <td>
410 <em>Percentages:</em>
411 </td>
412 <td>
413 N/A
414 </td>
415 </tr>
416 <tr>
417 <td>
418 <em>Media:</em>
419 </td>
420 <td>
421 visual
422 </td>
423 </tr>
424 <tr>
425 <td>
426 <em>Computed value:</em>
427 </td>
428 <td>
429 Same as specified value.
430 </td>
431 </tr>
432 </tbody>
433 </table>
435 <!--
436 <p>
437 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.
438 </p>
439 <div class="example">
440 <p style="display:none">
441 Example(s):
442 </p>
443 <pre>
444 @keyframes 'border-bloat' {
445 from {
446 border-width: 0;
447 }
448 to {
449 border-width: 10px;
450 }
451 }
453 @keyframes 'border-diet' {
454 from {
455 border-width: 4px;
456 }
457 to {
458 border-width: 2px;
459 }
460 }
462 div {
463 animation-name: 'border-bloat', 'border-diet';
464 animation-duration: 10s, 4s;
465 }
466 </pre>
467 <p>
468 The above example has two animations executing on the same property, <code class="property">'border-width'</code>. The animations are additive. That is, the
469 resulting value for the property will be the addition of the values from the
470 two animations.
471 </p>
472 <p>
473 At time '0s' the element's border will be 4px wide (0px from 'border-bloat' plus 4px from 'border-diet').
474 At time '4s' the element's border will be 6px wide (4px from 'border-bloat' plus 2px from 'border-diet').
475 At time '10s' the element's border will be 10px wide (10px from 'border-bloat' and no addition from
476 'border-diet' as it is no longer executing).
477 </p>
478 </div>
479 -->
482 <!-- ======================================================================================================= -->
483 <h3 id="animation-duration-property"><a id="the-animation-duration-property-">
484 The <code class="property">'animation-duration'</code> Property
485 </a></h3>
486 <p>
487 The <code class="property">'animation-duration'</code> property defines the length of time that an animation takes to complete one cycle.
488 </p>
489 <table class="propdef">
490 <tbody>
491 <tr>
492 <td>
493 <em>Name:</em>
494 </td>
495 <td>
496 <dfn id="animation-duration">animation-duration</dfn>
497 </td>
498 </tr>
499 <tr>
500 <td>
501 <em>Value:</em>
502 </td>
503 <td>
504 <time> [, <time>]*
505 </td>
506 </tr>
507 <tr>
508 <td>
509 <em>Initial:</em>
510 </td>
511 <td>
512 0s
513 </td>
514 </tr>
515 <tr>
516 <td>
517 <em>Applies to:</em>
518 </td>
519 <td>
520 all elements, :before and :after pseudo elements
521 </td>
522 </tr>
523 <tr>
524 <td>
525 <em>Inherited:</em>
526 </td>
527 <td>
528 no
529 </td>
530 </tr>
531 <tr>
532 <td>
533 <em>Percentages:</em>
534 </td>
535 <td>
536 N/A
537 </td>
538 </tr>
539 <tr>
540 <td>
541 <em>Media:</em>
542 </td>
543 <td>
544 visual
545 </td>
546 </tr>
547 <tr>
548 <td>
549 <em>Computed value:</em>
550 </td>
551 <td>
552 Same as specified value.
553 </td>
554 </tr>
555 </tbody>
556 </table>
558 <p>
559 By default the value is '0s', meaning that the animation cycle is
560 immediate. A negative value for <code
561 class="property">'animation-duration'</code> is treated as '0s'. In this
562 case <code class="property">'animation-fill-mode'</code> still applies,
563 so an animation that fills backwards will show the value of the 0%
564 keyframe during any delay period, and an animation that fill forwards
565 will retain the value specified at the 100% keyframe, even if the
566 animation was instantaneous. Also, animation events are still fired.
567 </p>
569 <!-- ======================================================================================================= -->
570 <h3 id="animation-timing-function-property"><a id="animation-timing-function_tag">
571 The <code class="property">'animation-timing-function'</code> Property
572 </a></h3>
573 <p>
574 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.
575 </p>
576 <table class="propdef">
577 <tbody>
578 <tr>
579 <td>
580 <em>Name:</em>
581 </td>
582 <td>
583 <dfn id="animation-timing-function">animation-timing-function</dfn>
584 </td>
585 </tr>
586 <tr>
587 <td>
588 <em>Value:</em>
589 </td>
590 <td>
591 [ 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>)] ]*
592 </td>
593 </tr>
594 <tr>
595 <td>
596 <em>Initial:</em>
597 </td>
598 <td>
599 ease
600 </td>
601 </tr>
602 <tr>
603 <td>
604 <em>Applies to:</em>
605 </td>
606 <td>
607 all elements, :before and :after pseudo elements
608 </td>
609 </tr>
610 <tr>
611 <td>
612 <em>Inherited:</em>
613 </td>
614 <td>
615 no
616 </td>
617 </tr>
618 <tr>
619 <td>
620 <em>Percentages:</em>
621 </td>
622 <td>
623 N/A
624 </td>
625 </tr>
626 <tr>
627 <td>
628 <em>Media:</em>
629 </td>
630 <td>
631 visual
632 </td>
633 </tr>
634 <tr>
635 <td>
636 <em>Computed value:</em>
637 </td>
638 <td>
639 Same as specified value.
640 </td>
641 </tr>
642 </tbody>
643 </table>
645 <p>
646 For a keyframed animation, the <code class="property">'animation-timing-function'</code> applies
647 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.
648 </p>
650 <!-- ======================================================================================================= -->
651 <h3 id="animation-iteration-count-property"><a id="the-animation-iteration-count-property-">
652 The <code class="property">'animation-iteration-count'</code> Property
653 </a></h3>
654 <p>
655 The <code class="property">'animation-iteration-count'</code> property defines the number of times
656 an animation cycle is played. The default value is one, meaning the animation will play from
657 beginning to end once. A value of <code class="css">'infinite'</code> will cause the animation to
658 repeat forever. Non-integer numbers will cause the animation to end part-way through a cycle.
659 Negative values of <code class="property">'animation-iteration-count'</code> are invalid.
660 This property is often used with an <code class="property">'animation-direction'</code> value of
661 <code class="css">alternate</code>, which will cause the animation to play in reverse on alternate cycles.
662 </p>
663 <table class="propdef">
664 <tbody>
665 <tr>
666 <td>
667 <em>Name:</em>
668 </td>
669 <td>
670 <dfn id="animation-iteration-count">animation-iteration-count</dfn>
671 </td>
672 </tr>
673 <tr>
674 <td>
675 <em>Value:</em>
676 </td>
677 <td>
678 [ infinite | <number> ] [, [ infinite | <number> ] ]*
679 </td>
680 </tr>
681 <tr>
682 <td>
683 <em>Initial:</em>
684 </td>
685 <td>
686 1
687 </td>
688 </tr>
689 <tr>
690 <td>
691 <em>Applies to:</em>
692 </td>
693 <td>
694 all elements, :before and :after pseudo elements
695 </td>
696 </tr>
697 <tr>
698 <td>
699 <em>Inherited:</em>
700 </td>
701 <td>
702 no
703 </td>
704 </tr>
705 <tr>
706 <td>
707 <em>Percentages:</em>
708 </td>
709 <td>
710 N/A
711 </td>
712 </tr>
713 <tr>
714 <td>
715 <em>Media:</em>
716 </td>
717 <td>
718 visual
719 </td>
720 </tr>
721 <tr>
722 <td>
723 <em>Computed value:</em>
724 </td>
725 <td>
726 Same as specified value.
727 </td>
728 </tr>
729 </tbody>
730 </table><!-- ======================================================================================================= -->
731 <h3 id="animation-direction-property"><a id="the-animation-direction-property-">
732 The <code class="property">'animation-direction'</code> Property
733 </a></h3>
734 <p>
735 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.
736 </p>
737 <table class="propdef">
738 <tbody>
739 <tr>
740 <td>
741 <em>Name:</em>
742 </td>
743 <td>
744 <dfn id="animation-direction">animation-direction</dfn>
745 </td>
746 </tr>
747 <tr>
748 <td>
749 <em>Value:</em>
750 </td>
751 <td>
752 [ normal | reverse | alternate | alternate-reverse ] [, [ normal | reverse | alternate | alternate-reverse ] ]*
753 </td>
754 </tr>
755 <tr>
756 <td>
757 <em>Initial:</em>
758 </td>
759 <td>
760 normal
761 </td>
762 </tr>
763 <tr>
764 <td>
765 <em>Applies to:</em>
766 </td>
767 <td>
768 all elements, :before and :after pseudo elements
769 </td>
770 </tr>
771 <tr>
772 <td>
773 <em>Inherited:</em>
774 </td>
775 <td>
776 no
777 </td>
778 </tr>
779 <tr>
780 <td>
781 <em>Percentages:</em>
782 </td>
783 <td>
784 N/A
785 </td>
786 </tr>
787 <tr>
788 <td>
789 <em>Media:</em>
790 </td>
791 <td>
792 visual
793 </td>
794 </tr>
795 <tr>
796 <td>
797 <em>Computed value:</em>
798 </td>
799 <td>
800 Same as specified value.
801 </td>
802 </tr>
803 </tbody>
804 </table>
805 <dl>
806 <dt>normal</dt>
807 <dd>All iterations of the animation are played as specified.</dd>
808 <dt>reverse</dt>
809 <dd>All iterations of the animation are played in the reverse direction from the way they were specified.</dd>
810 <dt>alternate</dt>
811 <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>
812 <dt>alternate-reverse</dt>
813 <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>
814 </dl>
815 <!-- ======================================================================================================= -->
816 <h3 id="animation-play-state-property"><span id="the-animation-play-state-property-">
817 The <code class="property">'animation-play-state'</code> Property
818 </a></h3>
820 <p>
821 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.
822 </p>
823 <table class="propdef">
824 <tbody>
825 <tr>
826 <td>
827 <em>Name:</em>
828 </td>
829 <td>
830 <dfn id="animation-play-state">animation-play-state</dfn>
831 </td>
832 </tr>
833 <tr>
834 <td>
835 <em>Value:</em>
836 </td>
837 <td>
838 [ running | paused ] [, [ running | paused ] ]*
839 </td>
840 </tr>
841 <tr>
842 <td>
843 <em>Initial:</em>
844 </td>
845 <td>
846 running
847 </td>
848 </tr>
849 <tr>
850 <td>
851 <em>Applies to:</em>
852 </td>
853 <td>
854 all elements, :before and :after pseudo elements
855 </td>
856 </tr>
857 <tr>
858 <td>
859 <em>Inherited:</em>
860 </td>
861 <td>
862 no
863 </td>
864 </tr>
865 <tr>
866 <td>
867 <em>Percentages:</em>
868 </td>
869 <td>
870 N/A
871 </td>
872 </tr>
873 <tr>
874 <td>
875 <em>Media:</em>
876 </td>
877 <td>
878 visual
879 </td>
880 </tr>
881 <tr>
882 <td>
883 <em>Computed value:</em>
884 </td>
885 <td>
886 Same as specified value.
887 </td>
888 </tr>
889 </tbody>
890 </table><!-- ======================================================================================================= -->
891 <h3 id="animation-delay-property"><a id="the-animation-delay-property-">
892 The <code class="property">'animation-delay'</code> Property
893 </a></h3>
894 <p>
895 The <code class="property">'animation-delay'</code> property defines
896 when the animation will start. It allows an animation to begin
897 execution some time after it is applied. An <code
898 class="property">'animation-delay'</code> value of '0s' means the
899 animation will execute as soon as it is applied. Otherwise, the value
900 specifies an offset from the moment the animation is applied, and the
901 animation will delay execution by that offset.
902 </p>
903 <p>
904 If the value for <code class="property">'animation-delay'</code> is a
905 negative time offset then the animation will execute the moment it is
906 applied, but will appear to have begun execution at the specified
907 offset. That is, the animation will appear to begin part-way through
908 its play cycle. In the case where an animation has implied starting
909 values and a negative <code class="property">'animation-delay'</code>,
910 the starting values are taken from the moment the animation is applied.
911 </p>
912 <table class="propdef">
913 <tbody>
914 <tr>
915 <td>
916 <em>Name:</em>
917 </td>
918 <td>
919 <dfn id="animation-delay">animation-delay</dfn>
920 </td>
921 </tr>
922 <tr>
923 <td>
924 <em>Value:</em>
925 </td>
926 <td>
927 <time> [, <time>]*
928 </td>
929 </tr>
930 <tr>
931 <td>
932 <em>Initial:</em>
933 </td>
934 <td>
935 0s
936 </td>
937 </tr>
938 <tr>
939 <td>
940 <em>Applies to:</em>
941 </td>
942 <td>
943 all elements, :before and :after pseudo elements
944 </td>
945 </tr>
946 <tr>
947 <td>
948 <em>Inherited:</em>
949 </td>
950 <td>
951 no
952 </td>
953 </tr>
954 <tr>
955 <td>
956 <em>Percentages:</em>
957 </td>
958 <td>
959 N/A
960 </td>
961 </tr>
962 <tr>
963 <td>
964 <em>Media:</em>
965 </td>
966 <td>
967 visual
968 </td>
969 </tr>
970 <tr>
971 <td>
972 <em>Computed value:</em>
973 </td>
974 <td>
975 Same as specified value.
976 </td>
977 </tr>
978 </tbody>
979 </table><!-- ======================================================================================================= -->
980 <h3 id="animation-fill-mode-property"><a id="the-animation-fill-mode-property-">
981 The <code class="property">'animation-fill-mode'</code> Property
982 </a></h3>
983 <p>
984 The <code class="property">'animation-fill-mode'</code> property defines
985 what values are applied by the animation outside the time it is executing.
986 By default, an animation will not affect property values between the
987 time it is applied (the <code class="property">'animation-name'</code> property is
988 set on an element) and the time it begins execution (which is determined by
989 the <code class="property">'animation-delay'</code> property). Also, by
990 default an animation does not affect property values after the animation
991 ends (determined by the <code class="property">'animation-duration'</code> property).
992 The value of <code class="property">'animation-fill-mode'</code> can
993 override this behavior.
994 </p>
995 <p>
996 If the value for <code class="property">'animation-fill-mode'</code> is
997 <code class="css">'backwards'</code>, then the animation will
998 apply the property values defined in its 0% or 'from' keyframe as soon
999 as the animation is applied, during the period defined by
1000 <code class="property">'animation-delay'</code>.
1001 </p>
1002 <p>
1003 If the value for <code class="property">'animation-fill-mode'</code>
1004 is <code class="css">'forwards'</code>, then the animation will
1005 apply the property values defined in its last executing keyframe after
1006 the final iteration of the animation, until the animation style is
1007 removed. The last executing keyframe is the 'to' or '100%' keyframe,
1008 unless the animation has <code
1009 class="property">'animation-direction'</code> set to <code
1010 class="css">'alternate'</code> and both a finite and even
1011 iteration count, in which case it is the 'from' or '0%' keyframe.
1012 </p>
1013 <p>
1014 If the value for <code class="property">'animation-fill-mode'</code>
1015 is <code class="css">'both'</code>, then the animation will
1016 follow the rules for both 'forwards' and 'backwards'. That is, it will
1017 extend the animation properties in both directions.
1018 </p>
1019 <table class="propdef">
1020 <tbody>
1021 <tr>
1022 <td>
1023 <em>Name:</em>
1024 </td>
1025 <td>
1026 <dfn id="animation-fill-mode">animation-fill-mode</dfn>
1027 </td>
1028 </tr>
1029 <tr>
1030 <td>
1031 <em>Value:</em>
1032 </td>
1033 <td>
1034 [ none | forwards | backwards | both ] [, [ none | forwards | backwards | both ] ]*
1035 </td>
1036 </tr>
1037 <tr>
1038 <td>
1039 <em>Initial:</em>
1040 </td>
1041 <td>
1042 none
1043 </td>
1044 </tr>
1045 <tr>
1046 <td>
1047 <em>Applies to:</em>
1048 </td>
1049 <td>
1050 all elements, :before and :after pseudo elements
1051 </td>
1052 </tr>
1053 <tr>
1054 <td>
1055 <em>Inherited:</em>
1056 </td>
1057 <td>
1058 no
1059 </td>
1060 </tr>
1061 <tr>
1062 <td>
1063 <em>Percentages:</em>
1064 </td>
1065 <td>
1066 N/A
1067 </td>
1068 </tr>
1069 <tr>
1070 <td>
1071 <em>Media:</em>
1072 </td>
1073 <td>
1074 visual
1075 </td>
1076 </tr>
1077 <tr>
1078 <td>
1079 <em>Computed value:</em>
1080 </td>
1081 <td>
1082 Same as specified value.
1083 </td>
1084 </tr>
1085 </tbody>
1086 </table><!-- ======================================================================================================= -->
1087 <h3 id="animation-shorthand-property"><a id="the-animation-shorthand-property-">
1088 The <code class="property">'animation'</code> Shorthand Property
1089 </a></h3>
1090 <p>
1091 The <code class="property">'animation'</code> shorthand property
1092 combines seven of the animation properties into a single property.
1093 </p>
1094 <p>
1095 Note that order is important in this property. The first value that can be
1096 parsed as a time is assigned to the animation-duration. The second value that
1097 can be parsed as a time is assigned to animation-delay.
1098 </p>
1099 <p class="issue">
1100 An alternative proposal is to accept the font shorthand approach of
1101 using a "/" character between the values of the same type. e.g. 2s/4s would
1102 mean a duration of 2 seconds and a delay of 4 seconds.
1103 </p>
1104 <table class="propdef">
1105 <tbody>
1106 <tr>
1107 <td>
1108 <em>Name:</em>
1109 </td>
1110 <td>
1111 <dfn id="animation">animation</dfn>
1112 </td>
1113 </tr>
1114 <tr>
1115 <td>
1116 <em>Value:</em>
1117 </td>
1118 <td>
1119 [<animation-name> ||
1120 <animation-duration> ||
1121 <animation-timing-function> ||
1122 <animation-delay> ||
1123 <animation-iteration-count> ||
1124 <animation-direction> ||
1125 <animation-fill-mode>]
1126 [, [<animation-name> ||
1127 <animation-duration> ||
1128 <animation-timing-function> ||
1129 <animation-delay> ||
1130 <animation-iteration-count> ||
1131 <animation-direction> ||
1132 <animation-fill-mode>] ]*
1133 </td>
1134 </tr>
1135 <tr>
1136 <td>
1137 <em>Initial:</em>
1138 </td>
1139 <td>
1140 see individual properties
1141 </td>
1142 </tr>
1143 <tr>
1144 <td>
1145 <em>Applies to:</em>
1146 </td>
1147 <td>
1148 all elements, :before and :after pseudo elements
1149 </td>
1150 </tr>
1151 <tr>
1152 <td>
1153 <em>Inherited:</em>
1154 </td>
1155 <td>
1156 no
1157 </td>
1158 </tr>
1159 <tr>
1160 <td>
1161 <em>Percentages:</em>
1162 </td>
1163 <td>
1164 N/A
1165 </td>
1166 </tr>
1167 <tr>
1168 <td>
1169 <em>Media:</em>
1170 </td>
1171 <td>
1172 visual
1173 </td>
1174 </tr>
1175 <tr>
1176 <td>
1177 <em>Computed value:</em>
1178 </td>
1179 <td>
1180 Same as specified value.
1181 </td>
1182 </tr>
1183 </tbody>
1184 </table><!-- ======================================================================================================= -->
1185 <h2 id="animation-events"><a id="animation-events-">
1186 Animation Events
1187 </a></h2>
1188 <p>
1189 Several animation related events are available through the <a
1190 href="http://www.w3.org/TR/DOM-Level-2-Events/events.html">DOM Event
1191 system</a>. The start and end of an animation, and the end of each
1192 iteration of an animation all generate DOM events. An element can have
1193 multiple properties being animated simultaneously. This can occur either
1194 with a single <code class="property">animation-name</code> value with
1195 keyframes containing multiple properties, or with multiple <code
1196 class="property">animation-name</code> values. For the purposes of
1197 events, each <code class="property">animation-name</code> specifies a
1198 single animation. Therefore an event will be generated for each <code
1199 class="property">animation-name</code> value and not necessarily for
1200 each property being animated.
1201 </p>
1202 <p>
1203 The time the animation has been running is sent with each event
1204 generated. This allows the event handler to determine the current
1205 iteration of a looping animation or the current position of an
1206 alternating animation. This time does not include any time the animation
1207 was in the <code>paused</code> play state.
1208 </p>
1209 <dl>
1210 <dt>
1211 <b>Interface <i><a id="Events-AnimationEvent" name='Events-AnimationEvent'>AnimationEvent</a></i></b>
1212 </dt>
1213 <dd>
1214 <p>
1215 The <code>AnimationEvent</code> interface provides specific contextual information associated with Animation events.
1216 </p>
1217 <dl>
1218 <dt>
1219 <br>
1220 <b>IDL Definition</b>
1221 </dt>
1222 <dd>
1223 <div class='idl-code'>
1224 <pre>
1225 interface AnimationEvent : Event {
1226 readonly attribute DOMString animationName;
1227 readonly attribute float elapsedTime;
1228 void initAnimationEvent(in DOMString typeArg,
1229 in boolean canBubbleArg,
1230 in boolean cancelableArg,
1231 in DOMString animationNameArg,
1232 in float elapsedTimeArg);
1233 };
1234 </pre>
1235 </div>
1236 </dd>
1237 <dt>
1238 <b>Attributes</b>
1239 </dt>
1240 <dd>
1241 <dl>
1242 <dt>
1243 <code class='attribute-name'><a id="Events-AnimationEvent-animationName" name='Events-AnimationEvent-animationName'>animationName</a></code> of type <code>DOMString</code>, readonly
1244 </dt>
1245 <dd>
1246 The value of the <code class="property">animation-name</code> property of the
1247 animation that fired the event.
1248 </dd>
1249 </dl>
1250 <dl>
1251 <dt>
1252 <code class='attribute-name'><a id="Events-AnimationEvent-elapsedTime" name='Events-AnimationEvent-elapsedTime'>elapsedTime</a></code> of type <code>float</code>, readonly
1253 </dt>
1254 <dd>
1255 The amount of time the animation has been running, in
1256 seconds, when this event fired, excluding any time the
1257 animation was paused. For an "animationstart" event, the
1258 elapsedTime is zero unless there was a negative value for
1259 <code class="property">animation-delay</code>, in which
1260 case the event will be fired with an elapsedTime of (-1 *
1261 delay).
1262 </dd>
1263 </dl>
1264 </dd>
1265 <dt>
1266 <b>Methods</b>
1267 </dt>
1268 <dd>
1269 <dl>
1270 <dt>
1271 <code class='method-name'><a id="Events-AnimationEvent-initAnimationEvent" name='Events-AnimtionEvent-initAnimationEvent'>initAnimationEvent</a></code>
1272 </dt>
1273 <dd>
1274 <div class='method'>
1275 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.
1276 <div class='parameters'>
1277 <b>Parameters</b>
1278 <div class='paramtable'>
1279 <dl>
1280 <dt>
1281 <code class='parameter-name'>typeArg</code> of type <code>DOMString</code>
1282 </dt>
1283 <dd>
1284 Specifies the event type.<br>
1285 </dd>
1286 <dt>
1287 <code class='parameter-name'>canBubbleArg</code> of type <code>boolean</code>
1288 </dt>
1289 <dd>
1290 Specifies whether or not the event can bubble.<br>
1291 </dd>
1292 <dt>
1293 <code class='parameter-name'>cancelableArg</code> of type <code>boolean</code>
1294 </dt>
1295 <dd>
1296 Specifies whether or not the event's default action can be prevented.
1297 </dd>
1298 <dt>
1299 <code class='parameter-name'>animationNameArg</code> of type <code>DOMString</code>
1300 </dt>
1301 <dd>
1302 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>
1303 </dd>
1304 <dt>
1305 <code class='parameter-name'>elapsedTimeArg</code> of type <code>float</code>
1306 </dt>
1307 <dd>
1308 Specifies the amount of time, in seconds, the animation has been running at the time of initialization.
1309 </dd>
1310 </dl>
1311 </div>
1312 </div><!-- parameters -->
1313 <div>
1314 <b>No Return Value</b>
1315 </div>
1316 <div>
1317 <b>No Exceptions</b>
1318 </div>
1319 </div><!-- method -->
1320 </dd>
1321 </dl>
1322 </dd>
1323 </dl>
1324 </dd>
1325 </dl>
1326 <p>
1327 The different types of Animation events that can occur are:
1328 </p>
1329 <dl>
1330 <dt>
1331 <b>animationstart</b>
1332 </dt>
1333 <dd>
1334 The 'animationstart' event occurs at the start of the animation. If there is an
1335 <code class="property">animation-delay</code> then this event will fire once the delay period
1336 has expired. A negative delay will cause the event to fire with an elapsedTime equal to
1337 the absolute value of the delay.
1338 <ul>
1339 <li>Bubbles: Yes
1340 </li>
1341 <li>Cancelable: No
1342 </li>
1343 <li>Context Info: animationName
1344 </li>
1345 </ul>
1346 </dd>
1347 <dt>
1348 <b>animationend</b>
1349 </dt>
1350 <dd>
1351 The 'animationend' event occurs when the animation finishes.
1352 <ul>
1353 <li>Bubbles: Yes
1354 </li>
1355 <li>Cancelable: No
1356 </li>
1357 <li>Context Info: animationName, elapsedTime
1358 </li>
1359 </ul>
1360 </dd>
1361 <dt>
1362 <b>animationiteration</b>
1363 </dt>
1364 <dd>
1365 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.
1366 <ul>
1367 <li>Bubbles: Yes
1368 </li>
1369 <li>Cancelable: No
1370 </li>
1371 <li>Context Info: animationName, elapsedTime
1372 </li>
1373 </ul>
1374 </dd>
1375 </dl>
1376 <!-- ======================================================================================================= -->
1377 <h2 id="dom-interfaces"><a id="dom-interfaces-">
1378 DOM Interfaces
1379 </a></h2>
1380 <p>
1381 CSS animation is exposed to the CSSOM through a pair of new interfaces
1382 describing the keyframes.
1383 </p>
1384 <dl>
1385 <dt>
1386 <b>Interface <i><a id="DOM-CSSRule" name='DOM-CSSRule'>CSSRule</a></i></b>
1387 </dt>
1388 <dd>
1389 <p>
1390 The following 2 rule types are added to the <code>CSSRule</code> interface. They provide identification for the new keyframe and keyframes rules.
1391 </p>
1392 <dl>
1394 <dt>
1395 <b>IDL Definition</b>
1396 </dt>
1397 <dd>
1398 <div class='idl-code'>
1399 <pre>
1400 interface CSSRule {
1401 ...
1402 const unsigned short KEYFRAMES_RULE = 7;
1403 const unsigned short KEYFRAME_RULE = 8;
1404 ...
1405 };</pre>
1406 </div>
1407 </dd> <!-- IDL -->
1408 </dl>
1409 </dd>
1411 <dt>
1412 <b>Interface <i><a id="DOM-CSSKeyframeRule" name='DOM-CSSKeyframeRule'>CSSKeyframeRule</a></i></b>
1413 </dt>
1414 <dd>
1415 <p>
1416 The <code>CSSKeyframeRule</code> interface represents the style rule for a single key.
1417 </p>
1418 <dl>
1419 <dt>
1420 <br>
1421 <b>IDL Definition</b>
1422 </dt>
1423 <dd>
1424 <div class='idl-code'>
1425 <pre>
1426 interface CSSKeyframeRule : CSSRule {
1427 attribute DOMString keyText;
1428 readonly attribute CSSStyleDeclaration style;
1429 };
1430 </pre>
1431 </div><br>
1432 </dd>
1433 <dt>
1434 <b>Attributes</b>
1435 </dt>
1436 <dd>
1437 <dl>
1438 <dt>
1439 <code class='attribute-name'><a id="DOM-CSSKeyframeRule-keyText" name='DOM-CSSKeyframeRule-keyText'>keyText</a></code> of type <code>DOMString</code>
1440 </dt>
1441 <dd>
1442 This attribute represents the key as the string representation of a floating point number between 0 and 1. If the value
1443 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
1444 value will be 1.<br>
1445 </dd>
1446 </dl>
1447 </dd>
1448 <dd>
1449 <dl>
1450 <dt>
1451 <code class='attribute-name'><a id="DOM-CSSKeyframeRule-style" name='DOM-CSSKeyframeRule-style'>style</a></code> of type <code>CSSStyleDeclaration</code>
1452 </dt>
1453 <dd>
1454 This attribute represents the style associated with this keyframe.<br>
1455 </dd>
1456 </dl>
1457 </dd>
1458 <dt>
1459 <b>No Methods</b>
1460 </dt>
1461 </dl>
1462 </dd>
1463 </dl>
1464 <dl>
1465 <dt>
1466 <b>Interface <i><a id="DOM-CSSKeyframesRule" name='DOM-CSSKeyframesRule'>CSSKeyframesRule</a></i></b>
1467 </dt>
1468 <dd>
1469 <p>
1470 The <code>CSSKeyframesRule</code> interface represents a complete set of keyframes for a single animation.
1471 </p>
1472 <dl>
1473 <dt>
1474 <br>
1475 <b>IDL Definition</b>
1476 </dt>
1477 <dd>
1478 <div class='idl-code'>
1479 <pre>
1480 interface CSSKeyframesRule : CSSRule {
1481 attribute DOMString name;
1482 readonly attribute CSSRuleList cssRules;
1484 void appendRule(in DOMString rule);
1485 void deleteRule(in DOMString key);
1486 CSSKeyframeRule findRule(in DOMString key);
1487 };
1488 </pre>
1489 </div><br>
1490 </dd>
1491 <dt>
1492 <b>Attributes</b>
1493 </dt>
1494 <dd>
1495 <dl>
1496 <dt>
1497 <code class='attribute-name'><a id="DOM-CSSKeyframesRule-name" name='DOM-CSSKeyframesRule-name'>name</a></code> of type <code>DOMString</code>
1498 </dt>
1499 <dd>
1500 This attribute is the name of the keyframes, used by the <code>animation-name</code> property.<br>
1501 </dd>
1502 </dl>
1503 </dd>
1504 <dd>
1505 <dl>
1506 <dt>
1507 <code class='attribute-name'><a id="DOM-CSSKeyframeRules-cssRules" name='DOM-CSSKeyframeRules-cssRules'>cssRules</a></code> of type <code>CSSRuleList</code>
1508 </dt>
1509 <dd>
1510 This attribute gives access to the keyframes in the list.<br>
1511 </dd>
1512 </dl>
1513 </dd>
1514 <dt>
1515 <b>Methods</b>
1516 </dt>
1517 <dd>
1518 <dl>
1519 <!-- ======================================================================================================= -->
1520 <dt>
1521 <code class='method-name'><a id="DOM-CSSKeyframesRule-appendRule" name='DOM-CSSKeyframesRule-appendRule'>appendRule</a></code>
1522 </dt>
1523 <dd>
1524 <div class='method'>
1525 The <code>appendRule</code> method appends the passed CSSKeyframeRule into the list at the passed key.
1526 <div class='parameters'>
1527 <b>Parameters</b>
1528 <div class='paramtable'>
1529 <dl>
1530 <dt>
1531 <code class='parameter-name'>rule</code> of type <code>DOMString</code>
1532 </dt>
1533 <dd>
1534 The rule to be appended, expressed in the same syntax as one entry in the
1535 <code>@keyframes</code> rule.
1536 </dd>
1537 </dl>
1538 </div>
1539 </div><!-- parameters -->
1540 <div class='return-value'>
1541 <b>No Return Value</b>
1542 </div>
1543 <div>
1544 <b>No Exceptions</b>
1545 </div>
1546 </div><!-- ======================================================================================================= -->
1547 </dd>
1548 <dt>
1549 <code class='method-name'><a id="DOM-CSSKeyframesRule-deleteRule" name='DOM-CSSKeyframesRule-deleteRule'>deleteRule</a></code>
1550 </dt>
1551 <dd>
1552 <div class='method'>
1553 The <code>deleteRule</code> method deletes the CSSKeyframeRule with the passed key. If a rule with this key
1554 does not exist, the method does nothing.
1555 <div class='parameters'>
1556 <b>Parameters</b>
1557 <div class='paramtable'>
1558 <dl>
1559 <dt>
1560 <code class='parameter-name'>key</code> of type <code>DOMString</code>
1561 </dt>
1562 <dd>
1563 The key which describes the rule to be deleted. The key must
1564 resolve to a number between 0 and 1, or the rule is ignored.<br>
1565 </dd>
1566 </dl>
1567 </div>
1568 </div><!-- parameters -->
1569 <div class='return-value'>
1570 <b>No Return Value</b>
1571 </div>
1572 <div>
1573 <b>No Exceptions</b>
1574 </div>
1575 </div><!-- ======================================================================================================= -->
1576 </dd>
1577 <dt>
1578 <code class='method-name'><a id="DOM-CSSKeyframesRule-findRule" name='DOM-CSSKeyframesRule-findRule'>findRule</a></code>
1579 </dt>
1580 <dd>
1581 <div class='method'>
1582 The <code>findRule</code> method returns the rule with a key matching the passed key. If no such rule
1583 exists, a null value is returned.
1584 <div class='parameters'>
1585 <b>Parameters</b>
1586 <div class='paramtable'>
1587 <dl>
1588 <dt>
1589 <code class='parameter-name'>key</code> of type <code>DOMString</code>
1590 </dt>
1591 <dd>
1592 The key which described the rule to find. The key must
1593 resolve to a number between 0 and 1, or the rule is ignored.<br>
1594 </dd>
1595 </dl>
1596 </div>
1597 </div><!-- parameters -->
1598 <div class='return-value'>
1599 <b>Return Value</b>
1600 <div class='returnvalue'>
1601 <dl>
1602 <dt>
1603 <code>CSSKeyframeRule</code>
1604 </dt>
1605 <dd>
1606 The found rule.<br>
1607 </dd>
1608 </dl>
1609 </div>
1610 </div>
1611 <div>
1612 <b>No Exceptions</b>
1613 </div>
1614 </div><!-- ======================================================================================================= -->
1615 </dd>
1616 </dl><!-- method -->
1617 </dd>
1618 </dl>
1619 </dd>
1620 </dl>
1622 <h2 id="acknowledgments">Acknowledgments</h2>
1624 <p>Thanks especially to the feedback from
1625 Tab Atkins,
1626 Estelle Weyl,
1627 and all the rest of the
1628 <a href="http://lists.w3.org/Archives/Public/www-style/">www-style</a> community.</p>
1630 <h2>References</h2>
1632 <h3 class="no-num">Normative references</h3>
1633 <!--normative-->
1635 <h3 class="no-num">Other references</h3>
1636 <!--informative-->
1640 <h2 class="no-num">Property index</h2>
1641 <!-- properties -->
1645 <h2 class="no-num" id="index">Index</h2>
1646 <!--index-->
1648 </body>
1649 </html>
1650 <!-- Keep this comment at the end of the file
1651 Local variables:
1652 mode: sgml
1653 sgml-default-doctype-name:"html"
1654 sgml-minimize-attributes:t
1655 End:
1656 -->