w3c / w3c/csswg-drafts

[web-animations-2] Support setting animation currentTime and startTime using CSSNumericValue

Open
#6,458 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

The process for setting animation currentTime and startTime needs to be updated to handle CSSNumericValue inputs.

For progress based animations, I suggest we only allow CSSNumericValues that are percentages. which makes setting the time as simple as:
(new_current_time / 100) * timeline_duration

There are certain edge cases where we might be able to convert absolute time units to progress based values, but it would never be complete. If the animation is creating using only percentage values for effect iteration duration, then there is no frame of reference to be able to convert an absolute time value into a progress based value. I think it is more straightforward to simply limit the allowed input types depending on the type of timeline being used.

For time based animations we should add support for certain types of CSSNumericValues. We will need to discuss which CSSNumericValues to support.

Exceptions should be thrown at each point where incompatible input is detected.

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 by reviewing the Web Animations 2 algorithms for setting animation currentTime and startTime. Resolve which CSSNumericValue types are permitted for progress-based and time-based timelines, including incompatible-input exceptions. Done means the specification defines supported units, conversion behavior, and exception points.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.