@@ -901,9 +901,8 @@ Attributes</h4>
901
901
<dt> <dfn>elapsedTime</dfn> , of type float, readonly
902
902
<dd>
903
903
The amount of time the animation has been running, in seconds, when this event fired,
904
- excluding any time the animation was paused. For an ''animationstart'' event, the
905
- elapsedTime is zero unless there was a negative value for 'animation-delay' , in which
906
- case the event will be fired with an elapsedTime of (-1 * delay).
904
+ excluding any time the animation was paused. The precise calculation for
905
+ of this member is defined along with each event type.
907
906
<dt> <dfn>pseudoElement</dfn> , of type <a interface>DOMString</a> , readonly
908
907
<dd>
909
908
The name (beginning with two colons) of the CSS pseudo-element on which the animation
@@ -924,9 +923,15 @@ Types of <code>AnimationEvent</code></h3>
924
923
<dd>
925
924
The <a idl>animationstart</a> event occurs at the start of the animation.
926
925
If there is an 'animation-delay' then this event will fire once the delay
927
- period has expired. A negative delay will cause the event to fire with
928
- an elapsedTime equal to the absolute value of the delay; in this case the
929
- event will fire whether 'animation-play-state' is set to ''running'' or ''paused'' .
926
+ period has expired.
927
+ <p>
928
+ A negative delay will cause the event to fire with
929
+ an {{AnimationEvent/elapsedTime}} equal to the absolute value of the delay
930
+ capped to the <a>active duration</a> of the animation, that is,
931
+ <code> min(max(-'animation-delay' , 0), <a>active duration</a> )</code> ; in
932
+ this case the event will fire whether 'animation-play-state' is set to
933
+ ''running'' or ''paused'' .
934
+ </p>
930
935
<ul>
931
936
<li> Bubbles: Yes</li>
932
937
<li> Cancelable: No</li>
@@ -936,6 +941,8 @@ Types of <code>AnimationEvent</code></h3>
936
941
<dt> <dfn>animationend</dfn>
937
942
<dd>
938
943
The <a idl>animationend</a> event occurs when the animation finishes.
944
+ In this case the value of the {{AnimationEvent/elapsedTime}} member of
945
+ the event is equal to the <a>active duration</a> .
939
946
<ul>
940
947
<li> Bubbles: Yes</li>
941
948
<li> Cancelable: No</li>
@@ -948,6 +955,37 @@ Types of <code>AnimationEvent</code></h3>
948
955
animation, except when an animationend event would fire at the same time.
949
956
This means that this event does not occur for animations with an iteration
950
957
count of one or less.
958
+
959
+ <p> The {{AnimationEvent/elapsedTime}} member in this case is equal to the
960
+ product of the <var> current iteration</var> and 'animation-duration' where
961
+ the <var> current iteration</var> is the zero-based index of the new
962
+ iteration. For example, assuming no negative 'animation-delay' , after one
963
+ iteration completes the <var> current iteration</var> would be one.</p>
964
+
965
+ <ul>
966
+ <li> Bubbles: Yes</li>
967
+ <li> Cancelable: No</li>
968
+ <li> Context Info: animationName, elapsedTime, pseudoElement</li>
969
+ </ul>
970
+
971
+ <dt> <dfn>animationcancel</dfn>
972
+ <dd>
973
+ The <a idl>animationcancel</a> event occurs when the animation stops
974
+ running in a way that does not fire an <a idl>animationend</a> event, such
975
+ as a change in the 'animation-name' that removes the animation, or the
976
+ animating element or one of its ancestors becoming ''display:none'' .
977
+
978
+ <p> The {{AnimationEvent/elapsedTime}} member for this event indicates
979
+ the number of seconds that had elapsed since the beginning of the
980
+ animation at the moment when the animation was cancelled.
981
+ This excludes any time where the animation was paused. If the animation
982
+ had a negative 'animation-delay' , the beginning of the animation is the
983
+ moment equal to the absolute value of 'animation-delay' seconds
984
+ <em> prior</em> to when the animation was actually triggered.
985
+ Alternatively, if the animation had a positive 'animation-delay' and the
986
+ event is fired before the animation's delay has expired, the
987
+ {{AnimationEvent/elapsedTime}} will be zero.</p>
988
+
951
989
<ul>
952
990
<li> Bubbles: Yes</li>
953
991
<li> Cancelable: No</li>
@@ -983,6 +1021,10 @@ objects, as <a>event handler IDL attributes</a>:
983
1021
<td> <dfn>onanimationend</dfn> </td>
984
1022
<td> <dfn><a idl>animationend</a></dfn> </td>
985
1023
</tr>
1024
+ <tr>
1025
+ <td> <dfn>onanimationcancel</dfn> </td>
1026
+ <td> <dfn><a idl>animationcancel</a></dfn> </td>
1027
+ </tr>
986
1028
</table>
987
1029
988
1030
<h2 id="interface-dom">
@@ -1228,6 +1270,7 @@ partial interface GlobalEventHandlers {
1228
1270
attribute EventHandler onanimationstart;
1229
1271
attribute EventHandler onanimationiteration;
1230
1272
attribute EventHandler onanimationend;
1273
+ attribute EventHandler onanimationcancel;
1231
1274
};
1232
1275
</pre>
1233
1276
0 commit comments