Skip to content

[web-animations-2][scroll-animations-1]Update timeline currentTime #6742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scroll-animations-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ A <dfn>scroll timeline</dfn> is an {{AnimationTimeline}} whose time values are
determined not by wall-clock time, but by the progress of scrolling in a
[=scroll container=].

The {{EffectTiming/duration}} of a <a>scroll timeline</a> is 100%.
The {{AnimationTimeline/duration}} of a <a>scroll timeline</a> is 100%.

<dl class="constructors">
: <dfn constructor for=ScrollTimeline lt="ScrollTimeline(options)">ScrollTimeline(options)</dfn>
Expand Down Expand Up @@ -838,12 +838,12 @@ The [=timeline/current time=] of a {{ScrollTimeline}} is calculated as follows:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

web-animations-2 wasn't in the linking database; fixed now

Copy link
Contributor Author

@kevers-google kevers-google Nov 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed reference on line 361.

: If |current scroll offset| is greater than or equal to [=effective
end offset=]:
:: The [=timeline/current time=] is the {{EffectTiming/duration}}.
:: The [=timeline/current time=] is the {{AnimationTimeline/duration}}.

: Otherwise,
:: 1. Let |progress| be a result of applying
[=calculate scroll timeline progress=] procedure for <var>current scroll offset</var>.
1. The [=timeline/current time=] is <code>|progress| &times; {{EffectTiming/duration}}</code>
1. The [=timeline/current time=] is <code>|progress| &times; {{AnimationTimeline/duration}}</code>
</dl>

Note: To be considered active a scroll timeline requires its [=effective scroll
Expand Down
10 changes: 10 additions & 0 deletions web-animations-2/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2182,13 +2182,23 @@ Items sorted earlier are executed before those sorted later.
<pre class="idl">
[Exposed=Window]
partial interface AnimationTimeline {
readonly attribute CSSNumberish? currentTime;
readonly attribute CSSNumberish? duration;
Animation play (optional AnimationEffect? effect = null);
};
</pre>

<div class='attributes'>

Update the attribute type for currentTime.

: <dfn attribute for=AnimationTimeline>currentTime</dfn>
:: Returns the <a lt="timeline current time">current time</a> for this
timeline or <code>null</code> if this timeline is
<a lt="inactive timeline">inactive</a>. The value is expressed as a
percentage for a [=progress-based timeline=], or as a double in
milliseconds otherwise.

: <dfn attribute for=AnimationTimeline>duration</dfn>
:: Returns the <a lt="timeline duration">duration</a> for this timeline.

Expand Down