css-transitions/Overview.src.html

Tue, 22 Oct 2013 11:45:08 +0200

author
L. David Baron <dbaron@dbaron.org>
date
Tue, 22 Oct 2013 11:45:08 +0200
changeset 9406
3d943f796fee
parent 9094
94fe743b9684
child 9524
9eb0718d6baa
permissions
-rw-r--r--

[css-transitions] Note issue with wording of previous large edit.

     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 Transitions</title>
     7   <script src='http://test.csswg.org/harness/annotate.js#css-transitions-1_dev' type='text/javascript' defer></script>
     8   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     9   <link rel="stylesheet" type="text/css" href="../default.css">
    10   <style type="text/css">
    11     table.animatable-properties {
    12       border-collapse: collapse;
    13     }
    14     table.animatable-properties td {
    15       padding: 0.2em 1em;
    16       border: 1px solid black;
    17     }
    18     div.prod { margin: 1em 2em; }
    19   </style>
    20   <link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-[STATUS].css">
    21 </head>
    23 <body>
    25 <div class="head">
    26 <!--logo-->
    28 <h1>CSS Transitions</h1>
    30 <h2 class="no-num no-toc">[LONGSTATUS] [DATE]</h2>
    31 <dl>
    32   <dt>This version:
    33     <dd>
    34     <a href="[VERSION]">[VERSION]</a>
    35   <dt>Latest version:
    36     <dd><a href="http://www.w3.org/TR/css3-transitions/">
    37       [LATEST]</a>
    38   <dt>Editor's draft:
    39     <dd><a href="http://dev.w3.org/csswg/[SHORTNAME]/">http://dev.w3.org/csswg/[SHORTNAME]/</a>
    40     (<a href="https://dvcs.w3.org/hg/csswg/log/tip/css-transitions/Overview.src.html">change log</a>,
    41     <a href="https://dvcs.w3.org/hg/csswg/log/tip/css3-transitions/Overview.src.html">older change log</a>)
    42   <dt>Previous version:
    43     <dd><a href="http://www.w3.org/TR/2013/WD-css3-transitions-20130212/">http://www.w3.org/TR/2013/WD-css3-transitions-20130212/</a>
    44   <dt id="editors-list">Editors:
    45     <dd><a href="mailto:dino@apple.com">Dean Jackson</a> (<a
    46       href="http://www.apple.com/">Apple Inc</a>)
    47     <dd><a href="mailto:hyatt@apple.com">David Hyatt</a> (<a
    48       href="http://www.apple.com/">Apple Inc</a>)
    49     <dd><a href="mailto:cmarrin@apple.com">Chris Marrin</a> (<a
    50       href="http://www.apple.com/">Apple Inc</a>)
    51     <dd class=vcard><a class=fn href="http://dbaron.org/">L. David Baron</a> (<a
    52       class=org href="http://www.mozilla.org/">Mozilla</a>)
    54   <dt>Issues list:
    55     <dd><a href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&amp;product=CSS&amp;component=Transitions&amp;resolution=---&amp;cmdtype=doit">in Bugzilla</a>
    57   <dt>Feedback:
    58     <dd><a href="mailto:www-style@w3.org?subject=%5Bcss-transitions%5D%20feedback">www-style@w3.org</a>
    59         with subject line &ldquo;<kbd>[css-transitions] <var>&hellip; message topic &hellip;</var></kbd>&rdquo;
    60         (<a rel="discussion" href="http://lists.w3.org/Archives/Public/www-style/">archives</a>)
    62   <dt>Test suite:
    63     <dd>  <a href="http://test.csswg.org/suites/css-transitions-1/nightly-unstable/">http://test.csswg.org/suites/css-transitions-1/nightly-unstable/</a>
    64 </dl>
    66 <!--copyright-->
    68 <hr title="Separator for header">
    69 </div>
    71 <h2 class="no-num no-toc" id="abstract">Abstract</h2>
    73 <p>CSS Transitions allows property changes in CSS values to occur smoothly
    74   over a specified duration.
    76 <h2 class="no-num no-toc" id="status">Status of this document</h2>
    77 <!--status-->
    79 <h2 class="no-num no-toc" id="contents">Table of Contents</h2>
    80 <!--toc-->
    83 <h2 id="introduction">Introduction</h2>
    85       <p><em>This section is not normative.</em>
    86       <p>
    87         This document introduces new CSS features to enable <em>implicit transitions</em>, which describe how CSS properties can be made to change smoothly from one value to another over a given duration.
    88       </p>
    90 <h2 id="transitions"><a id="transitions-">Transitions</a></h2>
    91       <p>
    92         Normally when the value of a CSS property changes, the rendered result is instantly updated, with the affected elements immediately changing from the old property value to the new property value. This section describes a way to specify transitions using new CSS properties. These properties are used to animate smoothly from the old state to the new state over time.
    93       </p>
    94       <p>
    95         For example, suppose that transitions of one second have been defined on the 'left' and
    96         'background-color' properties. The following diagram illustrates the effect of updating those properties on an element, in this case moving it to the right and changing the background from red to blue. This assumes other transition parameters still have their default values.
    97       </p>
    98       <div class="figure">
    99         <img src="transition1.png" alt="">
   100       </div>
   101       <p class="caption">
   102         Transitions of 'left' and 'background-color'
   103       </p>
   104       <p>
   105         Transitions are a presentational effect. The computed value of a property transitions over time from the old value to the new value. Therefore if a script queries the computed style of a property as it is transitioning, it will see an intermediate value that represents the current animated value of the property.
   106       </p>
   107       <p>
   108         Only animatable CSS properties can be transitioned. See the table at the end of this document for a list 
   109         of properties that are animatable.
   110       </p>
   111       <p>
   112         The transition for a property is defined using a number of new properties. For example:
   113       </p>
   114       <div class="example">
   115         <p style="display:none">
   116           Example(s):
   117         </p>
   118         <pre>
   119   div {
   120     transition-property: opacity;
   121     transition-duration: 2s;
   122   }
   123   </pre>The above example defines a transition on the 'opacity' property that, when a new value is assigned to it, will cause a smooth change between the old value and the new value over a period of two seconds.
   124       </div>
   125       <p>
   126         Each of the transition properties accepts a comma-separated list, allowing multiple transitions to be defined, each acting on a different property. In this case, the individual transitions take their parameters from the same index in all the lists. For example:
   127       </p>
   128       <div class="example">
   129         <p style="display:none">
   130           Example(s):
   131         </p>
   132         <pre>
   133   div {
   134     transition-property: opacity, left;
   135     transition-duration: 2s, 4s;
   136   }
   138   </pre>This will cause the 'opacity' property to transition over a period of two seconds and the left property to transition over a period of four seconds.
   139       </div>
   141       <p id="list-matching">
   142         In the case where the lists of values in transition properties
   143         do not have the same length, the length of the
   144         'transition-property' list determines the number of items in
   145         each list examined when starting transitions.  The lists are
   146         matched up from the first value: excess values at the end are
   147         not used.  If one of the other properties doesn't have enough
   148         comma-separated values to match the number of values of
   149         'transition-property', the UA must calculate its used value by
   150         repeating the list of values until there are enough.  This
   151         truncation or repetition does not affect the computed value.
   152         <span class="note">
   153           Note: This is analogous to the behavior of the 'background-*'
   154           properties, with 'background-image' analogous to
   155           'transition-property'.
   156         </span>
   157       </p>
   159       <div class="example">
   160         <p style="display:none">
   161           Example(s):
   162         </p>
   163       <pre>
   164       div {
   165         transition-property: opacity, left, top, width;
   166         transition-duration: 2s, 1s;
   167       }
   168       </pre>The above example defines a transition on the 'opacity' property of 2 seconds duration, a
   169       transition on the 'left' property of 1
   170       second duration, a transition on the 'top' property of 2 seconds duration and a
   171       transition on the 'width' property of 1
   172       second duration.
   174       </div>
   176       <p>
   177         While authors can use transitions to create dynamically changing content,
   178         dynamically changing content can lead to seizures in some users.
   179         For information on how to avoid content that can lead to seizures, see
   180         <a href="http://www.w3.org/TR/WCAG20/#seizure">Guideline 2.3:
   181         Seizures:
   182         Do not design content in a way that is known to cause seizures</a>
   183         ([[WCAG20]]).
   184       </p>
   186       <!-- ======================================================================================================= -->
   187       <h3 id="transition-property-property"><a id="the-transition-property-property-">
   188         The 'transition-property' Property
   189       </a></h3>
   190       <p>
   191         The 'transition-property' property specifies the name of the CSS property to which the transition is applied.
   192       </p>
   193       <table class="propdef">
   194         <tbody>
   195           <tr>
   196             <td>
   197               <em>Name:</em>
   198             </td>
   199             <td>
   200               <dfn id="transition-property">transition-property</dfn>
   201             </td>
   202           </tr>
   203           <tr>
   204             <td>
   205               <em>Value:</em>
   206             </td>
   207             <td>
   208               none | <span>&lt;single-transition-property&gt;</span> [ ',' <span>&lt;single-transition-property&gt;</span> ]*
   209             </td>
   210           </tr>
   211           <tr>
   212             <td>
   213               <em>Initial:</em>
   214             </td>
   215             <td>
   216               all
   217             </td>
   218           </tr>
   219           <tr>
   220             <td>
   221               <em>Applies to:</em>
   222             </td>
   223             <td>
   224               all elements, :before and :after pseudo elements
   225             </td>
   226           </tr>
   227           <tr>
   228             <td>
   229               <em>Inherited:</em>
   230             </td>
   231             <td>
   232               no
   233             </td>
   234           </tr>
   235           <tr>
   236             <td>
   237               <em>Animatable:</em>
   238             </td>
   239             <td>
   240               no
   241             </td>
   242           </tr>
   243           <tr>
   244             <td>
   245               <em>Percentages:</em>
   246             </td>
   247             <td>
   248               N/A
   249             </td>
   250           </tr>
   251           <tr>
   252             <td>
   253               <em>Media:</em>
   254             </td>
   255             <td>
   256               visual
   257             </td>
   258           </tr>
   259           <tr>
   260             <td>
   261               <em>Computed value:</em>
   262             </td>
   263             <td>
   264               Same as specified value.
   265             </td>
   266           </tr>
   267           <tr>
   268             <td>
   269               <em>Canonical order:</em>
   270             </td>
   271             <td>
   272               <abbr title="follows order of property value definition">per grammar</abbr>
   273             </td>
   274           </tr>
   275         </tbody>
   276       </table>
   278       <div class="prod">
   279         <dfn id="single-transition-property">&lt;single-transition-property&gt;</dfn> = all | &lt;IDENT&gt;
   280       </div>
   282       <p>
   283         A value of ''none'' means that no property will transition.
   284         Otherwise, a list of properties to be transitioned, or the
   285         keyword ''all'' which indicates that all properties are to be
   286         transitioned, is given.
   287       </p>
   289       <p>
   290         If one of the identifiers listed is not a recognized property
   291         name or is not an animatable property, the implementation must
   292         still start transitions on the animatable properties in the
   293         list using the duration, delay, and timing function at their
   294         respective indices in the lists for 'transition-duration',
   295         'transition-delay', and 'transition-timing-function'.  In other
   296         words, unrecognized or non-animatable properties must be kept in
   297         the list to preserve the matching of indices.
   298       </p>
   300       <p>
   301         The keywords ''none'', ''inherit'', and ''initial'' are not
   302         permitted as items within a list of more that one identifier;
   303         any list that uses them is syntactically invalid.
   304         In other words, the &lt;IDENT&gt; production in
   305         <span>&lt;single-transition-property&gt;</span> matches any
   306         identifier other than these three keywords.
   307       </p>
   309       <p>
   310         For the keyword ''all'', or if one of the identifiers listed is a
   311         shorthand property, implementations must start transitions for
   312         any of its longhand sub-properties that are animatable (or, for
   313         ''all'', all animatable properties), using the duration, delay,
   314         and timing function at the index corresponding to the shorthand.
   315       </p>
   316       <p>
   317         If a property is specified multiple times in the value of
   318         'transition-property' (either on its own, via a shorthand that
   319         contains it, or via the ''all'' value), then the transition that
   320         starts uses the duration, delay, and timing function at the
   321         index corresponding to the <em>last</em> item in the value of
   322         'transition-property' that calls for animating that property.
   323       </p>
   324       <p class="note">
   325         Note:  The ''all'' value and 'all' shorthand
   326         property work in similar ways, so the
   327         ''all'' value is just like a shorthand that
   328         covers all properties.
   329       </p>
   331       <!-- ======================================================================================================= -->
   332       <h3 id="transition-duration-property"><a id="the-transition-duration-property-">
   333         The 'transition-duration' Property
   334       </a></h3>
   335       <p>
   336         The 'transition-duration' property defines the length of time that a transition takes.
   337       </p>
   338       <table class="propdef">
   339         <tbody>
   340           <tr>
   341             <td>
   342               <em>Name:</em>
   343             </td>
   344             <td>
   345               <dfn id="transition-duration">transition-duration</dfn>
   346             </td>
   347           </tr>
   348           <tr>
   349             <td>
   350               <em>Value:</em>
   351             </td>
   352             <td>
   353               <span>&lt;time&gt;</span> [, <span>&lt;time&gt;</span>]*
   354             </td>
   355           </tr>
   356           <tr>
   357             <td>
   358               <em>Initial:</em>
   359             </td>
   360             <td>
   361               0s
   362             </td>
   363           </tr>
   364           <tr>
   365             <td>
   366               <em>Applies to:</em>
   367             </td>
   368             <td>
   369               all elements, :before and :after pseudo elements
   370             </td>
   371           </tr>
   372           <tr>
   373             <td>
   374               <em>Inherited:</em>
   375             </td>
   376             <td>
   377               no
   378             </td>
   379           </tr>
   380           <tr>
   381             <td>
   382               <em>Animatable:</em>
   383             </td>
   384             <td>
   385               no
   386             </td>
   387           </tr>
   388           <tr>
   389             <td>
   390               <em>Percentages:</em>
   391             </td>
   392             <td>
   393               N/A
   394             </td>
   395           </tr>
   396           <tr>
   397             <td>
   398               <em>Media:</em>
   399             </td>
   400             <td>
   401               interactive
   402             </td>
   403           </tr>
   404           <tr>
   405             <td>
   406               <em>Computed value:</em>
   407             </td>
   408             <td>
   409               Same as specified value.
   410             </td>
   411           </tr>
   412           <tr>
   413             <td>
   414               <em>Canonical order:</em>
   415             </td>
   416             <td>
   417               <abbr title="follows order of property value definition">per grammar</abbr>
   418             </td>
   419           </tr>
   420         </tbody>
   421       </table>
   422       <p>
   423         This property specifies how long the transition from the old value to the new value should take. By default the value is ''0s'', meaning that the transition is immediate (i.e. there will be no animation). A negative value for 'transition-duration' renders the declaration invalid.
   424       </p>
   426       <!-- =======================================================================================================   
   427         -->
   429       <h3 id="transition-timing-function-property"><a id="transition-timing-function_tag">
   430         The 'transition-timing-function' Property
   431       </a></h3>
   432       <p>
   433         The 'transition-timing-function' property
   434         describes how the intermediate values used during a transition will be
   435         calculated. It allows for a transition to change speed over its
   436         duration. These effects are commonly called <em>easing</em> functions.
   437         In either case, a mathematical function that provides a smooth curve is
   438         used.
   439       </p>
   440       <p>
   441         Timing functions are either defined as a stepping function or 
   442         a <a
   443         href="http://en.wikipedia.org/wiki/B%C3%A9zier_curve#Cubic_B.C3.A9zier_curves">cubic
   444         B&eacute;zier curve</a>. 
   445         The timing function takes as its input
   446         the current elapsed percentage of the transition duration
   447         and outputs the percentage of the way the transition is
   448         from its start value to its end value.
   449         How this output is used is defined by
   450         the <a href="#animatable-types">interpolation rules</a>
   451         for the value type.
   452       </p>
   453       <p>
   454         A <a href="http://en.wikipedia.org/wiki/Step_function">stepping</a>
   455         function is defined by a number that divides the domain of operation
   456         into equally sized intervals. Each subsequent interval is a equal step
   457         closer to the goal state. The function also specifies whether the
   458         change in output percentage happens at the start or end of the
   459         interval (in other words, if 0% on the input percentage is the point
   460         of initial change).
   461       </p>
   462       <div class="figure">
   463         <img src="step.png" alt="The step timing function splits
   464           the function domain into a number of disjoint straight line
   465           segments. steps(1, start) is a function whose
   466           output value is 1 for all input values. steps(1, end) is a function whose
   467           output value is 0 for all input values less than 1, and output
   468           is 1 for the input value of 1. steps(3, start) is a function that
   469           divides the input domain into three segments, each 1/3 in length,
   470           and 1/3 above the previous segment, with the first segment starting
   471           at 1/3. steps(3, end) is a function that
   472           divides the input domain into three segments, each 1/3 in length,
   473           and 1/3 above the previous segment, with the first segment starting
   474           at 0.">
   475       </div>
   476       <p class="caption">
   477         Step timing functions
   478       </p>
   479       <p>
   480         A <a
   481         href="http://en.wikipedia.org/wiki/B%C3%A9zier_curve#Cubic_B.C3.A9zier_curves">cubic
   482         B&eacute;zier curve</a> is defined by four control points, P<sub>0</sub>
   483         through P<sub>3</sub> (see Figure 1). P<sub>0</sub> and P<sub>3</sub>
   484         are always set to (0,0) and (1,1). The 'transition-timing-function' property is used
   485         to specify the values for points P<sub>1</sub> and P<sub>2</sub>. These
   486         can be set to preset values using the keywords listed below, or can be
   487         set to specific values using the ''cubic-bezier'' function.
   488         In the ''cubic-bezier'' function, P<sub>1</sub> and
   489         P<sub>2</sub> are each specified by both an X and Y value.
   490       </p>
   491       <div class="figure">
   492         <img src="TimingFunction.png" alt="The B&eacute;zier timing function is a
   493           smooth curve from point P0 = (0,0) to point P3 = (1,1). The
   494           length and orientation of the line segment P0-P1 determines
   495           the tangent and the curvature of the curve at P0 and the
   496           line segment P2-P3 does the same at P3.">
   497       </div>
   498       <p class="caption">
   499         B&eacute;zier Timing Function Control Points
   500       </p>
   501       <table class="propdef">
   502         <tbody>
   503           <tr>
   504             <td>
   505               <em>Name:</em>
   506             </td>
   507             <td>
   508               <dfn id="transition-timing-function">transition-timing-function</dfn>
   509             </td>
   510           </tr>
   511           <tr>
   512             <td>
   513               <em>Value:</em>
   514             </td>
   515             <td>
   516               <span>&lt;single-transition-timing-function&gt;</span> [ ',' <span>&lt;single-transition-timing-function&gt;</span> ]*
   517             </td>
   518           </tr>
   519           <tr>
   520             <td>
   521               <em>Initial:</em>
   522             </td>
   523             <td>
   524               ease
   525             </td>
   526           </tr>
   527           <tr>
   528             <td>
   529               <em>Applies to:</em>
   530             </td>
   531             <td>
   532               all elements, :before and :after pseudo elements
   533             </td>
   534           </tr>
   535           <tr>
   536             <td>
   537               <em>Inherited:</em>
   538             </td>
   539             <td>
   540               no
   541             </td>
   542           </tr>
   543           <tr>
   544             <td>
   545               <em>Animatable:</em>
   546             </td>
   547             <td>
   548               no
   549             </td>
   550           </tr>
   551           <tr>
   552             <td>
   553               <em>Percentages:</em>
   554             </td>
   555             <td>
   556               N/A
   557             </td>
   558           </tr>
   559           <tr>
   560             <td>
   561               <em>Media:</em>
   562             </td>
   563             <td>
   564               interactive
   565             </td>
   566           </tr>
   567           <tr>
   568             <td>
   569               <em>Computed value:</em>
   570             </td>
   571             <td>
   572               Same as specified value.
   573             </td>
   574           </tr>
   575           <tr>
   576             <td>
   577               <em>Canonical order:</em>
   578             </td>
   579             <td>
   580               <abbr title="follows order of property value definition">per grammar</abbr>
   581             </td>
   582           </tr>
   583         </tbody>
   584       </table>
   585       <div class="prod">
   586         <dfn id="single-transition-timing-function">&lt;single-transition-timing-function&gt;</dfn> = ease | linear | ease-in | ease-out | ease-in-out | step-start | step-end | steps(&lt;integer&gt;[, [ start | end ] ]?) | cubic-bezier(&lt;number&gt;, &lt;number&gt;, &lt;number&gt;, &lt;number&gt;)
   587       </div>
   588       <p>
   589         The timing functions have the following definitions.
   590       </p>
   591       <dl>
   592         <dt>
   593           ease
   594         </dt>
   595         <dd>
   596           The ease function is equivalent to cubic-bezier(0.25, 0.1, 0.25, 1).
   597         </dd>
   598         <dt>
   599           linear
   600         </dt>
   601         <dd>
   602           The linear function is equivalent to cubic-bezier(0, 0, 1, 1).
   603         </dd>
   604         <dt>
   605           ease-in
   606         </dt>
   607         <dd>
   608           The ease-in function is equivalent to cubic-bezier(0.42, 0, 1, 1).
   609         </dd>
   610         <dt>
   611           ease-out
   612         </dt>
   613         <dd>
   614           The ease-out function is equivalent to cubic-bezier(0, 0, 0.58, 1).
   615         </dd>
   616         <dt>
   617           ease-in-out
   618         </dt>
   619         <dd>
   620           The ease-in-out function is equivalent to cubic-bezier(0.42, 0, 0.58, 1)
   621         </dd>
   622         <dt>
   623           step-start
   624         </dt>
   625         <dd>
   626           The step-start function is equivalent to steps(1, start).
   627         </dd>
   628         <dt>
   629           step-end
   630         </dt>
   631         <dd>
   632           The step-end function is equivalent to steps(1, end).
   633         </dd>
   634         <dt>
   635           steps(&lt;integer&gt;[, [ start | end ] ]?)
   636         </dt>
   637         <dd>
   638           Specifies a stepping function, described above, taking two
   639           parameters. The first parameter specifies the number of intervals
   640           in the function. It must be a positive integer (greater than 0).
   641           The second parameter, which is optional, is
   642           either the value ''start'' or ''end'', and specifies the point
   643           at which the change of values occur within the interval.
   644           If the second parameter is omitted, it is given the value 'end'.
   645         </dd>
   646         <dt>
   647           cubic-bezier(&lt;number&gt;, &lt;number&gt;, &lt;number&gt;, &lt;number&gt;)
   648         </dt>
   649         <dd>
   650           Specifies a <a
   651           href="http://en.wikipedia.org/wiki/B%C3%A9zier_curve">cubic-bezier
   652           curve</a>. The four values specify points P<sub>1</sub> and
   653           P<sub>2</sub> of the curve as (x1, y1, x2, y2). Both x values must be
   654           in the range [0, 1] or the definition is invalid. The y values can
   655           exceed this range.
   656         </dd>
   657       </dl><!-- ======================================================================================================= -->
   658       <h3 id="transition-delay-property"><a id="the-transition-delay-property-">
   659         The 'transition-delay' Property
   660       </a></h3>
   661       <p>
   662         The 'transition-delay' property defines when the transition will start. It allows a transition to begin execution some some period of time from when it is applied. A 'transition-delay' value of ''0s'' means the transition will execute as soon as the property is changed. Otherwise, the value specifies an offset from the moment the property is changed, and the transition will delay execution by that offset.
   663       </p>
   664       <p>
   665         If the value for 'transition-delay' is a negative time offset then the transition will execute the moment the property is changed, but will appear to have begun execution at the specified offset. That is, the transition will appear to begin part-way through its play cycle. In the case where a transition has implied starting values and a negative 'transition-delay', the starting values are taken from the moment the property is changed.
   666       </p>
   667       <table class="propdef">
   668         <tbody>
   669           <tr>
   670             <td>
   671               <em>Name:</em>
   672             </td>
   673             <td>
   674               <dfn id="transition-delay">transition-delay</dfn>
   675             </td>
   676           </tr>
   677           <tr>
   678             <td>
   679               <em>Value:</em>
   680             </td>
   681             <td>
   682               <span>&lt;time&gt;</span> [, <span>&lt;time&gt;</span>]*
   683             </td>
   684           </tr>
   685           <tr>
   686             <td>
   687               <em>Initial:</em>
   688             </td>
   689             <td>
   690               0s
   691             </td>
   692           </tr>
   693           <tr>
   694             <td>
   695               <em>Applies to:</em>
   696             </td>
   697             <td>
   698               all elements, :before and :after pseudo elements
   699             </td>
   700           </tr>
   701           <tr>
   702             <td>
   703               <em>Inherited:</em>
   704             </td>
   705             <td>
   706               no
   707             </td>
   708           </tr>
   709           <tr>
   710             <td>
   711               <em>Animatable:</em>
   712             </td>
   713             <td>
   714               no
   715             </td>
   716           </tr>
   717           <tr>
   718             <td>
   719               <em>Percentages:</em>
   720             </td>
   721             <td>
   722               N/A
   723             </td>
   724           </tr>
   725           <tr>
   726             <td>
   727               <em>Media:</em>
   728             </td>
   729             <td>
   730               interactive
   731             </td>
   732           </tr>
   733           <tr>
   734             <td>
   735               <em>Computed value:</em>
   736             </td>
   737             <td>
   738               Same as specified value.
   739             </td>
   740           </tr>
   741           <tr>
   742             <td>
   743               <em>Canonical order:</em>
   744             </td>
   745             <td>
   746               <abbr title="follows order of property value definition">per grammar</abbr>
   747             </td>
   748           </tr>
   749         </tbody>
   750       </table><!-- ======================================================================================================= -->
   751       <h3 id="transition-shorthand-property"><a id="the-transition-shorthand-property-">
   752         The 'transition' Shorthand Property
   753       </a></h3>
   754       <p>
   755         The 'transition' shorthand property combines the four properties described above into a single property.
   756       </p>
   757       <table class="propdef">
   758         <tbody>
   759           <tr>
   760             <td>
   761               <em>Name:</em>
   762             </td>
   763             <td>
   764               <dfn id="transition">transition</dfn>
   765             </td>
   766           </tr>
   767           <tr>
   768             <td>
   769               <em>Value:</em>
   770             </td>
   771             <td>
   772               <span>&lt;single-transition&gt;</span> [ ',' <span>&lt;single-transition&gt;</span> ]*
   773             </td>
   774           </tr>
   775           <tr>
   776             <td>
   777               <em>Initial:</em>
   778             </td>
   779             <td>
   780               see individual properties
   781             </td>
   782           </tr>
   783           <tr>
   784             <td>
   785               <em>Applies to:</em>
   786             </td>
   787             <td>
   788               all elements, :before and :after pseudo elements
   789             </td>
   790           </tr>
   791           <tr>
   792             <td>
   793               <em>Inherited:</em>
   794             </td>
   795             <td>
   796               no
   797             </td>
   798           </tr>
   799           <tr>
   800             <td>
   801               <em>Animatable:</em>
   802             </td>
   803             <td>
   804               no
   805             </td>
   806           </tr>
   807           <tr>
   808             <td>
   809               <em>Percentages:</em>
   810             </td>
   811             <td>
   812               N/A
   813             </td>
   814           </tr>
   815           <tr>
   816             <td>
   817               <em>Media:</em>
   818             </td>
   819             <td>
   820               interactive
   821             </td>
   822           </tr>
   823           <tr>
   824             <td>
   825               <em>Computed value:</em>
   826             </td>
   827             <td>
   828               see individual properties
   829             </td>
   830           </tr>
   831           <tr>
   832             <td>
   833               <em>Canonical order:</em>
   834             </td>
   835             <td>
   836               <abbr title="follows order of property value definition">per grammar</abbr>
   837             </td>
   838           </tr>
   839         </tbody>
   840       </table>
   842       <div class="prod">
   843         <dfn id="single-transition">&lt;single-transition&gt;</dfn> = [ none | <span>&lt;single-transition-property&gt;</span> ] || <span>&lt;time&gt;</span> || <span>&lt;single-transition-timing-function&gt;</span> || <span>&lt;time&gt;</span>
   844       </div>
   846       <p>
   847         Note that order is important within the items in this property:
   848         the first value that can be parsed as a time is assigned to the
   849         transition-duration,
   850         and the second value that can be parsed as a time is assigned to
   851         transition-delay.
   852       </p>
   854       <p>
   855         If there is more than one <span>&lt;single-transition&gt;</span> in the shorthand,
   856         and any of the transitions has
   857         ''none'' as the <span>&lt;single-transition-property&gt;</span>,
   858         then the declaration is invalid.
   859       </p>
   861       <h2 id="starting">
   862         Starting of transitions
   863       </h2>
   865       <p>
   866         When the computed value of an animatable property changes,
   867         implementations must decide what transitions to start based on
   868         the values of the 'transition-property', 'transition-duration',
   869         'transition-timing-function', and 'transition-delay' properties
   870         at the time the animatable property would first have its new
   871         computed value.
   872         This means that when one of these 'transition-*' properties
   873         changes at the same time as
   874         a property whose change might transition,
   875         it is the <em>new</em> values of the 'transition-*' properties
   876         that control the transition.
   877       </p>
   878       <div class="example" id="manual-reversing-example">
   879         <p style="display:none">
   880           Example(s):
   881         </p>
   882         <p>This provides a way for authors to specify different values
   883         of the 'transition-*' properties for the &ldquo;forward&rdquo;
   884         and &ldquo;reverse&rdquo; transitions (but see <a
   885         href="#reversing">below</a> for special reversing behavior when
   886         an <em>incomplete</em> transition is interrupted).  Authors can
   887         specify the value of 'transition-duration',
   888         'transition-timing-function', or 'transition-delay' in the same
   889         rule where they specify the value that triggers the transition,
   890         or can change these properties at the same time as they change
   891         the property that triggers the transition.  Since it's the new
   892         values of these 'transition-*' properties that affect the
   893         transition, these values will be used for the transitions
   894         <em>to</em> the associated transitioning values.  For example:
   895          </p>
   896         <pre>li {
   897   transition: background-color linear 1s;
   898   background: blue;
   899 }
   900 li:hover {
   901   background-color: green;
   902   transition-duration: 2s; /* applies to the transition *to* the :hover state */
   903 }</pre>
   904         <p>
   905           When a list item with these style rules enters the :hover
   906           state, the computed 'transition-duration' at the time that
   907           'background-color' would have its new value (''green'') is ''2s'',
   908           so the transition from 'blue' to 'green' takes 2 seconds.
   909           However, when the list item leaves the :hover state, the
   910           transition from ''green'' to ''blue'' takes 1 second.
   911         </p>
   912       </div>
   914       <p>
   915         Various things can cause the computed style of an element to change,
   916         or for an element to start or stop having computed style.
   917         (For the purposes of this specification,
   918         an element has computed style when it is in the document tree,
   919         and does not have computed style when it is not in the document tree.)
   920         These include
   921         insertion and removal of elements from the document tree
   922         (which both changes whether those elements have computed styles and
   923         can change the styles of other elements through selector matching),
   924         changes to the document tree that cause
   925         changes to which selectors match elements,
   926         changes to style sheets or style attributes,
   927         and other things.
   928         This specification does not define when computed styles are updated.
   929         However,
   930         when an implementation updates the computed style for an element
   931         to reflect one of these changes,
   932         it must update the computed style for all elements to reflect all
   933         of these changes at the same time
   934         (or at least it must be undetectable that it was done at a
   935         different time).
   936         This processing of a set of simultaneous style changes is called a
   937         <dfn>style change event</dfn>.
   938         (Implementations typically have a <span>style change event</span> to
   939         correspond with their desired screen refresh rate,
   940         and when up-to-date computed style is needed
   941         for a script API that depends on it.)
   942       </p>
   944       <p>
   945         Since this specification does not define
   946         when a <span>style change event</span> occurs,
   947         and thus what changes to computed values are considered simultaneous,
   948         authors should be aware that changing any of the transition
   949         properties a small amount of time after making a change that
   950         might transition can result in behavior that varies between
   951         implementations, since the changes might be considered
   952         simultaneous in some implementations but not others.
   953       </p>
   955       <p>
   956         When a <span>style change event</span> occurs,
   957         implementations must start transitions based on
   958         the computed styles that changed in that event.
   959         If an element does not have a computed style
   960         either before or after the style change event,
   961         then transitions are not started for that element
   962         in that style change event.
   963         Otherwise,
   964         define the <dfn>before-change style</dfn> as
   965         the computed style for the element as of
   966         the previous <span>style change event</span>,
   967         except with any styles derived from declarative
   968         animations such as CSS Transitions, CSS Animations
   969         ([[CSS3-ANIMATIONS]]),
   970         and SMIL Animations ([[SMIL-ANIMATION]], [[SVG11]])
   971         updated to the current time.
   972         Likewise, define the <dfn>after-change style</dfn> as
   973         the computed style for the element based on the information
   974         known at the start of that <span>style change event</span>,
   975         in other words,
   976         excluding any changes resulting from CSS Transitions
   977         that start during that <span>style change event</span>.
   978       </p>
   980       <p class="issue">
   981         This wording needs to handle already-running transitions better!
   982       </p>
   984       <div class="note">
   985         <p>
   986           Note that this definition of the <span>after-change style</span>
   987           means that a single change
   988           can start a transition on the same property
   989           on both an ancestor element and its descendant element.
   990           This can happen when a property change is inherited
   991           from one element with 'transition-*' properties
   992           that say to animate the changing property
   993           to another element with 'transition-*' properties
   994           that also say to animate the changing property.
   995         </p>
   997         <p>
   998           When this happens, both transitions will run,
   999           and the transition on the descendant will override
  1000           the transition on the ancestor
  1001           because of the normal
  1002           CSS cascading and inheritance rules ([[CSS3CASCADE]]).
  1003         </p>
  1005         <p>
  1006           If the transition on the descendant completes before
  1007           the transition on the ancestor,
  1008           the descendant will then resume inheriting
  1009           the (still transitioning) value from its parent.
  1010           This effect is likely not a desirable effect,
  1011           but it is essentially doing what the author asked for.
  1012         </p>
  1013       </div>
  1015       <p>
  1016         For each element with a <span>before-change style</span> and
  1017         an <span>after-change style</span>,
  1018         and each property (other than shorthands) for which
  1019         the <span>before-change style</span> is different from
  1020         the <span>after-change style</span>,
  1021         implementations must
  1022         start transitions based on the relevant item (see <a
  1023         href="#transition-property">the definition of
  1024         'transition-property'</a>) in the computed value of
  1025         'transition-property'.
  1026         Corresponding to this item there is
  1027         a <span>matching transition duration</span>,
  1028         a <span>matching transition delay</span>, and
  1029         a <span>matching transition timing function</span>
  1030         in the computed values of
  1031         'transition-duration', 'transition-delay', and 'transition-timing-function'
  1032         (see <a href="#list-matching">the rules on matching lists</a>).
  1033         Define the <dfn>combined duration</dfn> of the transition
  1034         as the sum of max(matching transition duration, ''0s'') and
  1035         the matching transition-delay.
  1036         When the combined duration is greater than ''0s'',
  1037         then a transition starts based on the values of the
  1038         matching transition duration, the matching transition delay,
  1039         and the matching transition-timing-function;
  1040         in other cases transitions do not occur.
  1041         The <dfn>start time</dfn> of this transition is defined as
  1042         the time of the <span>style change event</span> plus
  1043         the matching transition delay.
  1044         The <dfn>end time</dfn> of this transition is defined as
  1045         the <span>start time</span> plus the matching transition duration.
  1046       </p>
  1048       <p>
  1049         Once the transition of a property has started, it must continue
  1050         running based on the original timing function, duration, and
  1051         delay, even if the 'transition-timing-function',
  1052         'transition-duration', or 'transition-delay' property changes
  1053         before the transition is complete.  However, if the
  1054         'transition-property' property changes such that the transition
  1055         would not have started, the transition must stop (and the
  1056         property must immediately change to its final value).
  1057       </p>
  1059       <p>
  1060         Implementations must not start a transition when the computed
  1061         value of a property changes as a result of declarative animation
  1062         (as opposed to scripted animation).
  1063       </p>
  1065       <p>
  1066         Implementations also must not start a transition when the
  1067         computed value changes because it is inherited (directly or
  1068         indirectly) from another element that is transitioning the same
  1069         property.
  1070       </p>
  1072       <h2 id="application">
  1073         Application of transitions
  1074       </h2>
  1076       <p>
  1077         When a property on an element is undergoing a transition
  1078         (that is, when or after the transition has started and before the
  1079         <span>end time</span> of the transition)
  1080         the transition adds a style to the CSS cascade
  1081         at the level defined for CSS Transitions in [[CSS3CASCADE]].
  1082       </p>
  1084       <p class="note">
  1085         Note that this means that computed values
  1086         resulting from CSS transitions
  1087         can inherit to descendants just like
  1088         any other computed values.
  1089         In the normal case, this means that
  1090         a transition of an inherited property
  1091         applies to descendant elements
  1092         just as an author would expect.
  1093       </p>
  1095       <p>
  1096         Implementations must add this value to the cascade
  1097         if and only if
  1098         that property is not currently
  1099         undergoing a CSS Animation ([[CSS3-ANIMATIONS]]) on the same element.
  1100       </p>
  1102       <p class="note">
  1103         Note that this behavior of transitions not applying to the cascade
  1104         when an animation on the same element and property is running
  1105         does not affect whether the transition has started or ended.
  1106         APIs that detect whether transitions are running
  1107         (such as <a href="#transition-events">transition events</a>)
  1108         still report that a transition is running.
  1109       </p>
  1111       <p>
  1112         If the current time is at or before the
  1113         <span>start time</span> of the transition
  1114         (that is, during the delay phase of the transition),
  1115         this value is a specified style that will compute
  1116         to the <span>before-change style</span> in the
  1117         <span>style change event</span> in which the transition was started.
  1118       </p>
  1120       <p>
  1121         If the current time is after the
  1122         <span>start time</span> of the transition
  1123         (that is, during the duration phase of the transition),
  1124         this value is a specified style that will compute
  1125         to the <a href="#animatable-types">result of interpolating the property</a>
  1126         using the <span>before-change style</span> for the property as
  1127         <i>V</i><sub>start</sub>,
  1128         using the <span>after-change style</span> for the property as
  1129         <i>V</i><sub>end</sub>,
  1130         and using (current time - start time) / (end time - start time)
  1131         as the input to the timing function.
  1132         (The <span>before-change style</span> and <span>after-change style</span>
  1133         <span>style change event</span> in which the transition was started.)
  1134       </p>
  1136       <h2 id="reversing">
  1137         Automatically reversing interrupted transitions
  1138       </h2>
  1139       <p>
  1140         A common type of transition effect is when a running transition is
  1141         interrupted and the property is reset to its original value. An
  1142         example is a hover effect on an element, where the pointer enters and
  1143         exits the element before the effect has completed. If the outgoing and
  1144         incoming transitions are executed using their specified durations and
  1145         timing functions, the resulting effect can be distractingly
  1146         asymmetric. Instead, the expected behavior is that the new transition
  1147         should be the reverse of what has already executed.
  1148       </p>
  1150       <p>
  1151         If a running transition with duration T, executing so far for duration TE, 
  1152         from state A, to state B, is interrupted by
  1153         a property change that would start a new transition back to state A, and
  1154         all the transition attributes are the same (duration, delay and timing function),
  1155         then the new transition must reverse the effect. The new transition must:
  1156       </p>
  1158       <ol>
  1159         <li>
  1160           Use the B and A states as its "from" and "to" states respectively. It
  1161           does not use the current value as its from state, due to the rules below.
  1162         </li>
  1163         <li>
  1164           Execute with the same duration T, but starting as if the transition had
  1165           already begun, without any transition delay, at the moment which would
  1166           cause the new transition to finish in TE from the moment of interruption. In other
  1167           words, the new transition will execute as if it started T-TE in the past.
  1168         </li>
  1169         <li>
  1170           Use a timing function that is the portion of the curve traversed up
  1171           to the moment of interruption, followed in the opposite direction (towards
  1172           the starting point). This will make the transition appear as if it 
  1173           is playing backwards.
  1174         </li>
  1175         <li>
  1176           Ignore any transition delay.
  1177         </li>
  1178       </ol>
  1180       <p>
  1181         For example, suppose there is a transition with a duration of two
  1182         seconds. If this transition is interrupted after 0.5 seconds and the
  1183         property value assigned to the original value, then the new transition
  1184         effect will be the reverse of the original, as if it had begun
  1185         1.5 seconds in the past.
  1186       </p>
  1188       <p>
  1189         Note that by using the defined from and to states for the reversing
  1190         transition, it is also possible that it may reverse again, if
  1191         interrupted; for example, if the transition reversing to state A was
  1192         again interrupted by a property change to state B.
  1193       </p>
  1195       <p class="issue">Issue:
  1196         This introduces the concept of reversing a timing function,
  1197         which the spec has otherwise resisted doing, and also introduces
  1198         a discontinuity between transitions that have
  1199         almost completed (which get automatically reversed and thus have
  1200         their timing function reversed) and transitions that have fully
  1201         completed (where the reversal doesn't lead to the timing
  1202         function being reversed).  An alternative proposal that avoids
  1203         this is to follow the normal timing function algorithm, except
  1204         multiply the duration (and also shorten any negative delay) by
  1205         the (output) value of the transition timing function of the
  1206         incomplete transition at the time it was interrupted, and, to
  1207         account for multiple reverses in sequence, to divide by the
  1208         shortening applied to the transition being interrupted.  For
  1209         more details see this thread:
  1210         <a href="http://lists.w3.org/Archives/Public/www-style/2009Nov/thread.html#msg302">November 2009 part</a>,
  1211         <a href="http://lists.w3.org/Archives/Public/www-style/2009Dec/thread.html#msg319">December 2009 part</a>,
  1212         <a href="http://lists.w3.org/Archives/Public/www-style/2010Jan/thread.html#msg136">January 2010 part</a>.
  1213         Also see:
  1214         <a href="http://lists.w3.org/Archives/Public/public-fx/2012AprJun/0107.html">minutes 2012-05-09</a> (and <a href="http://www.w3.org/Graphics/fx/track/actions/77">action</a>),
  1215         <a href="http://lists.w3.org/Archives/Public/www-style/2012Nov/0262.html">minutes 2012-10-30</a>,
  1216         <a href="transition-reversing-demo">reversing demo</a>.
  1217         Working Group resolution from 2013-06-07 needs to be edited.
  1218       </p>
  1220       <h2 id="transition-events"><a id="transition-events-">
  1221         Transition Events
  1222       </a></h2>
  1223       <p>
  1224         The completion of a CSS Transition generates a corresponding <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html">DOM Event</a>.
  1225         An event is fired for each property that undergoes a transition.
  1226         This allows a content developer to perform actions that synchronize
  1227         with the completion of a transition.
  1228       </p>
  1229       <p>
  1230         Each event provides the name of the property the transition is
  1231         associated with as well as the duration of the transition.
  1232       </p>
  1233       <dl>
  1234         <dt>
  1235           <b>Interface <dfn id="Events-TransitionEvent">TransitionEvent</dfn></b>
  1236         </dt>
  1237         <dd>
  1238           <p>
  1239             The <code>TransitionEvent</code> interface provides specific contextual information associated with transitions.
  1240           </p>
  1241           <dl>
  1242             <dt>
  1243               <b>IDL Definition</b>
  1244             </dt>
  1245             <dd>
  1246               <div class='idl-code'>
  1247                 <pre>
  1248   <span id="TransitionEvent">[Constructor(DOMString <var title="">type</var>, optional <i>TransitionEventInit</i> <var title="">transitionEventInitDict</var>)]
  1249   interface TransitionEvent</span> : Event {
  1250     readonly attribute DOMString          <a href="#Events-TransitionEvent-propertyName">propertyName</a>;
  1251     readonly attribute float              <a href="#Events-TransitionEvent-elapsedTime">elapsedTime</a>;
  1252     readonly attribute DOMString          <a href="#Events-TransitionEvent-pseudoElement">pseudoElement</a>;
  1253   };
  1255   dictionary <dfn id="TransitionEventInit">TransitionEventInit</dfn> : <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#eventinit">EventInit</a> {
  1256     DOMString <a href="#Events-TransitionEvent-propertyName">propertyName</a> = "";
  1257     float <a href="#Events-TransitionEvent-elapsedTime">elapsedTime</a> = 0.0;
  1258     DOMString <a href="#Events-TransitionEvent-pseudoElement">pseudoElement</a> = "";
  1260   </pre>
  1261               </div>
  1262             </dd>
  1263             <dt>
  1264               <b>Attributes</b>
  1265             </dt>
  1266             <dd>
  1267               <dl>
  1268                 <dt>
  1269                   <code class='attribute-name'><dfn title="TransitionEvent::propertyName" id="Events-TransitionEvent-propertyName">propertyName</dfn></code> of type <code>DOMString</code>, readonly
  1270                 </dt>
  1271                 <dd>
  1272                   The name of the CSS property associated with the transition.
  1273                 </dd>
  1274               </dl>
  1275               <dl>
  1276                 <dt>
  1277                   <code class='attribute-name'><dfn title="TransitionEvent::elapsedTime" id="Events-TransitionEvent-elapsedTime">elapsedTime</dfn></code> of type <code>float</code>, readonly
  1278                 </dt>
  1279                 <dd>
  1280                   The amount of time the transition has been running, in seconds, when this event fired. Note that this value is not affected by the value of <code class="property">transition-delay</code>.
  1281                 </dd>
  1282               </dl>
  1283               <dl>
  1284                 <dt>
  1285                   <code class='attribute-name'><dfn title="TransitionEvent::pseudoElement" id="Events-TransitionEvent-pseudoElement">pseudoElement</dfn></code> of type <code>DOMString</code>, readonly
  1286                 </dt>
  1287                 <dd>
  1288                   The name (beginning with two colons) of the CSS
  1289                   pseudo-element on which the transition occured (in
  1290                   which case the target of the event is that
  1291                   pseudo-element's corresponding element), or the empty
  1292                   string if the transition occurred on an element (which
  1293                   means the target of the event is that element).
  1294                 </dd>
  1295               </dl>
  1296             </dd>
  1297           </dl>
  1298           <p>
  1299             <code id="TransitionEvent-constructor">TransitionEvent(type, transitionEventInitDict)</code>
  1300             is an <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#constructing-events">event constructor</a>.
  1301           </p>
  1302         </dd>
  1303       </dl>
  1304       <p>
  1305         There is one type of transition event available.
  1306       </p>
  1307       <dl>
  1308         <dt>
  1309           <b><dfn>transitionend</dfn></b>
  1310         </dt>
  1311         <dd>
  1312           The <code>transitionend</code> event occurs at the completion of the transition. In the
  1313           case where a transition is removed before completion, such as if the
  1314           transition-property is removed, then the event will not fire.
  1315           <ul>
  1316             <li>Bubbles: Yes
  1317             </li>
  1318             <li>Cancelable: Yes
  1319             </li>
  1320             <li>Context Info: propertyName, elapsedTime, pseudoElement
  1321             </li>
  1322           </ul>
  1323         </dd>
  1324       </dl>
  1326       <h2 id="animatable-types"><a id="animation-of-property-types-">
  1327         Animation of property types
  1328       </a></h2>
  1330       <p>
  1331         When interpolating between two values,
  1332         <i>V</i><sub>start</sub> and <i>V</i><sub>end</sub>,
  1333         interpolation is done using the output <i>p</i> of the timing function,
  1334         which gives the portion of the value space
  1335         that the interpolation has crossed.
  1336         Thus the result of the interpolation is
  1337         <i>V</i><sub>res</sub> =
  1338           (1 - <i>p</i>) &sdot; <i>V</i><sub>start</sub> +
  1339           <i>p</i> &sdot; <i>V</i><sub>end</sub>.
  1340       </p>
  1342       <p>
  1343         However, if this value (<i>V</i><sub>res</sub>)
  1344         is outside the allowed range of values for the property,
  1345         then it is clamped to that range.
  1346         This can occur if <i>p</i> is outside of the range 0 to 1,
  1347         which can occur if a timing function is specified
  1348         with a <i>y1</i> or <i>y2</i> that is outside the range 0 to 1.
  1349       </p>
  1351       <p>
  1352         The following describes how each property type undergoes transition or
  1353         animation.
  1354       </p>
  1356       <ul>
  1357         <li id="animtype-color">
  1358           <strong>color</strong>: interpolated via red, green, blue and alpha
  1359           components (treating each as a number, see below).
  1360           The interpolation is done between premultiplied colors
  1361           (that is, colors for which the red, green, and blue components
  1362           specified have been multiplied by the alpha).
  1363         </li>
  1364         <li id="animtype-length">
  1365           <strong>length</strong>: interpolated as real numbers.
  1366         </li>
  1367         <li id="animtype-percentage">
  1368           <strong>percentage</strong>: interpolated as real numbers.
  1369         </li>
  1370         <li id="animtype-lpcalc">
  1371           <strong>length, percentage, or calc</strong>: when both values
  1372           are lengths, interpolated as lengths; when both values are
  1373           percentages, interpolated as percentages; otherwise, both
  1374           values are converted into a ''calc()'' function that is the
  1375           sum of a length and a percentage (each possibly zero), and
  1376           these ''calc()'' functions have each half interpolated as real
  1377           numbers.
  1378         </li>
  1379         <li id="animtype-integer">
  1380           <strong>integer</strong>: interpolated via discrete steps (whole
  1381           numbers). The interpolation happens in real number space and is
  1382           converted to an integer by rounding to the nearest integer, with
  1383           values halfway between a pair of integers rounded towards
  1384           positive infinity.
  1385         </li>
  1386         <li id="animtype-font-weight">
  1387           <strong>font weight</strong>: interpolated via discrete steps
  1388           (multiples of 100). The interpolation happens in real number
  1389           space and is converted to an integer by rounding to the
  1390           nearest multiple of 100, with values halfway between multiples
  1391           of 100 rounded towards positive infinity.
  1392         </li>
  1393         <li id="animtype-number">
  1394           <strong>number</strong>: interpolated as real (floating point)
  1395           numbers.
  1396         </li>
  1397         <li id="animtype-rect">
  1398           <strong>rectangle</strong>: interpolated via the x, y,
  1399           width and height components (treating each as a number).
  1400         </li>
  1401         <li id="animtype-visibility">
  1402           <strong>visibility</strong>: if one of the values is
  1403           ''visible'', interpolated as a discrete step where values of the
  1404           timing function between 0 and 1 map to ''visible'' and other
  1405           values of the timing function (which occur only at the
  1406           start/end of the transition or as a result of ''cubic-bezier()''
  1407           functions with Y values outside of [0, 1]) map to the closer
  1408           endpoint; if neither value is ''visible'' then not interpolable.
  1409         </li>
  1410         <li id="animtype-shadow-list">
  1411           <strong>shadow list</strong>: Each shadow in the list is
  1412           interpolated via the
  1413           color (as <a href="#animtype-color">color</a>) component,
  1414           and x, y, blur, and (when appropriate) spread
  1415           (as <a href="#animtype-length">length</a>) components.
  1416           For each shadow, if one input shadow is ''inset'' and the other
  1417           is not, then the result for that shadow matches the inputs;
  1418           otherwise the entire list is not interpolable.
  1419           If the lists of shadows have different lengths,
  1420           then the shorter list is padded at the end
  1421           with shadows whose color is ''transparent'',
  1422           all lengths are ''0'',
  1423           and whose ''inset'' (or not) matches the longer list.
  1424         </li>
  1425         <li id="animtype-gradient">
  1426           <strong>gradient</strong>: interpolated via the
  1427           positions and colors of each stop. They must have the same type
  1428           (radial or linear) and same number of stops in order to be animated.
  1429           <span class="note">Note: [[CSS3-IMAGES]] may extend this
  1430           definition.</span>
  1431         </li>
  1432         <li id="animtype-paintserver">
  1433           <strong>paint server</strong> (SVG): interpolation is only supported
  1434           between: gradient to gradient and color to color. They then
  1435           work as above.
  1436         </li>
  1437         <li id="animtype-simple-list">
  1438           <strong>simple list</strong> of other types:
  1439           If the lists have the same number of items,
  1440           and each pair of values can be interpolated,
  1441           each item in the list is interpolated using
  1442           the rules given for those types.
  1443           Otherwise the values are not interpolable.
  1444         </li>
  1445         <li id="animtype-repeatable-list">
  1446           <strong>repeatable list</strong> of other types:
  1447           The result list has a length that is the least common multiple
  1448           of the lengths of the input lists.
  1449           Each item in the result is the interpolation of the value
  1450           from each input list repeated to the length of the result list.
  1451           If a pair of values cannot be interpolated, then the lists
  1452           are not interpolable.
  1453           <span class="note">
  1454             The repeatable list concept ensures that a list that is
  1455             conceptually repeated to a certain length (as
  1456             'background-origin' is repeated to the length of the
  1457             'background-image' list) or repeated infinitely will
  1458             smoothly transition between any values, and so that the
  1459             computed value will properly represent the result (and
  1460             potentially be inherited correctly).
  1461           </span>
  1462         </li>
  1463       </ul>
  1465       <p>Future specifications may define additional types that can
  1466       be animated.</p>
  1468       <p>See the definition of 'transition-property' for how animation
  1469       of shorthand properties and the ''all'' value is applied to any
  1470       properties (in the shorthand) that can be animated.</p>
  1472       <h2 id="animatable-properties"><a id="animatable-properties-">
  1473         Animatable properties
  1474       </a></h2>
  1476       <!--
  1477       As resolved in
  1478       http://lists.w3.org/Archives/Public/www-style/2011Sep/0497.html
  1479       -->
  1481       <p>The definition of each CSS property defines
  1482       when the values of that property can be interpolated
  1483       by referring to the definitions of property types
  1484       in the <a href="#animatable-types">previous section</a>.
  1485       Values are animatable when
  1486       both the from and the to values of the property have the type described.
  1487       (When a composite type such as "length, percentage, or calc" is listed,
  1488       this means that both values must fit into that composite type.)
  1489       When multiple types are listed in the form "either A or B",
  1490       both values must be of the same type to be interpolable.</p>
  1492       <p>For properties that exist at the time this specification was
  1493       developed, this specification defines whether and how they are
  1494       animated.  However, future CSS specifications may define
  1495       additional properties, additional values for existing properties,
  1496       or additional animation behavior of existing values.  In order to
  1497       describe new animation behaviors and to have the definition of
  1498       animation behavior in a more appropriate location, future CSS
  1499       specifications should include an "Animatable:" line in the summary
  1500       of the property's definition (in addition to the other lines
  1501       described in [[CSS21]], <a
  1502       href="http://www.w3.org/TR/CSS21/about.html#property-defs">section
  1503       1.4.2</a>).  This line should say "no" to indicate that a property
  1504       cannot be animated or should reference an animation behavior
  1505       (which may be one of the behaviors in the <a
  1506       href="#animation-of-property-types-">Animation of property
  1507       types</a> section above, or may be a new behavior) to define how
  1508       the property animates.  Such definitions override those given in
  1509       this specification.</p>
  1511       <h3 id="animatable-css"><a id="properties-from-css-">
  1512         Properties from CSS
  1513       </a></h3>
  1515       <p>
  1516       The following definitions define the animation behavior for
  1517       properties in CSS Level 2 Revision 1 ([[CSS21]]) and in Level 3 of
  1518       the CSS Color Module ([[CSS3COLOR]]).
  1519       </p>
  1521      <table class="animatable-properties">
  1522        <tr>
  1523          <th>Property Name</th>
  1524          <th>Type</th>
  1525        </tr>
  1526        <tr>
  1527          <td>background-color</td><td>as <a href="#animtype-color">color</a></tr>
  1528        <tr>
  1529          <td>background-position</td><td>as <a href="#animtype-repeatable-list">repeatable list</a> of <a href="#animtype-simple-list">simple list</a> of <a href="#animtype-lpcalc">length, percentage, or calc</a></td>
  1530        </tr>
  1531        <tr>
  1532          <td>border-bottom-color</td><td>as <a href="#animtype-color">color</a></td>
  1533        </tr>
  1534        <tr>
  1535          <td>border-bottom-width</td><td>as <a href="#animtype-length">length</a></td>
  1536        </tr>
  1537        <tr>
  1538          <td>border-left-color</td><td>as <a href="#animtype-color">color</a></td>
  1539        </tr>
  1540        <tr>
  1541          <td>border-left-width</td><td>as <a href="#animtype-length">length</a></td>
  1542        </tr>
  1543        <tr>
  1544          <td>border-right-color</td><td>as <a href="#animtype-color">color</a></td>
  1545        </tr>
  1546        <tr>
  1547          <td>border-right-width</td><td>as <a href="#animtype-length">length</a></td>
  1548        </tr>
  1549        <tr>
  1550          <td>border-spacing</td><td>as <a href="#animtype-simple-list">simple list</a> of <a href="#animtype-length">length</a></td>
  1551        </tr>
  1552        <tr>
  1553          <td>border-top-color</td><td>as <a href="#animtype-color">color</a></td>
  1554        </tr>
  1555        <tr>
  1556          <td>border-top-width</td><td>as <a href="#animtype-length">length</a></td>
  1557        </tr>
  1558        <tr>
  1559          <td>bottom</td><td>as <a href="#animtype-lpcalc">length, percentage, or calc</a></td>
  1560        </tr>
  1561        <tr>
  1562          <td>clip</td><td>as <a href="#animtype-rect">rectangle</a></td>
  1563        </tr>
  1564        <tr>
  1565          <td>color</td><td>as <a href="#animtype-color">color</a></td>
  1566        </tr>
  1567        <tr>
  1568          <td>font-size</td><td>as <a href="#animtype-length">length</a></td>
  1569        </tr>
  1570        <tr>
  1571          <td>font-weight</td><td>as <a href="#animtype-font-weight">font weight</a></td>
  1572        </tr>
  1573        <tr>
  1574          <td>height</td><td>as <a href="#animtype-lpcalc">length, percentage, or calc</a></td>
  1575        </tr>
  1576        <tr>
  1577          <td>left</td><td>as <a href="#animtype-lpcalc">length, percentage, or calc</a></td>
  1578        </tr>
  1579        <tr>
  1580          <td>letter-spacing</td><td>as <a href="#animtype-length">length</a></td>
  1581        </tr>
  1582        <tr>
  1583          <td>line-height</td><td>as either <a href="#animtype-number">number</a> or <a href="#animtype-length">length</a></td>
  1584        </tr>
  1585        <tr>
  1586          <td>margin-bottom</td><td>as <a href="#animtype-length">length</a></td>
  1587        </tr>
  1588        <tr>
  1589          <td>margin-left</td><td>as <a href="#animtype-length">length</a></td>
  1590        </tr>
  1591        <tr>
  1592          <td>margin-right</td><td>as <a href="#animtype-length">length</a></td>
  1593        </tr>
  1594        <tr>
  1595          <td>margin-top</td><td>as <a href="#animtype-length">length</a></td>
  1596        </tr>
  1597        <tr>
  1598          <td>max-height</td><td>as <a href="#animtype-lpcalc">length, percentage, or calc</a></td>
  1599        </tr>
  1600        <tr>
  1601          <td>max-width</td><td>as <a href="#animtype-lpcalc">length, percentage, or calc</a></td>
  1602        </tr>
  1603        <tr>
  1604          <td>min-height</td><td>as <a href="#animtype-lpcalc">length, percentage, or calc</a></td>
  1605        </tr>
  1606        <tr>
  1607          <td>min-width</td><td>as <a href="#animtype-lpcalc">length, percentage, or calc</a></td>
  1608        </tr>
  1609        <tr>
  1610          <td>opacity</td><td>as <a href="#animtype-number">number</a></td>
  1611        </tr>
  1612        <tr>
  1613          <td>outline-color</td><td>as <a href="#animtype-color">color</a></td>
  1614        </tr>
  1615        <tr>
  1616          <td>outline-width</td><td>as <a href="#animtype-length">length</a></td>
  1617        </tr>
  1618        <tr>
  1619          <td>padding-bottom</td><td>as <a href="#animtype-length">length</a></td>
  1620        </tr>
  1621        <tr>
  1622          <td>padding-left</td><td>as <a href="#animtype-length">length</a></td>
  1623        </tr>
  1624        <tr>
  1625          <td>padding-right</td><td>as <a href="#animtype-length">length</a></td>
  1626        </tr>
  1627        <tr>
  1628          <td>padding-top</td><td>as <a href="#animtype-length">length</a></td>
  1629        </tr>
  1630        <tr>
  1631          <td>right</td><td>as <a href="#animtype-lpcalc">length, percentage, or calc</a></td>
  1632        </tr>
  1633        <tr>
  1634          <td>text-indent</td><td>as <a href="#animtype-lpcalc">length, percentage, or calc</a></td>
  1635        </tr>
  1636        <tr>
  1637          <td>text-shadow</td><td>as <a href="#animtype-shadow-list">shadow list</a></td>
  1638        </tr>
  1639        <tr>
  1640          <td>top</td><td>as <a href="#animtype-lpcalc">length, percentage, or calc</a></td>
  1641        </tr>
  1642        <tr>
  1643          <td>vertical-align</td><td>as <a href="#animtype-length">length</a></td>
  1644        </tr>
  1645        <tr>
  1646          <td>visibility</td><td>as <a href="#animtype-visibility">visibility</a></td>
  1647        </tr>
  1648        <tr>
  1649          <td>width</td><td>as <a href="#animtype-lpcalc">length, percentage, or calc</a></td>
  1650        </tr>
  1651        <tr>
  1652          <td>word-spacing</td><td>as <a href="#animtype-length">length</a></td>
  1653        </tr>
  1654        <tr>
  1655          <td>z-index</td><td>as <a href="#animtype-integer">integer</a></td>
  1656        </tr>
  1657      </table>
  1659      <h3 id="animatable-svg"><a id="properties-from-svg-">
  1660        Properties from SVG
  1661      </a></h3>
  1663      <p>
  1664        All properties defined as animatable in the SVG specification, provided
  1665        they are one of the property types listed above.
  1666       </p>
  1668      <!-- <table>
  1669        <tr>
  1670          <th>Property Name</th><th>Type</th>
  1671        </tr>
  1672        <tr>
  1673          <td>stop-color</td><td>as <a href="#animtype-color">color</a></td>
  1674        </tr>
  1675        <tr>
  1676          <td>stop-opacity</td><td>as <a href="#animtype-number">number</a></td>
  1677        </tr>
  1678        <tr>
  1679          <td>fill</td><td>as <a href="#animtype-paintserver">paint server</a></td>
  1680        </tr>
  1681        <tr>
  1682          <td>fill-opacity</td><td>as <a href="#animtype-number">number</a></td>
  1683        </tr>
  1684        <tr>
  1685          <td>stroke</td><td>as <a href="#animtype-paintserver">paint server</a></td>
  1686        </tr>
  1687        <tr>
  1688          <td>stroke-dasharray</td><td>as <a href="#animtype-repeatable-list">repeatable list</a> of <a href="#animtype-number">number</a></td>
  1689        </tr>
  1690        <tr>
  1691          <td>stroke-dashoffset</td><td>as <a href="#animtype-number">number</a></td>
  1692        </tr>
  1693        <tr>
  1694          <td>stroke-miterlimit</td><td>as <a href="#animtype-number">number</a></td>
  1695        </tr>
  1696        <tr>
  1697          <td>stroke-opacity</td><td>as <a href="#animtype-number">number</a></td>
  1698        </tr>
  1699        <tr>
  1700          <td>stroke-width</td><td>as <a href="#animtype-number">number</a></td>
  1701        </tr>
  1702        <tr>
  1703          <td>viewport-fill</td><td>as <a href="#animtype-color">color</a></td>
  1704        </tr>
  1705        <tr>
  1706          <td>viewport-fill-opacity</td><td>as <a href="#animtype-color">color</a></td>
  1707        </tr>
  1708       </table> -->
  1710 <h2 id="changes">Changes since Working Draft of 12 February 2013</h2>
  1712 <p>The following are the substantive changes made since the
  1713 <a href="http://www.w3.org/TR/2013/WD-css3-transitions-20130212/">Working Draft
  1714 dated 12 February 2013</a>:</p>
  1716 <ul>
  1717   <li>Fixed missed substitution (<span>TransitionEventInit</span> rather than AnimationEventInit) when copying event IDL from css3-animations.
  1718   <li>Make naming of event constructor dictionary parameters more consistent with DOM-Level-3-Events.
  1719   <li>Make the behavior of simultaneous changes of 'transition-*' properties and transitionable properties even clearer.
  1720   <li>Computed Value line for shorthands should say "see individual properties".
  1721   <li>Define initial values of event properties,  using initializers in <span>TransitionEventInit</span>.
  1722   <li>Define the model for starting of transitions and their interaction with other animations more precisely:
  1723     <ul>
  1724       <li>Define the <span>before-change style</span> and <span>after-change style</span> used for the style comparison, using the new concept of a <span>style change event</span>.
  1725       <li>Define that a CSS transition for a property does not affect computed style when a CSS Animation for the same property is running, but that the transition is still running in terms of APIs.
  1726       <li>Add a note pointing out that the above definitions imply that transitions can start simultaneously, from the same change, on ancestors and descendants.
  1727       <li>Define that CSS transitions participate in CSS's cascading and inheritance model
  1728     </ul>
  1729 </ul>
  1731 <p>For more details on these changes, see the version control change logs, which are split in two parts because of a file renaming: <a href="https://dvcs.w3.org/hg/csswg/log/tip/css-transitions/Overview.src.html">change log since 2013 March 28</a>, <a href="https://dvcs.w3.org/hg/csswg/log/tip/css3-transitions/Overview.src.html">change log before 2013 March 28</a>.
  1733 <p>For changes in previous working drafts, see
  1734 <a href="http://www.w3.org/TR/2013/WD-css3-transitions-20130212/ChangeLog">the ChangeLog</a>, and the above version control logs.</p>
  1736 <h2 id="acknowledgments">Acknowledgments</h2>
  1738 <p>Thanks especially to the feedback from
  1739 Tab Atkins,
  1740 Carine Bournez,
  1741 Aryeh Gregor,
  1742 Vincent Hardy,
  1743 Anne van Kesteren,
  1744 Cameron McCormack,
  1745 Alex Mogilevsky,
  1746 and all the rest of the
  1747 <a href="http://lists.w3.org/Archives/Public/www-style/">www-style</a> community.</p>
  1749 <h2 id="references">References</h2>
  1751 <h3 class="no-num" id="normative-references">Normative references</h3>
  1752 <!--normative-->
  1754 <h3 class="no-num" id="other-references">Other references</h3>
  1755 <!--informative-->
  1759 <h2 class="no-num" id="property-index">Property index</h2>
  1760 <!-- properties -->
  1764 <h2 class="no-num" id="index">Index</h2>
  1765 <!--index-->
  1767 </body>
  1768 </html>
  1769 <!-- Keep this comment at the end of the file
  1770 Local variables:
  1771 mode: sgml
  1772 sgml-default-doctype-name:"html"
  1773 sgml-minimize-attributes:t
  1774 End:
  1775 -->

mercurial