@@ -901,9 +901,8 @@ Attributes</h4>
901901 <dt> <dfn>elapsedTime</dfn> , of type float, readonly
902902 <dd>
903903 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.
907906 <dt> <dfn>pseudoElement</dfn> , of type <a interface>DOMString</a> , readonly
908907 <dd>
909908 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>
924923 <dd>
925924 The <a idl>animationstart</a> event occurs at the start of the animation.
926925 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>
930935 <ul>
931936 <li> Bubbles: Yes</li>
932937 <li> Cancelable: No</li>
@@ -936,6 +941,8 @@ Types of <code>AnimationEvent</code></h3>
936941 <dt> <dfn>animationend</dfn>
937942 <dd>
938943 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> .
939946 <ul>
940947 <li> Bubbles: Yes</li>
941948 <li> Cancelable: No</li>
@@ -948,6 +955,37 @@ Types of <code>AnimationEvent</code></h3>
948955 animation, except when an animationend event would fire at the same time.
949956 This means that this event does not occur for animations with an iteration
950957 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+
951989 <ul>
952990 <li> Bubbles: Yes</li>
953991 <li> Cancelable: No</li>
@@ -983,6 +1021,10 @@ objects, as <a>event handler IDL attributes</a>:
9831021 <td> <dfn>onanimationend</dfn> </td>
9841022 <td> <dfn><a idl>animationend</a></dfn> </td>
9851023 </tr>
1024+ <tr>
1025+ <td> <dfn>onanimationcancel</dfn> </td>
1026+ <td> <dfn><a idl>animationcancel</a></dfn> </td>
1027+ </tr>
9861028</table>
9871029
9881030<h2 id="interface-dom">
@@ -1228,6 +1270,7 @@ partial interface GlobalEventHandlers {
12281270 attribute EventHandler onanimationstart;
12291271 attribute EventHandler onanimationiteration;
12301272 attribute EventHandler onanimationend;
1273+ attribute EventHandler onanimationcancel;
12311274};
12321275</pre>
12331276
0 commit comments