w3c / w3c/csswg-drafts

[web-animations-2] The handle of zero or inf total time when we convert a time-based animation to a proportional animation

Open
#7,459 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

web-animations-2
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

There are two edge cases the spec doesn't specify what happen when we convert a time-based animation to a proportional animation in [web-animations-2]:

Set start delay to be the result of evaluating specified start delay / total time * timeline duration.
Set iteration duration to be the result of evaluating specified iteration duration / total time * timeline duration.
Set end delay to be the result of evaluating specified end delay / total time * timeline duration.

This spec issue may be related to #4862, the normalization of progress-based animations. I notice Chromium handles these two edge cases by (code):

  1. if the total time (i.e. end time) is zero, the start delay, end delay, and the iteration duration are all zero.
  2. if the total time is inf, that start delay and end delay are zero, and the iteration duration is 1 / iteration count.

The handle in Chromium looks reasonable to me, I'd like to use this similar way in Gecko. And it'd better to address these two edge cases in the spec as well.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Web Animations 2 section on converting a time-based animation to a proportional animation, then review the linked Chromium handling and related issue #4862. Define the specified behavior for zero and infinite total time, and consider how the resulting wording fits the surrounding specification.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.