@@ -621,13 +621,6 @@ purpose of synchronization.
621
621
At any given moment, a [=timeline=] has a single current [=time value=] known
622
622
simply as the timeline's <dfn lt="timeline current time">current time</dfn> .
623
623
624
- A <a>timeline</a> may not always be able to return a meaningful <a>time
625
- value</a> , but only an <a>unresolved</a> time value. For example, it may
626
- be defined relative to a moment that has yet to occur, such as the firing of
627
- a document's load event.
628
- A <a>timeline</a> is considered to be <dfn lt="inactive timeline">inactive</dfn>
629
- when its <a>time value</a> is <a>unresolved</a> .
630
-
631
624
A <a>timeline</a> is <dfn export lt="monotonically increasing timeline"
632
625
local-lt="monotonically increasing"> monotonically increasing</dfn> if its
633
626
reported [=timeline current time|current time=] is always greater than or equal
@@ -708,6 +701,22 @@ animation model to change, but these operations in themselves do not create
708
701
a new [=animation frame=] , rather they merely update the current <a>animation
709
702
frame</a> .
710
703
704
+ ### Timeline Phase ### {#timeline-phases}
705
+
706
+ A [=timeline=] may be in one of four possible
707
+ <dfn export lt="timeline phase">phases</dfn> :
708
+
709
+ 1. <dfn export lt="timeline inactive phase">inactive</dfn>
710
+ 1. <dfn export lt="timeline before phase">before</dfn>
711
+ 1. <dfn export lt="timeline active phase">active</dfn>
712
+ 1. <dfn export lt="timeline after phase">after</dfn>
713
+
714
+ A [=timeline=] in the [=timeline inactive phase|inactive phase=] can
715
+ also be called an <dfn>inactive timeline</dfn>
716
+
717
+ An [=inactive timeline=] has an [=unresolved=]
718
+ [=timeline current time|current time=] .
719
+
711
720
### Document timelines ### {#document-timelines}
712
721
713
722
A <dfn>document timeline</dfn> is a type of <a>timeline</a> that is <a
@@ -721,16 +730,24 @@ time</dfn>.
721
730
Issue(2079): There must be a better term than “origin time”—
722
731
it's too similar to “time origin”.
723
732
724
- Prior to establishing the [=time origin=] for its associated document,
725
- a [=document timeline=] is <a lt="inactive timeline">inactive</a> .
733
+
734
+ The [=timeline phase|phase=] of a <a>document timeline</a> at a given moment is
735
+ the [=timeline phase|phase=] corresponding to the <em> first</em> matching
736
+ condition from the following:
737
+
738
+ <div class="switch">
739
+
740
+ : If the associated document is not an [=active document=] or its
741
+ [=time origin=] has not yet been established
742
+ :: → [=timeline inactive phase|inactive=]
743
+ : Otherwise,
744
+ :: → [=timeline active phase|active=]
745
+
746
+ </div>
726
747
727
748
After a [=document timeline=] becomes [=inactive timeline|active=] , it is
728
749
[=monotonically increasing=] .
729
750
730
- A <a>document timeline</a> that is associated with a {{Document}} which is not
731
- an <a>active document</a> is also considered to be
732
- <a lt="inactive timeline">inactive</a> .
733
-
734
751
To <a lt="timeline time to origin-relative time">convert a timeline
735
752
time, |timeline time|, to an origin-relative time</a> for a document timeline,
736
753
|timeline|, return the sum of the |timeline time| and |timeline|'s [=origin
@@ -796,7 +813,7 @@ An animation's start time is initially <a>unresolved</a>.
796
813
797
814
An <a>animation</a> also maintains a <dfn>hold time</dfn> <a>time value</a>
798
815
which is used to fix the animation's output <a>time value</a> , called its
799
- <a>current time</a> , in circumstances such as pausing</a> .
816
+ <a>current time</a> , in circumstances such as pausing.
800
817
The <a>hold time</a> is initially <a>unresolved</a> .
801
818
802
819
In order to establish the relative ordering of conflicting <a>animations</a> ,
@@ -3989,6 +4006,7 @@ The <code>AnimationTimeline</code> interface {#the-animationtimeline-interface}
3989
4006
[Exposed=Window]
3990
4007
interface AnimationTimeline {
3991
4008
readonly attribute double? currentTime;
4009
+ readonly attribute TimelinePhase phase;
3992
4010
};
3993
4011
</pre>
3994
4012
@@ -3998,6 +4016,8 @@ interface AnimationTimeline {
3998
4016
:: Returns the <a lt="timeline current time">current time</a> for this timeline
3999
4017
or <code> null</code> if this timeline is <a lt="inactive
4000
4018
timeline">inactive</a> .
4019
+ : <dfn attribute for=AnimationTimeline>phase</dfn>
4020
+ :: Returns the <a lt="timeline phase">phase</a> for this timeline.
4001
4021
4002
4022
</div>
4003
4023
@@ -4365,6 +4385,21 @@ enum AnimationReplaceState { "active", "removed", "persisted" };
4365
4385
: <code> persisted</code>
4366
4386
:: Corresponds to the [=persisted replace state=] .
4367
4387
4388
+ ### The <code> TimelinePhase</code> enumeration ### {#the-timelinephase-enumeration}
4389
+
4390
+ <pre class='idl'>
4391
+ enum TimelinePhase { "inactive", "before", "active", "after" };
4392
+ </pre>
4393
+
4394
+ : <code> inactive</code>
4395
+ :: Corresponds to the [=timeline inactive phase=] .
4396
+ : <code> before</code>
4397
+ :: Corresponds to the [=timeline before phase=] .
4398
+ : <code> active</code>
4399
+ :: Corresponds to the [=timeline active phase=] .
4400
+ : <code> after</code>
4401
+ :: Corresponds to the [=timeline after phase=] .
4402
+
4368
4403
The <code> AnimationEffect</code> interface {#the-animationeffect-interface}
4369
4404
----------------------------------------
4370
4405
0 commit comments