Re: [csswg-drafts] [scroll-animations] should an infinite duration yield an exception for effects associated with a progress-based animation? (#11804)

I don't think we need to throw for a scroll-driven animations with infinite duration and can handle it by resolving what to do in the various undefined cases.   There are also other ways to get into the infinite duration case, by setting the duration first on a time based animation and then setting the timeline to switch  to a scroll-driven animation. Also this timing inconvenience might be temporary as you might set the duration and then make other API calls so that everything is OK.

As specced, the normalization process has the following step:

iteration duration =  specified iteration duration / total time * timeline duration = infinity / infinity * timeline duration 

which is undefined.

When end time is infinite, the start and end delay both collapse to zero provided their time based counterparts were finite, and iteration duration can simplify down to timeline duration / iteration count, which is only a problem if iteration count is also infinite.  In keeping with how we handle the active duration calculation for 0 * infinity cases, when performing normalization of time-based values with a scroll-driven animation, we can specifically call out how to handle each undefined case. For this particular example, when effect end is infinite:

 iteration duration = timeline duration / iteration count if iteration count is finite and 0 otherwise.



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


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

Received on Thursday, 23 October 2025 20:24:28 UTC