css-transitions/Overview.src.html

Tue, 19 Nov 2013 15:35:38 +0800

author
L. David Baron <dbaron@dbaron.org>
date
Tue, 19 Nov 2013 15:35:38 +0800
changeset 9623
b8e4691d68cc
parent 9585
31902c18f45d
child 9716
e95ed343922d
permissions
-rw-r--r--

[css-transitions] Better section title for reversing section.

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

mercurial