Skip to content

[web-animations-2] Change progress to overallProgress #11184

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

Merged
merged 1 commit into from
Nov 18, 2024
Merged
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
26 changes: 13 additions & 13 deletions web-animations-2/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -969,35 +969,35 @@ Add the following sentence:

</div>

### Calculating the progress of an animation ### {#the-progress-of-an-animation}
### Calculating the overall progress of an animation ### {#the-overall-progress-of-an-animation}

An animation's <dfn export for=animation>progress</dfn> is the ratio of its
An animation's <dfn export for=animation>overallProgress</dfn> is the ratio of its
[=animation/current time=] to its [=associated effect end=].

<div algorithm="calculate animation progress">
The [=animation/progress=] of an [=animation=], |animation|, is calculated as follows:
<div algorithm="calculate animation overall progress">
The [=animation/overallProgress=] of an [=animation=], |animation|, is calculated as follows:

<dl class=switch>

: If <em>any</em> of the following are true:
* |animation| does not have an [=animation/associated effect=], or
* |animation|'s [=animation/current time=] is an [=unresolved=] time value,
::
|animation|'s [=animation/progress=] is null.
|animation|'s [=animation/overallProgress=] is null.
: If |animation|'s [=associated effect end=] is zero,
::
: If |animation|'s [=animation/current time=] is negative,
:: |animation|'s [=animation/progress=] is zero.
:: |animation|'s [=animation/overallProgress=] is zero.

: Otherwise,
:: |animation|'s [=animation/progress=] is one.
:: |animation|'s [=animation/overallProgress=] is one.
: If |animation|'s [=associated effect end=] is infinite,
::
|animation|'s [=animation/progress=] is zero.
|animation|'s [=animation/overallProgress=] is zero.
: Otherwise,
::
<blockquote>
<code><a for="animation">progress</a> = min(max([=animation/current time=] / |animation|'s [=associated effect end=], 0), 1)
<code><a for="animation">overallProgress</a> = min(max([=animation/current time=] / |animation|'s [=associated effect end=], 0), 1)
</code>
</blockquote>

Expand Down Expand Up @@ -2425,7 +2425,7 @@ Update the attribute type for currentTime.
<h3 id="the-animation-interface">The <code>Animation</code> interface</h3>

Update the startTime and currentTime of the Animation interface, and add
rangeStart, rangeEnd, and progress as follows:
rangeStart, rangeEnd, and overallProgress as follows:

<pre class="idl">
[Exposed=Window]
Expand All @@ -2434,7 +2434,7 @@ partial interface Animation {
attribute CSSNumberish? currentTime;
attribute (TimelineRangeOffset or CSSNumericValue or CSSKeywordValue or DOMString) rangeStart;
attribute (TimelineRangeOffset or CSSNumericValue or CSSKeywordValue or DOMString) rangeEnd;
readonly attribute double? progress;
readonly attribute double? overallProgress;
};
</pre>

Expand Down Expand Up @@ -2480,8 +2480,8 @@ Add:
> When reading the attribute, the returned value is either a
> {{TimelineRangeOffset}} or the {{DOMString}} "normal".
>
> : <dfn attribute for=Animation>progress</dfn>
> :: Specifies the [=animation/progress=] of the <a>animation</a> as a proportion of its
> : <dfn attribute for=Animation>overallProgress</dfn>
> :: Specifies the [=animation/overallProgress=] of the <a>animation</a> as a proportion of its
> [=associated effect end=].
</div>

Expand Down