@@ -621,13 +621,6 @@ purpose of synchronization.
621621At any given moment, a [=timeline=] has a single current [=time value=] known
622622simply as the timeline's <dfn lt="timeline current time">current time</dfn> .
623623
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-
631624A <a>timeline</a> is <dfn export lt="monotonically increasing timeline"
632625local-lt="monotonically increasing"> monotonically increasing</dfn> if its
633626reported [=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
708701a new [=animation frame=] , rather they merely update the current <a>animation
709702frame</a> .
710703
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+
711720### Document timelines ### {#document-timelines}
712721
713722A <dfn>document timeline</dfn> is a type of <a>timeline</a> that is <a
@@ -721,16 +730,24 @@ time</dfn>.
721730Issue(2079): There must be a better term than “origin time”—
722731 it's too similar to “time origin”.
723732
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>
726747
727748After a [=document timeline=] becomes [=inactive timeline|active=] , it is
728749[=monotonically increasing=] .
729750
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-
734751To <a lt="timeline time to origin-relative time">convert a timeline
735752time, |timeline time|, to an origin-relative time</a> for a document timeline,
736753|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>.
796813
797814An <a>animation</a> also maintains a <dfn>hold time</dfn> <a>time value</a>
798815which 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.
800817The <a>hold time</a> is initially <a>unresolved</a> .
801818
802819In order to establish the relative ordering of conflicting <a>animations</a> ,
@@ -3989,6 +4006,7 @@ The <code>AnimationTimeline</code> interface {#the-animationtimeline-interface}
39894006[Exposed=Window]
39904007interface AnimationTimeline {
39914008 readonly attribute double? currentTime;
4009+ readonly attribute TimelinePhase phase;
39924010};
39934011</pre>
39944012
@@ -3998,6 +4016,8 @@ interface AnimationTimeline {
39984016:: Returns the <a lt="timeline current time">current time</a> for this timeline
39994017 or <code> null</code> if this timeline is <a lt="inactive
40004018 timeline">inactive</a> .
4019+ : <dfn attribute for=AnimationTimeline>phase</dfn>
4020+ :: Returns the <a lt="timeline phase">phase</a> for this timeline.
40014021
40024022</div>
40034023
@@ -4365,6 +4385,21 @@ enum AnimationReplaceState { "active", "removed", "persisted" };
43654385: <code> persisted</code>
43664386:: Corresponds to the [=persisted replace state=] .
43674387
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+
43684403The <code> AnimationEffect</code> interface {#the-animationeffect-interface}
43694404----------------------------------------
43704405
0 commit comments