-
Notifications
You must be signed in to change notification settings - Fork 797
Update procedure for determining if at a progress timeline boundary #13819
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
Open
kevers-google
wants to merge
10
commits into
w3c:main
Choose a base branch
from
kevers-google:at-progress-boundary
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2d27849
Update procedure for determining if at a progress timeline boundary
kevers-google 46fae4f
Address feedback
kevers-google 621ee8d
Link max/min timeline times
kevers-google dc44446
Simplify
kevers-google efb3116
Simplify
kevers-google 6a90b5f
Fix handling of min boundary
kevers-google dd67e84
Tweak
kevers-google e81d48f
Add note
kevers-google ff9a335
Further simplification
kevers-google 0b39f5c
Fix definition
kevers-google File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -210,6 +210,18 @@ Add: | |
| > (e.g. scroll) timeline, the duration has a fixed upper bound. In this | ||
| > case, the timeline is a <dfn lt="progress-based timeline">progress-based | ||
| > timeline</dfn>, and its [=timeline duration=] is 100%. | ||
| > | ||
| > <dfn>minimum timeline time</dfn> | ||
| > | ||
| > For a scroll-timeline, the minimum timeline time is the timeline time | ||
| > associated with the minimum scroll offset. For a time-based timeline, it is | ||
| > -infinity. | ||
| > | ||
| > <dfn>maximum timeline time</dfn> | ||
| > | ||
| > For a scroll-timeline, the maxiumum timeline time is the timeline time | ||
| > associated with the maximum scroll offset, and matches the | ||
| > [=timeline duration=]. For a time-based timeline, it is +infinity. | ||
|
Comment on lines
+222
to
+224
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto about "progress-based" and "monotonic". |
||
|
|
||
| <h3 id="animation-frame-loop">Animation Frames</h3> | ||
|
|
||
|
|
@@ -1232,55 +1244,34 @@ condition: | |
| Add the following definitions to the list used in determining the phase of | ||
| an <a>animation effect</a>. | ||
|
|
||
| : <dfn>at progress timeline boundary</dfn> | ||
| :: Determined using the following procedure: | ||
| : <dfn>at timeline boundary</dfn> | ||
| :: Determined based on the first matching condition: | ||
|
|
||
| 1. If <em>any</em> of the following conditions are true: | ||
| * the associated <a>animation</a>'s timeline is not a | ||
| [=progress-based timeline=], or | ||
| * the associated <a>animation</a>'s [=timeline duration=] is | ||
| unresolved or zero, or | ||
| * the <a>animation</a>'s [=playback rate=] is zero | ||
|
|
||
| return false | ||
|
|
||
| 1. Let <var>effective start time</var> be the <a>animation</a>'s | ||
| [=animation/start time=] if resolved, or zero otherwise. | ||
| <dl class="switch"> | ||
| : If the [=minimum timeline time=] matches the | ||
| [=timeline current time=], and playbackRate = -1: | ||
|
|
||
| 1. Set <var>unlimited current time</var> based on the first matching | ||
| condition: | ||
| :: Return true | ||
|
|
||
| : [=animation/start time=] is resolved: | ||
| : If the [=maximum timeline time=] matches the | ||
| [=timeline current time=], and playbackRate = 1: | ||
|
|
||
| :: <code>(<var>timeline time</var> - [=animation/start time=]) | ||
| × [=playback rate=]</code> | ||
| :: Return true | ||
|
|
||
| : Otherwise | ||
|
|
||
| :: <code>animation's [=animation/current time=]</code> | ||
|
|
||
| 1. Let <var>effective timeline time</var> be | ||
| <code>|unlimited current time| / <a>animation</a>'s | ||
| [=playback rate=] + |effective start time|</code> | ||
|
|
||
| 1. Let <var>effective timeline progress</var> be | ||
| <code><var>effective timeline time</var> / [=timeline duration=]</code> | ||
|
|
||
| 1. If <var>effective timeline progress</var> is 0 or 1, return true, | ||
| otherwise false. | ||
|
|
||
| Issue: This procedure is not strictly correct for a paused | ||
| animation if the <a>animation</a>'s current time is explicitly set, as this can | ||
| introduce a lead or lag, between the <a>timeline</a>'s current time and | ||
| <a>animation</a>'s current time. | ||
|
|
||
| Issue: This procedure can likely be simplified, and instead determine if at a | ||
| scrolling boundary regardless of playback rate or start time. The surprising | ||
| behavior that this is trying to prevent is an animation becoming inactive | ||
| precisely at the scroll limit, alleviating the need for set a fill-mode with | ||
| a ScrollTimeline. Checking if timeline [=timeline/current time=] is | ||
| 0 or timeline duration may be sufficient. | ||
| :: Return false | ||
| </dl> | ||
|
|
||
| Note: The intent of this procedure for use in phase determination is to | ||
| avoid the need for fill-mode when using a scroll-timeline where the active | ||
| timeline range spans the full scroll range, or a view-timeline where the | ||
| subject is aligned with the start or end of the source scroll container. | ||
| This algorithm is not intended to handle the general case, but rather | ||
| avoids complications, such as when a view timeline subject that is not | ||
| aligned with either bound of the scroll container being a candidate when the | ||
| magnitude of the playbackRate > 1. The algorithm also doesn't handle paused | ||
| animations. A more general solution is potentially feasible. | ||
|
|
||
| Replace: | ||
|
|
||
|
|
@@ -1303,7 +1294,7 @@ with: | |
| > <em>or</em> | ||
| > 1. the <a>animation direction</a> is "backwards" and the <a>local | ||
| > time</a> is equal to the <a>before-active boundary time</a> and not | ||
| > <a>at progress timeline boundary</a>. | ||
| > <a>at timeline boundary</a>. | ||
|
|
||
|
|
||
| Replace: | ||
|
|
@@ -1327,7 +1318,7 @@ with: | |
| > time</a>, <em>or</em> | ||
| > 1. the <a>animation direction</a> is "forwards" and the <a>local | ||
| > time</a> is equal to the <a>active-after boundary time</a> and not | ||
| > <a>at progress timeline boundary</a>. | ||
| > <a>at timeline boundary</a>. | ||
|
|
||
|
|
||
| <h4 id="fill-modes">Fill modes</h4> | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the terms we want to use here are "progress-based" and "monotonic" rather than "scroll-timeline" and "time-based timeline". This would better align with how the rest of the spec is worded.