Skip to content

Commit 4afadca

Browse files
fantasaitabatkins
andcommitted
[scroll-animations-1] Rewrite to proper algorithmic form
Co-authored-by: Tab Atkins Jr. <jackalmage@gmail.com>
1 parent 2152a23 commit 4afadca

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

scroll-animations-1/Overview.bs

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -783,18 +783,26 @@ spec: cssom-view-1; type: dfn;
783783
};
784784
</pre>
785785

786-
<dl class=methods dfn-type=method dfn-for="AnimationTimeline">
787-
<dt><dfn>getCurrentTime(rangeName)</dfn>
788-
<dd>
789-
If a rangeName is provided,
790-
and is a valid [=named timeline range=] on this {{AnimationTimeline}},
791-
returns the percentage progress through that range.
786+
<div algorithm="AnimationTimeline.getCurrentTime()">
787+
The <code><dfn method for=AnimationTimeline>getCurrentTime(optional |rangeName|)</dfn></code> [=method steps=] are:
792788

793-
If a rangeName is provided,
794-
and is not a valid [=named timeline range=] on this {{AnimationTimeline}},
795-
returns null.
789+
1. If [=this=] is an [=inactive timeline=],
790+
return [=null=].
796791

797-
If a rangeName is not provided,
798-
returns {{AnimationTimeline/currentTime}},
799-
representing any time-based value using milliseconds (''ms'').
800-
</dl>
792+
1. If |rangeName| is provided:
793+
794+
1. If |rangeName| is a valid [=named timeline range=] on [=this=],
795+
let |progress| be the current progress through that range,
796+
expressed as a percentage value between 0 and 100.
797+
798+
Create a [=new unit value=] from (|progress|, "percent")
799+
and return it.
800+
801+
2. Otherwise, return [=null=].
802+
803+
2. Let |current time|
804+
be the value of [=this's=] {{AnimationTimeline/currentTime}} internal slot.
805+
806+
Create a [=new unit value=] from (|current time|, "ms")
807+
and return it.
808+
</div>

0 commit comments

Comments
 (0)