css3-animations/Overview.src.html

Wed, 15 Feb 2012 18:36:17 +0000

author
L. David Baron <dbaron@dbaron.org>
date
Wed, 15 Feb 2012 18:36:17 +0000
changeset 4531
b80217b81d3b
parent 4528
55165315dff5
child 4551
9291fb211b30
permissions
-rw-r--r--

Clarify wording, as discussed in http://lists.w3.org/Archives/Public/www-archive/2012Feb/0018.html .

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

mercurial