diff --git a/scroll-animations-1/Overview.bs b/scroll-animations-1/Overview.bs index 4d3108da8690..466d8bb0e3b1 100644 --- a/scroll-animations-1/Overview.bs +++ b/scroll-animations-1/Overview.bs @@ -1328,42 +1328,58 @@ spec: cssom-view-1; type: dfn; by the {{AnimationTimeline/getCurrentTime()}} method:
+		dictionary AnimationTimeOptions {
+		  DOMString? range;
+		};
+
 		[Exposed=Window]
 		partial interface AnimationTimeline {
-		  CSSNumericValue? getCurrentTime(optional CSSOMString rangeName);
+		  CSSNumericValue? getCurrentTime(optional AnimationTimeOptions options = {});
 		};
 	
-
- The getCurrentTime(optional |rangeName|) [=method steps=] are: - - 1. If [=this=] is an [=inactive timeline=], - return null. - - 1. If |rangeName| is provided: - - 1. If |rangeName| is a valid [=named timeline range=] on [=this=], - let |progress| be the current progress through that range, - expressed as a percentage value. - - Create a [=new unit value=] from (|progress|, "percent") - and return it. +
- If the start and end points of the [=named timeline range=] coincide, - return negative infinity for time values before it, - positive infinity for time values after it, - and zero for time values coinciding with that point. - - 2. Otherwise, return null. - - 2. Let |current time| - be the value of [=this's=] {{AnimationTimeline/currentTime}} internal slot. +
CSSNumericValue? getCurrentTime(optional AnimationCurrentTimeOptions = {}) +
+ Returns a representation of the [=timeline/current time=] + as follows: + +
+
If {{AnimationTimeOptions/range}} is not provided: +
+ Returns the value of {{AnimationTimeline/currentTime}} on [=this=], + but representing millisecond values + as a new {{CSSUnitValue}} in ''ms'' units + rather than as a double. + +
If {{AnimationTimeOptions/range}} is provided + and is a valid [=named timeline range=] on [=this=]: +
+ Let |progress| be the current progress through that range, + expressed as a percentage value. + + Create a [=new unit value=] from (|progress|, "percent") + and return it. + + If the start and end points of the [=named timeline range=] coincide, + return negative infinity for time values before it, + positive infinity for time values after it, + and zero for time values coinciding with that point. + +
+ If {{AnimationTimeOptions/range}} is provided + but is not a valid [=named timeline range=] on [=this=]: +
+ Returns null. +
+
- If [=this=] is a {{ScrollTimeline}}, - create a [=new unit value=] from (|current time|, "percent") - and return it. + ISSUE(8201): This method is related to {{AnimationTimeline/currentTime}} + but not quite the same; should it have a different name? - Otherwise, - create a [=new unit value=] from (|current time|, "ms") - and return it. -
+ ISSUE: This method returns percentages relative to a ScrollTimeline’s range + when a range name is provided. + But for time-based timelines, if a range name is provided, + should it return percentage progress through that range, + or time progress through that range?