Wed, 28 Mar 2012 22:04:08 -0700
Fix two errors in the grammar of the steps() function: first, add necessary [] so that the comma applies to both the start and end values; second, add the ? that was intended to indicate the second parameter being optional.
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 <link href="../default.css" rel=stylesheet type="text/css">
8 <link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
9 type="text/css">
11 <body>
12 <div class=head> <!--begin-logo-->
13 <p><a href="http://www.w3.org/"><img alt=W3C height=48
14 src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
16 <h1>CSS Animations</h1>
18 <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 29 March 2012</h2>
20 <dl>
21 <dt>This version:
23 <dd><a
24 href="http://www.w3.org/TR/2012/ED-css3-animations-20120329/">http://dev.w3.org/csswg/css3-animations/</a>
25 <!--http://www.w3.org/TR/2012/WD-css3-animations-20120329-->
27 <dt>Latest version:
29 <dd><a
30 href="http://www.w3.org/TR/css3-animations">http://www.w3.org/TR/css3-animations/</a>
33 <dt>Editor's draft:
35 <dd><a
36 href="http://dev.w3.org/csswg/css3-animations/">http://dev.w3.org/csswg/css3-animations/</a>
39 <dt>Previous version:
41 <dd><a href="http://www.w3.org/TR/2009/WD-css3-animations-20090320/">
42 http://www.w3.org/TR/2009/WD-css3-animations-20090320/</a>
44 <dt id=editors-list>Editors:
46 <dd><a href="mailto:dino@apple.com">Dean Jackson</a> (<a
47 href="http://www.apple.com/">Apple Inc</a>)
49 <dd><a href="mailto:hyatt@apple.com">David Hyatt</a> (<a
50 href="http://www.apple.com/">Apple Inc</a>)
52 <dd><a href="mailto:cmarrin@apple.com">Chris Marrin</a> (<a
53 href="http://www.apple.com/">Apple Inc</a>)
55 <dd><a href="mailto:sylvaing@microsoft.com">Sylvain Galineau</a> (<a
56 class=org href="http://www.microsoft.com/">Microsoft</a>)
58 <dd class=vcard><a class=fn href="http://dbaron.org/">L. David Baron</a>
59 (<a class=org href="http://www.mozilla.org/">Mozilla</a>)
61 <dt>Issues list:
63 <dd><a
64 href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&product=CSS&component=Animations&resolution=---&cmdtype=doit">in
65 Bugzilla</a>
67 <dt>Discussion:
69 <dd><a
70 href="http://lists.w3.org/Archives/Public/www-style/">www-style@w3.org</a>
71 with subject line “<kbd>[css3-animations] <var>… message
72 topic …</var></kbd>”
74 <dt>Test suite:
76 <dd>none yet
77 </dl>
78 <!--begin-copyright-->
79 <p class=copyright><a
80 href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
81 rel=license>Copyright</a> © 2012 <a href="http://www.w3.org/"><abbr
82 title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
83 href="http://www.csail.mit.edu/"><abbr
84 title="Massachusetts Institute of Technology">MIT</abbr></a>, <a
85 href="http://www.ercim.eu/"><abbr
86 title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
87 <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a
88 href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
89 <a
90 href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
91 and <a
92 href="http://www.w3.org/Consortium/Legal/copyright-documents">document
93 use</a> rules apply.</p>
94 <!--end-copyright-->
95 <hr title="Separator for header">
96 </div>
98 <h2 class="no-num no-toc" id=abstract>Abstract</h2>
100 <p>This CSS module describes a way for authors to animate the values of CSS
101 properties over time, using keyframes. The behavior of these keyframe
102 animations can be controlled by specifying their duration, number of
103 repeats, and repeating behavior.
105 <h2 class="no-num no-toc" id=status>Status of this document</h2>
106 <!--begin-status-->
108 <p>This is a public copy of the editors' draft. It is provided for
109 discussion only and may change at any moment. Its publication here does
110 not imply endorsement of its contents by W3C. Don't cite this document
111 other than as work in progress.
113 <p>The (<a
114 href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
115 mailing list <a
116 href="mailto:www-style@w3.org?Subject=%5Bcss3-animations%5D%20PUT%20SUBJECT%20HERE">
117 www-style@w3.org</a> (see <a
118 href="http://www.w3.org/Mail/Request">instructions</a>) is preferred for
119 discussion of this specification. When sending e-mail, please put the text
120 “css3-animations” in the subject, preferably like this:
121 “[<!---->css3-animations<!---->] <em>…summary of
122 comment…</em>”
124 <p>This document was produced by the <a href="/Style/CSS/members">CSS
125 Working Group</a> (part of the <a href="/Style/">Style Activity</a>).
127 <p>This document was produced by a group operating under the <a
128 href="/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent
129 Policy</a>. W3C maintains a <a href="/2004/01/pp-impl/32061/status"
130 rel=disclosure>public list of any patent disclosures</a> made in
131 connection with the deliverables of the group; that page also includes
132 instructions for disclosing a patent. An individual who has actual
133 knowledge of a patent which the individual believes contains <a
134 href="/Consortium/Patent-Policy-20040205/#def-essential">Essential
135 Claim(s)</a> must disclose the information in accordance with <a
136 href="/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the
137 W3C Patent Policy</a>.</p>
138 <!--end-status-->
140 <h2 class="no-num no-toc" id=contents>Table of contents</h2>
141 <!--begin-toc-->
143 <ul class=toc>
144 <li><a href="#introduction"><span class=secno>1. </span>Introduction</a>
146 <li><a href="#animations"><span class=secno>2. </span>Animations</a>
148 <li><a href="#keyframes"><span class=secno>3. </span>Keyframes</a>
149 <ul class=toc>
150 <li><a href="#timing-functions-for-keyframes-"><span class=secno>3.1.
151 </span> Timing functions for keyframes </a>
153 <li><a href="#the-animation-name-property-"><span class=secno>3.2.
154 </span> The <code class=property>'animation-name'</code> Property </a>
156 <li><a href="#the-animation-duration-property-"><span class=secno>3.3.
157 </span> The <code class=property>'animation-duration'</code> Property
158 </a>
160 <li><a href="#animation-timing-function_tag"><span class=secno>3.4.
161 </span> The <code class=property>'animation-timing-function'</code>
162 Property </a>
164 <li><a href="#the-animation-iteration-count-property-"><span
165 class=secno>3.5. </span> The <code
166 class=property>'animation-iteration-count'</code> Property </a>
168 <li><a href="#the-animation-direction-property-"><span class=secno>3.6.
169 </span> The <code class=property>'animation-direction'</code> Property
170 </a>
172 <li><a href="#the-animation-play-state-property-"><span class=secno>3.7.
173 </span> The <code class=property>'animation-play-state'</code> Property
174 </a>
176 <li><a href="#the-animation-delay-property-"><span class=secno>3.8.
177 </span> The <code class=property>'animation-delay'</code> Property </a>
180 <li><a href="#the-animation-fill-mode-property-"><span class=secno>3.9.
181 </span> The <code class=property>'animation-fill-mode'</code> Property
182 </a>
184 <li><a href="#the-animation-shorthand-property-"><span class=secno>3.10.
185 </span> The <code class=property>'animation'</code> Shorthand Property
186 </a>
187 </ul>
189 <li><a href="#animation-events-"><span class=secno>4. </span> Animation
190 Events </a>
192 <li><a href="#dom-interfaces-"><span class=secno>5. </span> DOM Interfaces
193 </a>
195 <li><a href="#references"><span class=secno>6. </span>References</a>
196 <ul class=toc>
197 <li class=no-num><a href="#normative-references">Normative
198 references</a>
200 <li class=no-num><a href="#other-references">Other references</a>
201 </ul>
203 <li class=no-num><a href="#property-index">Property index</a>
205 <li class=no-num><a href="#index">Index</a>
206 </ul>
207 <!--end-toc-->
209 <h2 id=introduction><span class=secno>1. </span>Introduction</h2>
211 <p><em>This section is not normative.</em>
213 <p> CSS Transitions <a href="#CSS3-TRANSITIONS"
214 rel=biblioentry>[CSS3-TRANSITIONS]<!--{{!CSS3-TRANSITIONS}}--></a> provide
215 a way to interpolate CSS property values when they change as a result of
216 underlying property changes. This provides an easy way to do simple
217 animation, but the start and end states of the animation are controlled by
218 the existing property values, and transitions provide little control to
219 the author on how the animation progresses.
221 <p> This proposal introduces <em>defined animations</em>, in which the
222 author can specify the changes in CSS properties over time as a set of
223 keyframes. Animations are similar to transitions in that they change the
224 presentational value of CSS properties over time. The principal difference
225 is that while transitions trigger <i>implicitly</i> when property values
226 change, animations are <i>explicitly</i> executed when the animation
227 properties are applied. Because of this, animations require explicit
228 values for the properties being animated. These values are specified using
229 animation keyframes, described below.
231 <p> Many aspects of the animation can be controlled, including how many
232 times the animation iterates, whether or not it alternates between the
233 begin and end values, and whether or not the animation should be running
234 or paused. An animation can also delay its start time.
236 <h2 id=animations><span class=secno>2. </span>Animations</h2>
238 <p> CSS Animations affect computed property values. During the execution of
239 an animation, the computed value for a property is controlled by the
240 animation. This overrides the value specified in the normal styling
241 system.
243 <p> In the case of multiple animations specifying behavior for the same
244 property, the animation defined last will override the previously defined
245 animations.
247 <p> An animation does not affect the computed value before the application
248 of the animation, before the animation delay has expired, and after the
249 end of the animation.
251 <div class=figure> <img alt="" src=sandwich.png></div>
253 <p class=caption> Computation of animated property values
255 <p> The diagram above shows how property values are computed. The intrinsic
256 style is shown at the top of the diagram. The computed value is derived
257 from intrinsic style at the times when an animation is not running and
258 also when an animation is delayed (see below for specification of
259 animation delay). During an animation, the computed style is derived from
260 the animated value.
262 <p> The start time of an animation is the latter of two moments: the time
263 at which the style is resolved that specifies the animation, or the time
264 the document's load event is fired. Therefore, an animation specified in
265 the document style sheet will begin at the document load. An animation
266 specified on an element by modifying the style after the document has
267 loaded will start when the style is resolved. That may be immediately in
268 the case of a pseudo style rule such as hover, or may be when the
269 scripting engine returns control to the browser (in the case of style
270 applied by script).
272 <p> An animation applies to an element if the element has a value for <a
273 href="#animation-name"><code class=property>'animation-name'</code></a>
274 that references a valid keyframes rule. Once an animation has started it
275 continues until it ends or the <a href="#animation-name"><code
276 class=property>'animation-name'</code></a> is removed. The values used for
277 the keyframes and animation properties are snapshotted at the time the
278 animation starts. Changing them during the execution of the animation has
279 no effect. Note also, that changing the value of <a
280 href="#animation-name"><code class=property>'animation-name'</code></a>
281 does not necessarily restart an animation (e.g., if a list of animations
282 are applied and one is removed from the list, only that animation will
283 stop; The other animations will continue). In order to restart an
284 animation, it must be removed then reapplied.
286 <p> The end of the animation is defined by the combination of the <a
287 href="#animation-duration"><code
288 class=property>'animation-duration'</code></a>, <a
289 href="#animation-iteration-count"><code
290 class=property>'animation-iteration-count'</code></a> and <a
291 href="#animation-fill-mode"><code
292 class=property>'animation-fill-mode'</code></a> properties.
294 <div class=example>
295 <p style="display:none"> Example(s):</p>
297 <pre>
298 div {
299 animation-name: diagonal-slide;
300 animation-duration: 5s;
301 animation-iteration-count: 10;
302 }
304 @keyframes diagonal-slide {
306 from {
307 left: 0;
308 top: 0;
309 }
311 to {
312 left: 100px;
313 top: 100px;
314 }
316 }
318 </pre>
319 This will produce an animation that moves an element from (0, 0) to
320 (100px, 100px) over five seconds and repeats itself nine times (for a
321 total of ten iterations).</div>
323 <h2 id=keyframes><span class=secno>3. </span>Keyframes</h2>
325 <p> Keyframes are used to specify the values for the animating properties
326 at various points during the animation. The keyframes specify the behavior
327 of one cycle of the animation; the animation may iterate one or more
328 times.
330 <p> Keyframes are specified using a specialized CSS at-rule. A <code
331 class=property>@keyframes</code> rule consists of the keyword
332 "@keyframes", followed by an identifier giving a name for the animation
333 (which will be referenced using <a href="#animation-name"><code
334 class=property>'animation-name'</code></a>), followed by a set of style
335 rules (delimited by curly braces).
337 <p> The <i>keyframe selector</i> for a keyframe style rule consists of a
338 comma-separated list of percentage values or the keywords ‘<code
339 class=property>from</code>’ or ‘<code
340 class=property>to</code>’. The selector is used to specify the
341 percentage along the duration of the animation that the keyframe
342 represents. The keyframe itself is specified by the block of property
343 values declared on the selector. The keyword ‘<code
344 class=property>from</code>’ is equivalent to the value 0%. The
345 keyword ‘<code class=property>to</code>’ is equivalent to the
346 value 100%. Note that the percentage unit specifier must be used on
347 percentage values. Therefore, "0" is an invalid keyframe selector.
349 <p> If a 0% or "from" keyframe is not specified, then the user agent
350 constructs a 0% keyframe using the computed values of the properties being
351 animated. If a 100% or "to" keyframe is not specified, then the user agent
352 constructs a 100% keyframe using the computed values of the properties
353 being animated.
355 <p> The <i>keyframe declaration</i> for a keyframe rule consists of
356 properties and values. Properties that are unable to be animated are
357 ignored in these rules, with the exception of <a
358 href="#animation-timing-function"><code
359 class=property>'animation-timing-function'</code></a>, the behavior of
360 which is described below.
362 <p class=note> NOTE: describe what happens if a property is not present in
363 all keyframes.
365 <p> The @keyframes rule that is used by an animation will be the last one
366 encountered in sorted rules order that matches the name of the animation
367 specified by the <a href="#animation-name"><code
368 class=property>'animation-name'</code></a> property. <code
369 class=css>@keyframes</code> rules do not cascade; therefore an animation
370 will never derive keyframes from more than one <code
371 class=css>@keyframes</code> rule.
373 <p> To determine the set of keyframes, all of the values in the selectors
374 are sorted in increasing order by time. If there are any duplicates, then
375 the last keyframe specified inside the <code class=css>@keyframes</code>
376 rule will be used to provide the keyframe information for that time. There
377 is no cascading within a <code class=css>@keyframes</code> rule if
378 multiple keyframes specify the same keyframe selector values.
380 <p> If property is not specified for a keyframe, or is specified but
381 invalid, the animation of that property proceeds as if that keyframe did
382 not exist. Conceptually, it is as if a set of keyframes is constructed for
383 each property that is present in any of the keyframes, and an animation is
384 run independently for each property.
386 <div class=example>
387 <p style="display:none"> Example(s):</p>
389 <pre>
390 @keyframes wobble {
391 0% {
392 left: 100px;
393 }
395 40% {
396 left: 150px;
397 }
399 60% {
400 left: 75px;
401 }
403 100% {
404 left: 100px;
405 }
406 }
408 </pre>
409 Four keyframes are specified for the animation named "wobble". In the
410 first keyframe, shown at the beginning of the animation cycle, the
411 ‘<code class=property>left</code>’ value of the animation is
412 100px. By 40% of the animation duration, ‘<code
413 class=property>left</code>’ value has animated to 150px. At 60% of
414 the animation duration, the ‘<code class=property>left</code>’
415 value has animated back to 75px. At the end of the animation cycle, the
416 ‘<code class=property>left</code>’ value has returned to
417 100px. The diagram below shows the state of the animation if it were given
418 a duration of 10s.
419 <div class=figure> <img alt="" src=animation1.png></div>
421 <p class=caption> Animations states specified by keyframes</p>
422 </div>
424 <p> The following is the grammar for the keyframes rule.
426 <pre>
428 keyframes_rule: KEYFRAMES_SYM S+ IDENT S* '{' S* keyframes_blocks '}' S*;
430 keyframes_blocks: [ keyframe_selector '{' S* declaration? [ ';' S* declaration? ]* '}' S* ]* ;
432 keyframe_selector: [ FROM_SYM | TO_SYM | PERCENTAGE ] S* [ ',' S* [ FROM_SYM | TO_SYM | PERCENTAGE ] S* ]*;
434 @{K}{E}{Y}{F}{R}{A}{M}{E}{S} {return KEYFRAMES_SYM;}
435 {F}{R}{O}{M} {return FROM_SYM;}
436 {T}{O} {return TO_SYM;}
437 </pre>
438 <!-- ======================================================================================================= -->
440 <h3 id=timing-functions-for-keyframes-><span class=secno>3.1. </span>
441 Timing functions for keyframes</h3>
443 <p> A keyframe style rule may also declare the timing function that is to
444 be used as the animation moves to the next keyframe.
446 <div class=example>
447 <p style="display:none"> Example(s):</p>
449 <pre>
450 @keyframes bounce {
452 from {
453 top: 100px;
454 animation-timing-function: ease-out;
455 }
457 25% {
458 top: 50px;
459 animation-timing-function: ease-in;
460 }
462 50% {
463 top: 100px;
464 animation-timing-function: ease-out;
465 }
467 75% {
468 top: 75px;
469 animation-timing-function: ease-in;
470 }
472 to {
473 top: 100px;
474 }
476 }
478 </pre>
479 Five keyframes are specified for the animation named "bounce". Between the
480 first and second keyframe (i.e., between 0% and 25%) an "ease-out" timing
481 function is used. Between the second and third keyframe (i.e., between 25%
482 and 50%) an "ease-in" timing function is used. And so on. The effect will
483 appear as an element that moves up the page 50px, slowing down as it
484 reaches its highest point then speeding up as it falls back to 100px. The
485 second half of the animation behaves in a similar manner, but only moves
486 the element 25px units up the page. A timing function specified on the
487 "to" or 100% keyframe is ignored</div>
489 <p> See <a href="#animation-timing-function_tag">the <code
490 class=property>'animation-timing-function'</code> property</a> for more
491 information.</p>
492 <!-- ======================================================================================================= -->
493 <!-- ======================================================================================================= -->
495 <h3 id=the-animation-name-property-><span class=secno>3.2. </span> The <a
496 href="#animation-name"><code class=property>'animation-name'</code></a>
497 Property</h3>
499 <p> The <a href="#animation-name"><code
500 class=property>'animation-name'</code></a> property defines a list of
501 animations that apply. Each name is used to select the keyframe at-rule
502 that provides the property values for the animation. If the name does not
503 match any keyframe at-rule, there are no properties to be animated and the
504 animation will not execute. Furthermore, if the animation name is
505 ‘<code class=property>none</code>’ then there will be no
506 animation. This can be used to override any animations coming from the
507 cascade. If animations are attempting to modify the same property, then
508 the animation closest to the end of the list of names wins.
510 <p> Each animation listed by name should have a corresponding value for the
511 other animation properties listed below. In the case where the other
512 properties do not have lists of the correct length, their values are
513 repeated to form a list with the same number of entries as <a
514 href="#animation-name"><code class=property>'animation-name'</code></a>.
516 <table class=propdef>
517 <tbody>
518 <tr>
519 <td> <em>Name:</em>
521 <td> <dfn id=animation-name>animation-name</dfn>
523 <tr>
524 <td> <em>Value:</em>
526 <td> none | IDENT [, [ none | IDENT ] ]*
528 <tr>
529 <td> <em>Initial:</em>
531 <td> none
533 <tr>
534 <td> <em>Applies to:</em>
536 <td> all elements, :before and :after pseudo elements
538 <tr>
539 <td> <em>Inherited:</em>
541 <td> no
543 <tr>
544 <td> <em>Percentages:</em>
546 <td> N/A
548 <tr>
549 <td> <em>Media:</em>
551 <td> visual
553 <tr>
554 <td> <em>Computed value:</em>
556 <td> Same as specified value.
557 </table>
558 <!--
559 <p>
560 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.
561 </p>
562 <div class="example">
563 <p style="display:none">
564 Example(s):
565 </p>
566 <pre>
567 @keyframes 'border-bloat' {
568 from {
569 border-width: 0;
570 }
571 to {
572 border-width: 10px;
573 }
574 }
576 @keyframes 'border-diet' {
577 from {
578 border-width: 4px;
579 }
580 to {
581 border-width: 2px;
582 }
583 }
585 div {
586 animation-name: 'border-bloat', 'border-diet';
587 animation-duration: 10s, 4s;
588 }
589 </pre>
590 <p>
591 The above example has two animations executing on the same property, <code class="property">'border-width'</code>. The animations are additive. That is, the
592 resulting value for the property will be the addition of the values from the
593 two animations.
594 </p>
595 <p>
596 At time '0s' the element's border will be 4px wide (0px from 'border-bloat' plus 4px from 'border-diet').
597 At time '4s' the element's border will be 6px wide (4px from 'border-bloat' plus 2px from 'border-diet').
598 At time '10s' the element's border will be 10px wide (10px from 'border-bloat' and no addition from
599 'border-diet' as it is no longer executing).
600 </p>
601 </div>
602 -->
603 <!-- ======================================================================================================= -->
605 <h3 id=the-animation-duration-property-><span class=secno>3.3. </span> The
606 <a href="#animation-duration"><code
607 class=property>'animation-duration'</code></a> Property</h3>
609 <p> The <a href="#animation-duration"><code
610 class=property>'animation-duration'</code></a> property defines the length
611 of time that an animation takes to complete one cycle.
613 <table class=propdef>
614 <tbody>
615 <tr>
616 <td> <em>Name:</em>
618 <td> <dfn id=animation-duration>animation-duration</dfn>
620 <tr>
621 <td> <em>Value:</em>
623 <td> <time> [, <time>]*
625 <tr>
626 <td> <em>Initial:</em>
628 <td> 0s
630 <tr>
631 <td> <em>Applies to:</em>
633 <td> all elements, :before and :after pseudo elements
635 <tr>
636 <td> <em>Inherited:</em>
638 <td> no
640 <tr>
641 <td> <em>Percentages:</em>
643 <td> N/A
645 <tr>
646 <td> <em>Media:</em>
648 <td> visual
650 <tr>
651 <td> <em>Computed value:</em>
653 <td> Same as specified value.
654 </table>
656 <p> By default the value is ‘<code class=css>0s</code>’,
657 meaning that the animation cycle is immediate. A negative value for <a
658 href="#animation-duration"><code
659 class=property>'animation-duration'</code></a> is treated as ‘<code
660 class=css>0s</code>’. In this case <a
661 href="#animation-fill-mode"><code
662 class=property>'animation-fill-mode'</code></a> still applies, so an
663 animation that fills backwards will show the value of the 0% keyframe
664 during any delay period, and an animation that fill forwards will retain
665 the value specified at the 100% keyframe, even if the animation was
666 instantaneous. Also, animation events are still fired.</p>
667 <!-- ======================================================================================================= -->
669 <h3 id="animation-timing-function_tag"><span class=secno>3.4. </span> The
670 <a href="#animation-timing-function"><code
671 class=property>'animation-timing-function'</code></a> Property</h3>
673 <p> The <a href="#animation-timing-function"><code
674 class=property>'animation-timing-function'</code></a> property describes
675 how the animation will progress over one cycle of its duration. See the
676 <code class=property>'transition-timing-function'</code> property <a
677 href="#CSS3-TRANSITIONS"
678 rel=biblioentry>[CSS3-TRANSITIONS]<!--{{!CSS3-TRANSITIONS}}--></a> for a
679 complete description of timing function calculation.
681 <table class=propdef>
682 <tbody>
683 <tr>
684 <td> <em>Name:</em>
686 <td> <dfn id=animation-timing-function>animation-timing-function</dfn>
688 <tr>
689 <td> <em>Value:</em>
691 <td> ease | linear | ease-in | ease-out | ease-in-out | step-start |
692 step-end | steps(<number>[, [ start | end ] ]?) |
693 cubic-bezier(<number>, <number>, <number>,
694 <number>) [, [ ease | linear | ease-in | ease-out | ease-in-out |
695 step-start | step-end | steps(<number>[, [ start | end ] ]?) |
696 cubic-bezier(<number>, <number>, <number>,
697 <number>)] ]*
699 <tr>
700 <td> <em>Initial:</em>
702 <td> ease
704 <tr>
705 <td> <em>Applies to:</em>
707 <td> all elements, :before and :after pseudo elements
709 <tr>
710 <td> <em>Inherited:</em>
712 <td> no
714 <tr>
715 <td> <em>Percentages:</em>
717 <td> N/A
719 <tr>
720 <td> <em>Media:</em>
722 <td> visual
724 <tr>
725 <td> <em>Computed value:</em>
727 <td> Same as specified value.
728 </table>
730 <p> For a keyframed animation, the <a
731 href="#animation-timing-function"><code
732 class=property>'animation-timing-function'</code></a> applies between
733 keyframes, not over the entire animation. For example, in the case of an
734 ease-in-out timing function, an animation will ease in at the start of the
735 keyframe and ease out at the end of the keyframe. A <a
736 href="#animation-timing-function"><code
737 class=property>'animation-timing-function'</code></a> defined within a
738 keyframe block applies to that keyframe, otherwise the timing function
739 specified for the animation is used.</p>
740 <!-- ======================================================================================================= -->
742 <h3 id=the-animation-iteration-count-property-><span class=secno>3.5.
743 </span> The <a href="#animation-iteration-count"><code
744 class=property>'animation-iteration-count'</code></a> Property</h3>
746 <p> The <a href="#animation-iteration-count"><code
747 class=property>'animation-iteration-count'</code></a> property defines the
748 number of times an animation cycle is played. The default value is one,
749 meaning the animation will play from beginning to end once. A value of
750 <code class=css>'infinite'</code> will cause the animation to repeat
751 forever. Non-integer numbers will cause the animation to end part-way
752 through a cycle. Negative values of <a
753 href="#animation-iteration-count"><code
754 class=property>'animation-iteration-count'</code></a> are invalid. This
755 property is often used with an <a href="#animation-direction"><code
756 class=property>'animation-direction'</code></a> value of <code
757 class=css>alternate</code>, which will cause the animation to play in
758 reverse on alternate cycles.
760 <table class=propdef>
761 <tbody>
762 <tr>
763 <td> <em>Name:</em>
765 <td> <dfn id=animation-iteration-count>animation-iteration-count</dfn>
767 <tr>
768 <td> <em>Value:</em>
770 <td> infinite | <number> [, [ infinite | <number> ] ]*
772 <tr>
773 <td> <em>Initial:</em>
775 <td> 1
777 <tr>
778 <td> <em>Applies to:</em>
780 <td> all elements, :before and :after pseudo elements
782 <tr>
783 <td> <em>Inherited:</em>
785 <td> no
787 <tr>
788 <td> <em>Percentages:</em>
790 <td> N/A
792 <tr>
793 <td> <em>Media:</em>
795 <td> visual
797 <tr>
798 <td> <em>Computed value:</em>
800 <td> Same as specified value.
801 </table>
802 <!-- ======================================================================================================= -->
804 <h3 id=the-animation-direction-property-><span class=secno>3.6. </span> The
805 <a href="#animation-direction"><code
806 class=property>'animation-direction'</code></a> Property</h3>
808 <p> The <a href="#animation-direction"><code
809 class=property>'animation-direction'</code></a> property defines whether
810 or not the animation should play in reverse on alternate cycles. If <code
811 class=css>alternate</code> is specified, the animation cycle iterations
812 that are odd counts are played in the normal direction, and the animation
813 cycle iterations that are even counts are played in a reverse direction.
814 When an animation is played in reverse the timing functions are also
815 reversed. For example, when played in reverse an ease-in animation would
816 appear to be an ease-out animation.
818 <table class=propdef>
819 <tbody>
820 <tr>
821 <td> <em>Name:</em>
823 <td> <dfn id=animation-direction>animation-direction</dfn>
825 <tr>
826 <td> <em>Value:</em>
828 <td> normal | alternate [, [ normal | alternate ] ]*
830 <tr>
831 <td> <em>Initial:</em>
833 <td> normal
835 <tr>
836 <td> <em>Applies to:</em>
838 <td> all elements, :before and :after pseudo elements
840 <tr>
841 <td> <em>Inherited:</em>
843 <td> no
845 <tr>
846 <td> <em>Percentages:</em>
848 <td> N/A
850 <tr>
851 <td> <em>Media:</em>
853 <td> visual
855 <tr>
856 <td> <em>Computed value:</em>
858 <td> Same as specified value.
859 </table>
860 <!-- ======================================================================================================= -->
862 <h3 id=the-animation-play-state-property-><span class=secno>3.7. </span>
863 The <a href="#animation-play-state"><code
864 class=property>'animation-play-state'</code></a> Property</h3>
866 <p> The <a href="#animation-play-state"><code
867 class=property>'animation-play-state'</code></a> property defines whether
868 the animation is running or paused. A running animation can be paused by
869 setting this property to <code class=css>'paused'</code>. To continue
870 running a paused animation this property can be set to <code
871 class=css>'running'</code>. A paused animation will continue to display
872 the current value of the animation in a static state, as if the time of
873 the animation is constant. When a paused animation is resumed, it restarts
874 from the current value, not necessarily from the beginning of the
875 animation.
877 <table class=propdef>
878 <tbody>
879 <tr>
880 <td> <em>Name:</em>
882 <td> <dfn id=animation-play-state>animation-play-state</dfn>
884 <tr>
885 <td> <em>Value:</em>
887 <td> running | paused [, [ running | paused ] ]*
889 <tr>
890 <td> <em>Initial:</em>
892 <td> running
894 <tr>
895 <td> <em>Applies to:</em>
897 <td> all elements, :before and :after pseudo elements
899 <tr>
900 <td> <em>Inherited:</em>
902 <td> no
904 <tr>
905 <td> <em>Percentages:</em>
907 <td> N/A
909 <tr>
910 <td> <em>Media:</em>
912 <td> visual
914 <tr>
915 <td> <em>Computed value:</em>
917 <td> Same as specified value.
918 </table>
919 <!-- ======================================================================================================= -->
921 <h3 id=the-animation-delay-property-><span class=secno>3.8. </span> The <a
922 href="#animation-delay"><code class=property>'animation-delay'</code></a>
923 Property</h3>
925 <p> The <a href="#animation-delay"><code
926 class=property>'animation-delay'</code></a> property defines when the
927 animation will start. It allows an animation to begin execution some time
928 after it is applied. An <a href="#animation-delay"><code
929 class=property>'animation-delay'</code></a> value of ‘<code
930 class=css>0s</code>’ means the animation will execute as soon as it
931 is applied. Otherwise, the value specifies an offset from the moment the
932 animation is applied, and the animation will delay execution by that
933 offset.
935 <p> If the value for <a href="#animation-delay"><code
936 class=property>'animation-delay'</code></a> is a negative time offset then
937 the animation will execute the moment it is applied, but will appear to
938 have begun execution at the specified offset. That is, the animation will
939 appear to begin part-way through its play cycle. In the case where an
940 animation has implied starting values and a negative <a
941 href="#animation-delay"><code class=property>'animation-delay'</code></a>,
942 the starting values are taken from the moment the animation is applied.
944 <table class=propdef>
945 <tbody>
946 <tr>
947 <td> <em>Name:</em>
949 <td> <dfn id=animation-delay>animation-delay</dfn>
951 <tr>
952 <td> <em>Value:</em>
954 <td> <time> [, <time>]*
956 <tr>
957 <td> <em>Initial:</em>
959 <td> 0s
961 <tr>
962 <td> <em>Applies to:</em>
964 <td> all elements, :before and :after pseudo elements
966 <tr>
967 <td> <em>Inherited:</em>
969 <td> no
971 <tr>
972 <td> <em>Percentages:</em>
974 <td> N/A
976 <tr>
977 <td> <em>Media:</em>
979 <td> visual
981 <tr>
982 <td> <em>Computed value:</em>
984 <td> Same as specified value.
985 </table>
986 <!-- ======================================================================================================= -->
988 <h3 id=the-animation-fill-mode-property-><span class=secno>3.9. </span> The
989 <a href="#animation-fill-mode"><code
990 class=property>'animation-fill-mode'</code></a> Property</h3>
992 <p> The <a href="#animation-fill-mode"><code
993 class=property>'animation-fill-mode'</code></a> property defines what
994 values are applied by the animation outside the time it is executing. By
995 default, an animation will not affect property values between the time it
996 is applied (the <a href="#animation-name"><code
997 class=property>'animation-name'</code></a> property is set on an element)
998 and the time it begins execution (which is determined by the <a
999 href="#animation-delay"><code class=property>'animation-delay'</code></a>
1000 property). Also, by default an animation does not affect property values
1001 after the animation ends (determined by the <a
1002 href="#animation-duration"><code
1003 class=property>'animation-duration'</code></a> property). The value of <a
1004 href="#animation-fill-mode"><code
1005 class=property>'animation-fill-mode'</code></a> can override this
1006 behavior.
1008 <p> If the value for <a href="#animation-fill-mode"><code
1009 class=property>'animation-fill-mode'</code></a> is <code
1010 class=css>'backwards'</code>, then the animation will apply the property
1011 values defined in its 0% or ‘<code class=property>from</code>’
1012 keyframe as soon as the animation is applied, during the period defined by
1013 <a href="#animation-delay"><code
1014 class=property>'animation-delay'</code></a>.
1016 <p> If the value for <a href="#animation-fill-mode"><code
1017 class=property>'animation-fill-mode'</code></a> is <code
1018 class=css>'forwards'</code>, then the animation will apply the property
1019 values defined in its last executing keyframe after the final iteration of
1020 the animation, until the animation style is removed. The last executing
1021 keyframe is the ‘<code class=property>to</code>’ or
1022 ‘<code class=css>100%</code>’ keyframe, unless the animation
1023 has <a href="#animation-direction"><code
1024 class=property>'animation-direction'</code></a> set to <code
1025 class=css>'alternate'</code> and both a finite and even iteration count,
1026 in which case it is the ‘<code class=property>from</code>’ or
1027 ‘<code class=css>0%</code>’ keyframe.
1029 <p> If the value for <a href="#animation-fill-mode"><code
1030 class=property>'animation-fill-mode'</code></a> is <code
1031 class=css>'both'</code>, then the animation will follow the rules for both
1032 ‘<code class=property>forwards</code>’ and ‘<code
1033 class=property>backwards</code>’. That is, it will extend the
1034 animation properties in both directions.
1036 <table class=propdef>
1037 <tbody>
1038 <tr>
1039 <td> <em>Name:</em>
1041 <td> <dfn id=animation-fill-mode>animation-fill-mode</dfn>
1043 <tr>
1044 <td> <em>Value:</em>
1046 <td> none | forwards | backwards | both [, [ none | forwards | backwards
1047 | both ] ]*
1049 <tr>
1050 <td> <em>Initial:</em>
1052 <td> none
1054 <tr>
1055 <td> <em>Applies to:</em>
1057 <td> all elements, :before and :after pseudo elements
1059 <tr>
1060 <td> <em>Inherited:</em>
1062 <td> no
1064 <tr>
1065 <td> <em>Percentages:</em>
1067 <td> N/A
1069 <tr>
1070 <td> <em>Media:</em>
1072 <td> visual
1074 <tr>
1075 <td> <em>Computed value:</em>
1077 <td> Same as specified value.
1078 </table>
1079 <!-- ======================================================================================================= -->
1081 <h3 id=the-animation-shorthand-property-><span class=secno>3.10. </span>
1082 The <a href="#animation"><code class=property>'animation'</code></a>
1083 Shorthand Property</h3>
1085 <p> The <a href="#animation"><code class=property>'animation'</code></a>
1086 shorthand property combines seven of the animation properties into a
1087 single property.
1089 <p> Note that order is important in this property. The first value that can
1090 be parsed as a time is assigned to the animation-duration. The second
1091 value that can be parsed as a time is assigned to animation-delay.
1093 <p class=issue> An alternative proposal is to accept the font shorthand
1094 approach of using a "/" character between the values of the same type.
1095 e.g. 2s/4s would mean a duration of 2 seconds and a delay of 4 seconds.
1097 <table class=propdef>
1098 <tbody>
1099 <tr>
1100 <td> <em>Name:</em>
1102 <td> <dfn id=animation>animation</dfn>
1104 <tr>
1105 <td> <em>Value:</em>
1107 <td> [<animation-name> || <animation-duration> ||
1108 <animation-timing-function> || <animation-delay> ||
1109 <animation-iteration-count> || <animation-direction> ||
1110 <animation-fill-mode>] [, [<animation-name> ||
1111 <animation-duration> || <animation-timing-function> ||
1112 <animation-delay> || <animation-iteration-count> ||
1113 <animation-direction> || <animation-fill-mode>] ]*
1115 <tr>
1116 <td> <em>Initial:</em>
1118 <td> see individual properties
1120 <tr>
1121 <td> <em>Applies to:</em>
1123 <td> all elements, :before and :after pseudo elements
1125 <tr>
1126 <td> <em>Inherited:</em>
1128 <td> no
1130 <tr>
1131 <td> <em>Percentages:</em>
1133 <td> N/A
1135 <tr>
1136 <td> <em>Media:</em>
1138 <td> visual
1140 <tr>
1141 <td> <em>Computed value:</em>
1143 <td> Same as specified value.
1144 </table>
1145 <!-- ======================================================================================================= -->
1147 <h2 id=animation-events-><span class=secno>4. </span> Animation Events</h2>
1149 <p> Several animation related events are available through the <a
1150 href="http://www.w3.org/TR/DOM-Level-2-Events/events.html">DOM Event
1151 system</a>. The start and end of an animation, and the end of each
1152 iteration of an animation all generate DOM events. An element can have
1153 multiple properties being animated simultaneously. This can occur either
1154 with a single <a href="#animation-name"><code
1155 class=property>animation-name</code></a> value with keyframes containing
1156 multiple properties, or with multiple <a href="#animation-name"><code
1157 class=property>animation-name</code></a> values. For the purposes of
1158 events, each <a href="#animation-name"><code
1159 class=property>animation-name</code></a> specifies a single animation.
1160 Therefore an event will be generated for each <a
1161 href="#animation-name"><code class=property>animation-name</code></a>
1162 value and not necessarily for each property being animated.
1164 <p> The time the animation has been running is sent with each event
1165 generated. This allows the event handler to determine the current
1166 iteration of a looping animation or the current position of an alternating
1167 animation. This time does not include any time the animation was in the
1168 <code>paused</code> play state.
1170 <dl>
1171 <dt> <b>Interface <i><a id=Events-AnimationEvent
1172 name=Events-AnimationEvent>AnimationEvent</a></i></b>
1174 <dd>
1175 <p> The <code>AnimationEvent</code> interface provides specific
1176 contextual information associated with Animation events.</p>
1178 <dl>
1179 <dt> <br>
1180 <b>IDL Definition</b>
1182 <dd>
1183 <div class=idl-code>
1184 <pre>
1185 interface AnimationEvent : Event {
1186 readonly attribute DOMString animationName;
1187 readonly attribute float elapsedTime;
1188 void initAnimationEvent(in DOMString typeArg,
1189 in boolean canBubbleArg,
1190 in boolean cancelableArg,
1191 in DOMString animationNameArg,
1192 in float elapsedTimeArg);
1193 };
1194 </pre>
1195 </div>
1197 <dt> <b>Attributes</b>
1199 <dd>
1200 <dl>
1201 <dt> <code class=attribute-name><a
1202 id=Events-AnimationEvent-animationName
1203 name=Events-AnimationEvent-animationName>animationName</a></code> of
1204 type <code>DOMString</code>, readonly
1206 <dd> The value of the <a href="#animation-name"><code
1207 class=property>animation-name</code></a> property of the animation
1208 that fired the event.
1209 </dl>
1211 <dl>
1212 <dt> <code class=attribute-name><a
1213 id=Events-AnimationEvent-elapsedTime
1214 name=Events-AnimationEvent-elapsedTime>elapsedTime</a></code> of type
1215 <code>float</code>, readonly
1217 <dd> The amount of time the animation has been running, in seconds,
1218 when this event fired, excluding any time the animation was paused.
1219 For an "animationstart" event, the elapsedTime is zero unless there
1220 was a negative value for <a href="#animation-delay"><code
1221 class=property>animation-delay</code></a>, in which case the event
1222 will be fired with an elapsedTime of (-1 * delay).
1223 </dl>
1225 <dt> <b>Methods</b>
1227 <dd>
1228 <dl>
1229 <dt> <code class=method-name><a
1230 id=Events-AnimationEvent-initAnimationEvent
1231 name=Events-AnimtionEvent-initAnimationEvent>initAnimationEvent</a></code>
1234 <dd>
1235 <div class=method> The <code>initAnimationEvent</code> method is used
1236 to initialize the value of an <code>AnimationEvent</code> created
1237 through the <a
1238 href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-DocumentEvent"><code>DocumentEvent</code></a>
1239 interface. This method may only be called before the
1240 <code>AnimationEvent</code> has been dispatched via the
1241 <code>dispatchEvent</code> method, though it may be called multiple
1242 times during that phase if necessary. If called multiple times, the
1243 final invocation takes precedence.
1244 <div class=parameters> <b>Parameters</b>
1245 <div class=paramtable>
1246 <dl>
1247 <dt> <code class=parameter-name>typeArg</code> of type
1248 <code>DOMString</code>
1250 <dd> Specifies the event type.<br>
1252 <dt> <code class=parameter-name>canBubbleArg</code> of type
1253 <code>boolean</code>
1255 <dd> Specifies whether or not the event can bubble.<br>
1257 <dt> <code class=parameter-name>cancelableArg</code> of type
1258 <code>boolean</code>
1260 <dd> Specifies whether or not the event's default action can be
1261 prevented.
1263 <dt> <code class=parameter-name>animationNameArg</code> of type
1264 <code>DOMString</code>
1266 <dd> Specifies the <a
1267 href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Event"><code>Event</code></a>‘<code
1268 class=css>s animation name.<br>
1269 </code>
1271 <dt> <code class=parameter-name>elapsedTimeArg</code> of type
1272 <code>float</code>
1274 <dd> Specifies the amount of time, in seconds, the animation has
1275 been running at the time of initialization.
1276 </dl>
1277 </div>
1278 </div>
1279 <!-- parameters -->
1280 <div> <b>No Return Value</b></div>
1282 <div> <b>No Exceptions</b></div>
1283 </div>
1284 <!-- method -->
1285 </dl>
1286 </dl>
1287 </dl>
1289 <p> The different types of Animation events that can occur are:
1291 <dl>
1292 <dt> <b>animationstart</b>
1294 <dd> The ’animationstart' event occurs at the start of the
1295 animation. If there is an <a href="#animation-delay"><code
1296 class=property>animation-delay</code></a> then this event will fire once
1297 the delay period has expired. A negative delay will cause the event to
1298 fire with an elapsedTime equal to the absolute value of the delay.
1299 <ul>
1300 <li>Bubbles: Yes
1302 <li>Cancelable: No
1304 <li>Context Info: animationName
1305 </ul>
1307 <dt> <b>animationend</b>
1309 <dd> The ‘<code class=property>animationend</code>’ event
1310 occurs when the animation finishes.
1311 <ul>
1312 <li>Bubbles: Yes
1314 <li>Cancelable: No
1316 <li>Context Info: animationName, elapsedTime
1317 </ul>
1319 <dt> <b>animationiteration</b>
1321 <dd> The ‘<code class=property>animationiteration</code>’
1322 event occurs at the end of each iteration of an animation for which <a
1323 href="#animation-iteration-count"><code>animation-iteration-count</code></a>
1324 is greater than one. This event does not occur for animations with an
1325 iteration count of one.
1326 <ul>
1327 <li>Bubbles: Yes
1329 <li>Cancelable: No
1331 <li>Context Info: animationName, elapsedTime
1332 </ul>
1333 </dl>
1334 <!-- ======================================================================================================= -->
1336 <h2 id=dom-interfaces-><span class=secno>5. </span> DOM Interfaces</h2>
1338 <p> CSS animation is exposed to the CSSOM through a pair of new interfaces
1339 describing the keyframes.
1341 <dl>
1342 <dt> <b>Interface <i><a id=DOM-CSSRule
1343 name=DOM-CSSRule>CSSRule</a></i></b>
1345 <dd>
1346 <p> The following 2 rule types are added to the <code>CSSRule</code>
1347 interface. They provide identification for the new keyframe and
1348 keyframes rules.</p>
1350 <dl>
1351 <dt> <b>IDL Definition</b>
1353 <dd>
1354 <div class=idl-code>
1355 <pre>
1356 interface CSSRule {
1357 ...
1358 const unsigned short KEYFRAMES_RULE = 7;
1359 const unsigned short KEYFRAME_RULE = 8;
1360 ...
1361 };</pre>
1362 </div>
1363 </dd>
1364 <!-- IDL -->
1365 </dl>
1367 <dt> <b>Interface <i><a id=DOM-CSSKeyframeRule
1368 name=DOM-CSSKeyframeRule>CSSKeyframeRule</a></i></b>
1370 <dd>
1371 <p> The <code>CSSKeyframeRule</code> interface represents the style rule
1372 for a single key.</p>
1374 <dl>
1375 <dt> <br>
1376 <b>IDL Definition</b>
1378 <dd>
1379 <div class=idl-code>
1380 <pre>
1381 interface CSSKeyframeRule : CSSRule {
1382 attribute DOMString keyText;
1383 readonly attribute CSSStyleDeclaration style;
1384 };
1385 </pre>
1386 </div>
1387 <br>
1389 <dt> <b>Attributes</b>
1391 <dd>
1392 <dl>
1393 <dt> <code class=attribute-name><a id=DOM-CSSKeyframeRule-keyText
1394 name=DOM-CSSKeyframeRule-keyText>keyText</a></code> of type
1395 <code>DOMString</code>
1397 <dd> This attribute represents the key as the string representation of
1398 a floating point number between 0 and 1. If the value in the CSS
1399 style is <code>from</code> this value will be 0, and if the value in
1400 the CSS style is <code>to</code> this value will be 1.<br>
1401 </dl>
1403 <dd>
1404 <dl>
1405 <dt> <code class=attribute-name><a id=DOM-CSSKeyframeRule-style
1406 name=DOM-CSSKeyframeRule-style>style</a></code> of type
1407 <code>CSSStyleDeclaration</code>
1409 <dd> This attribute represents the style associated with this
1410 keyframe.<br>
1411 </dl>
1413 <dt> <b>No Methods</b>
1414 </dl>
1415 </dl>
1417 <dl>
1418 <dt> <b>Interface <i><a id=DOM-CSSKeyframesRule
1419 name=DOM-CSSKeyframesRule>CSSKeyframesRule</a></i></b>
1421 <dd>
1422 <p> The <code>CSSKeyframesRule</code> interface represents a complete set
1423 of keyframes for a single animation.</p>
1425 <dl>
1426 <dt> <br>
1427 <b>IDL Definition</b>
1429 <dd>
1430 <div class=idl-code>
1431 <pre>
1432 interface CSSKeyframesRule : CSSRule {
1433 attribute DOMString name;
1434 readonly attribute CSSRuleList cssRules;
1436 void appendRule(in DOMString rule);
1437 void deleteRule(in DOMString key);
1438 CSSKeyframeRule findRule(in DOMString key);
1439 };
1440 </pre>
1441 </div>
1442 <br>
1444 <dt> <b>Attributes</b>
1446 <dd>
1447 <dl>
1448 <dt> <code class=attribute-name><a id=DOM-CSSKeyframesRule-name
1449 name=DOM-CSSKeyframesRule-name>name</a></code> of type
1450 <code>DOMString</code>
1452 <dd> This attribute is the name of the keyframes, used by the <a
1453 href="#animation-name"><code>animation-name</code></a> property.<br>
1454 </dl>
1456 <dd>
1457 <dl>
1458 <dt> <code class=attribute-name><a id=DOM-CSSKeyframeRules-cssRules
1459 name=DOM-CSSKeyframeRules-cssRules>cssRules</a></code> of type
1460 <code>CSSRuleList</code>
1462 <dd> This attribute gives access to the keyframes in the list.<br>
1463 </dl>
1465 <dt> <b>Methods</b>
1467 <dd>
1468 <dl><!-- ======================================================================================================= -->
1470 <dt> <code class=method-name><a id=DOM-CSSKeyframesRule-appendRule
1471 name=DOM-CSSKeyframesRule-appendRule>appendRule</a></code>
1473 <dd>
1474 <div class=method> The <code>appendRule</code> method appends the
1475 passed CSSKeyframeRule into the list at the passed key.
1476 <div class=parameters> <b>Parameters</b>
1477 <div class=paramtable>
1478 <dl>
1479 <dt> <code class=parameter-name>rule</code> of type
1480 <code>DOMString</code>
1482 <dd> The rule to be appended, expressed in the same syntax as one
1483 entry in the <code>@keyframes</code> rule.
1484 </dl>
1485 </div>
1486 </div>
1487 <!-- parameters -->
1488 <div class=return-value> <b>No Return Value</b></div>
1490 <div> <b>No Exceptions</b></div>
1491 </div>
1492 <!-- ======================================================================================================= -->
1495 <dt> <code class=method-name><a id=DOM-CSSKeyframesRule-deleteRule
1496 name=DOM-CSSKeyframesRule-deleteRule>deleteRule</a></code>
1498 <dd>
1499 <div class=method> The <code>deleteRule</code> method deletes the
1500 CSSKeyframeRule with the passed key. If a rule with this key does
1501 not exist, the method does nothing.
1502 <div class=parameters> <b>Parameters</b>
1503 <div class=paramtable>
1504 <dl>
1505 <dt> <code class=parameter-name>key</code> of type
1506 <code>DOMString</code>
1508 <dd> The key which describes the rule to be deleted. The key must
1509 resolve to a number between 0 and 1, or the rule is ignored.<br>
1510 </dl>
1511 </div>
1512 </div>
1513 <!-- parameters -->
1514 <div class=return-value> <b>No Return Value</b></div>
1516 <div> <b>No Exceptions</b></div>
1517 </div>
1518 <!-- ======================================================================================================= -->
1521 <dt> <code class=method-name><a id=DOM-CSSKeyframesRule-findRule
1522 name=DOM-CSSKeyframesRule-findRule>findRule</a></code>
1524 <dd>
1525 <div class=method> The <code>findRule</code> method returns the rule
1526 with a key matching the passed key. If no such rule exists, a null
1527 value is returned.
1528 <div class=parameters> <b>Parameters</b>
1529 <div class=paramtable>
1530 <dl>
1531 <dt> <code class=parameter-name>key</code> of type
1532 <code>DOMString</code>
1534 <dd> The key which described the rule to find. The key must
1535 resolve to a number between 0 and 1, or the rule is ignored.<br>
1536 </dl>
1537 </div>
1538 </div>
1539 <!-- parameters -->
1540 <div class=return-value> <b>Return Value</b>
1541 <div class=returnvalue>
1542 <dl>
1543 <dt> <code>CSSKeyframeRule</code>
1545 <dd> The found rule.<br>
1546 </dl>
1547 </div>
1548 </div>
1550 <div> <b>No Exceptions</b></div>
1551 </div>
1552 <!-- ======================================================================================================= -->
1554 </dl>
1555 <!-- method -->
1556 </dl>
1557 </dl>
1559 <h2 id=references><span class=secno>6. </span>References</h2>
1561 <h3 class=no-num id=normative-references>Normative references</h3>
1562 <!--begin-normative-->
1563 <!-- Sorted by label -->
1565 <dl class=bibliography>
1566 <dt style="display: none"><!-- keeps the doc valid if the DL is empty -->
1567 <!---->
1569 <dt id=CSS3-TRANSITIONS>[CSS3-TRANSITIONS]
1571 <dd>Dean Jackson; et al. <a
1572 href="http://www.w3.org/TR/2009/WD-css3-transitions-20091201"><cite>CSS
1573 Transitions Module Level 3.</cite></a> 1 December 2009. W3C Working
1574 Draft. (Work in progress.) URL: <a
1575 href="http://www.w3.org/TR/2009/WD-css3-transitions-20091201">http://www.w3.org/TR/2009/WD-css3-transitions-20091201</a>
1576 </dd>
1577 <!---->
1578 </dl>
1579 <!--end-normative-->
1581 <h3 class=no-num id=other-references>Other references</h3>
1582 <!--begin-informative-->
1583 <!-- Sorted by label -->
1585 <dl class=bibliography>
1586 <dt style="display: none"><!-- keeps the doc valid if the DL is empty -->
1587 <!---->
1588 </dl>
1589 <!--end-informative-->
1591 <h2 class=no-num id=property-index>Property index</h2>
1592 <!--begin-properties-->
1594 <table class=proptable>
1595 <thead>
1596 <tr>
1597 <th>Property
1599 <th>Values
1601 <th>Initial
1603 <th>Applies to
1605 <th>Inh.
1607 <th>Percentages
1609 <th>Media
1611 <tbody>
1612 <tr>
1613 <th><a class=property href="#animation">animation</a>
1615 <td>[<animation-name> || <animation-duration> ||
1616 <animation-timing-function> || <animation-delay> ||
1617 <animation-iteration-count> || <animation-direction> ||
1618 <animation-fill-mode>] [, [<animation-name> ||
1619 <animation-duration> || <animation-timing-function> ||
1620 <animation-delay> || <animation-iteration-count> ||
1621 <animation-direction> || <animation-fill-mode>] ]*
1623 <td>see individual properties
1625 <td>all elements, :before and :after pseudo elements
1627 <td>no
1629 <td>N/A
1631 <td>visual
1633 <tr>
1634 <th><a class=property href="#animation-delay">animation-delay</a>
1636 <td><time> [, <time>]*
1638 <td>0s
1640 <td>all elements, :before and :after pseudo elements
1642 <td>no
1644 <td>N/A
1646 <td>visual
1648 <tr>
1649 <th><a class=property
1650 href="#animation-direction">animation-direction</a>
1652 <td>normal | alternate [, [ normal | alternate ] ]*
1654 <td>normal
1656 <td>all elements, :before and :after pseudo elements
1658 <td>no
1660 <td>N/A
1662 <td>visual
1664 <tr>
1665 <th><a class=property href="#animation-duration">animation-duration</a>
1667 <td><time> [, <time>]*
1669 <td>0s
1671 <td>all elements, :before and :after pseudo elements
1673 <td>no
1675 <td>N/A
1677 <td>visual
1679 <tr>
1680 <th><a class=property
1681 href="#animation-fill-mode">animation-fill-mode</a>
1683 <td>none | forwards | backwards | both [, [ none | forwards | backwards
1684 | both ] ]*
1686 <td>none
1688 <td>all elements, :before and :after pseudo elements
1690 <td>no
1692 <td>N/A
1694 <td>visual
1696 <tr>
1697 <th><a class=property
1698 href="#animation-iteration-count">animation-iteration-count</a>
1700 <td>infinite | <number> [, [ infinite | <number> ] ]*
1702 <td>1
1704 <td>all elements, :before and :after pseudo elements
1706 <td>no
1708 <td>N/A
1710 <td>visual
1712 <tr>
1713 <th><a class=property href="#animation-name">animation-name</a>
1715 <td>none | IDENT [, [ none | IDENT ] ]*
1717 <td>none
1719 <td>all elements, :before and :after pseudo elements
1721 <td>no
1723 <td>N/A
1725 <td>visual
1727 <tr>
1728 <th><a class=property
1729 href="#animation-play-state">animation-play-state</a>
1731 <td>running | paused [, [ running | paused ] ]*
1733 <td>running
1735 <td>all elements, :before and :after pseudo elements
1737 <td>no
1739 <td>N/A
1741 <td>visual
1743 <tr>
1744 <th><a class=property
1745 href="#animation-timing-function">animation-timing-function</a>
1747 <td>ease | linear | ease-in | ease-out | ease-in-out | step-start |
1748 step-end | steps(<number>[, [ start | end ] ]?) |
1749 cubic-bezier(<number>, <number>, <number>,
1750 <number>) [, [ ease | linear | ease-in | ease-out | ease-in-out |
1751 step-start | step-end | steps(<number>[, [ start | end ] ]?) |
1752 cubic-bezier(<number>, <number>, <number>,
1753 <number>)] ]*
1755 <td>ease
1757 <td>all elements, :before and :after pseudo elements
1759 <td>no
1761 <td>N/A
1763 <td>visual
1764 </table>
1765 <!--end-properties-->
1767 <h2 class=no-num id=index>Index</h2>
1768 <!--begin-index-->
1770 <ul class=indexlist>
1771 <li>animation, <a href="#animation"
1772 title=animation><strong>3.10.</strong></a>
1774 <li>animation-delay, <a href="#animation-delay"
1775 title=animation-delay><strong>3.8.</strong></a>
1777 <li>animation-direction, <a href="#animation-direction"
1778 title=animation-direction><strong>3.6.</strong></a>
1780 <li>animation-duration, <a href="#animation-duration"
1781 title=animation-duration><strong>3.3.</strong></a>
1783 <li>animation-fill-mode, <a href="#animation-fill-mode"
1784 title=animation-fill-mode><strong>3.9.</strong></a>
1786 <li>animation-iteration-count, <a href="#animation-iteration-count"
1787 title=animation-iteration-count><strong>3.5.</strong></a>
1789 <li>animation-name, <a href="#animation-name"
1790 title=animation-name><strong>3.2.</strong></a>
1792 <li>animation-play-state, <a href="#animation-play-state"
1793 title=animation-play-state><strong>3.7.</strong></a>
1795 <li>animation-timing-function, <a href="#animation-timing-function"
1796 title=animation-timing-function><strong>3.4.</strong></a>
1797 </ul>
1798 <!--end-index-->
1799 </html>
1800 <!-- Keep this comment at the end of the file
1801 Local variables:
1802 mode: sgml
1803 sgml-default-doctype-name:"html"
1804 sgml-minimize-attributes:t
1805 End:
1806 -->