Re: [csswg-drafts] [scroll-animations-1] animation-range vs animation-duration (#8405)

Thinking about this more while working on the [iteration count edits](https://github.com/w3c/csswg-drafts/issues/8233), I think the model we should go with is:
- The animation is attached to a timeline. But more specifically, it is attached to a timeline _attachment range_. By default this is the entire timeline, which in the case of a scroll-driven timeline is finite, and in the case of a time-driven timeline is infinite. The _attachment range_ is the portion of the timeline that the animation is laid out in (somewhat analogous to a _containing block_).
- The start/end of this attachment range can be controlled with `animation-range`.
- Any resizable aspects of the animation will stretch or squish to fit the attachment range (like flex items inside a flex container). So if the duration is flexible (`auto`), then we fill the whole range. If the duration is inflexible, then we pin the animation to its start point.
- Delays are like margins. They don't change the _attachment range_, but they reduce the amount of space available for the “content” and shift it accordingly. The initial value of a delay is `auto`, which functions like `0` except when there's additional constraints.
- If there's an iteration count, we repeat that many times within the “available space” in the _attachment range_ (reduced by any delays). If the duration is flexible, it is reduced to fit (like multi-col column widths given a `column-count`). If the duration is inflexible, additional iterations may overflow the _attachment range_. However...
- While animation frames outside the _attachment range_ are used for interpolation, they are not part of the _active interval_ of the animation. The animation ends at the end of the _attachment range_ (similar to how content outside a scroll container impacts layout but is not visible).

CC @flackr @birtles 

-- 
GitHub Notification of comment by fantasai
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8405#issuecomment-1464810166 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 11 March 2023 03:24:00 UTC