Skip to content

Commit 3df558c

Browse files
committed
[css-animations-2] Tweaks to generalized animation event dispatch
* Mention skipping events while pending * Add events when going from idle -> after * Remove dependency on animation playback rate for initial events' elapsedTime * Order events to make them easier to follow
1 parent f7e2be1 commit 3df558c

File tree

1 file changed

+37
-41
lines changed

1 file changed

+37
-41
lines changed

css-animations-2/Overview.bs

Lines changed: 37 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ urlPrefix: https://w3c.github.io/web-animations/; type: dfn; spec: web-animation
7777
text: iteration duration
7878
text: iteration start
7979
text: pause an animation
80+
text: pending play state
8081
text: play an animation
8182
text: sampling
8283
text: start delay
@@ -419,9 +420,9 @@ definitions are used:
419420
<code>max(min(<a>target effect end</a> - <a>start delay</a>,
420421
<a>active duration</a>), 0)</code>
421422
422-
Each time an animation is <a lt="sampling">sampled</a>, the events to
423-
dispatch are determined by comparing the animation's phase before and
424-
after the sample as follows:
423+
Each time an animation is <a lt="sampling">sampled</a> and is <em>not</em> <a
424+
lt="pending play state">pending</a>, the events to dispatch are determined by
425+
comparing the animation's phase before and after the sample as follows:
425426
426427
<table class="event-state-transitions">
427428
<thead>
@@ -433,60 +434,32 @@ after the sample as follows:
433434
</thead>
434435
<tbody>
435436
<tr>
436-
<td><a lt="idle phase">idle</a> &rarr;
437+
<td><a lt="idle phase">idle</a> or <a lt="before phase">before</a> &rarr;
437438
<a lt="active phase">active</a></td>
438439
<td><a idl>animationstart</a></td>
439-
<td>If the <a>animation playback rate</a> is &ge; 0,
440-
use the <a>interval start</a>, otherwise use the
441-
<a>interval end</a>.
440+
<td><a>interval start</a>
442441
</td>
443442
</tr>
444443
<tr>
445-
<td><a lt="before phase">before</a> &rarr;
446-
<a lt="active phase">active</a></td>
447-
<td><a idl>animationstart</a></td>
448-
<td><a>interval start</a></td>
449-
</tr>
450-
<tr>
451-
<td><a lt="after phase">after</a> &rarr;
452-
<a lt="active phase">active</a></td>
453-
<td><a idl>animationstart</a></td>
454-
<td><a>interval end</a></td>
455-
</tr>
456-
<tr>
457-
<td rowspan="2"><a lt="before phase">before</a> &rarr;
458-
<a lt="after phase">after</a> <a
459-
href="#multiple-events-note">&#x66d;</a></td>
460-
<td><a idl>animationstart</a></td>
461-
<td><a>interval start</a></td>
462-
</tr>
463-
<tr>
464-
<td><a idl>animationend</a></td>
465-
<td><a>interval end</a></td>
466-
</tr>
467-
<tr>
468-
<td rowspan="2"><a lt="after phase">after</a> &rarr;
469-
<a lt="before phase">before</a> <a
470-
href="#multiple-events-note">&#x66d;</a></td>
444+
<td rowspan="2">
445+
<a lt="idle phase">idle</a> or <a lt="before phase">before</a> &rarr;
446+
<a lt="after phase">after</a> <a
447+
href="#multiple-events-note">&#x66d;</a></td>
471448
<td><a idl>animationstart</a></td>
472-
<td><a>interval end</a></td>
449+
<td><a>interval start</a>
450+
</td>
473451
</tr>
474452
<tr>
475453
<td><a idl>animationend</a></td>
476-
<td><a>interval start</a></td>
454+
<td><a>interval end</a>
455+
</td>
477456
</tr>
478457
<tr>
479458
<td><a lt="active phase">active</a> &rarr;
480459
<a lt="before phase">before</a></td>
481460
<td><a idl>animationend</a></td>
482461
<td><a>interval start</a></td>
483462
</tr>
484-
<tr>
485-
<td><a lt="active phase">active</a> &rarr;
486-
<a lt="after phase">after</a></td>
487-
<td><a idl>animationend</a></td>
488-
<td><a>interval end</a></td>
489-
</tr>
490463
<tr>
491464
<td><a lt="active phase">active</a> &rarr;
492465
<a lt="active phase">active</a>
@@ -498,6 +471,29 @@ after the sample as follows:
498471
<td>(See below)
499472
<a href="#animation-iteration-elapsed-time">&dagger;</a></td>
500473
</tr>
474+
<tr>
475+
<td><a lt="active phase">active</a> &rarr;
476+
<a lt="after phase">after</a></td>
477+
<td><a idl>animationend</a></td>
478+
<td><a>interval end</a></td>
479+
</tr>
480+
<tr>
481+
<td><a lt="after phase">after</a> &rarr;
482+
<a lt="active phase">active</a></td>
483+
<td><a idl>animationstart</a></td>
484+
<td><a>interval end</a></td>
485+
</tr>
486+
<tr>
487+
<td rowspan="2"><a lt="after phase">after</a> &rarr;
488+
<a lt="before phase">before</a> <a
489+
href="#multiple-events-note">&#x66d;</a></td>
490+
<td><a idl>animationstart</a></td>
491+
<td><a>interval end</a></td>
492+
</tr>
493+
<tr>
494+
<td><a idl>animationend</a></td>
495+
<td><a>interval start</a></td>
496+
</tr>
501497
<tr>
502498
<td>Not <a lt="idle phase">idle</a> &rarr;
503499
<a lt="idle phase">idle</a></td>

0 commit comments

Comments
 (0)