Skip to content

[web-animations-1] Does an easing on a keyframe that specifies no value for the animated property apply? #14492

Closed

Description

@karlcow

While fixing a WPT test for SVG
web-platform-tests/wpt#62697

I found another potential issue.
Engines disagree, and I think the spec already answers it.

An easing on a keyframe that carries no value for the property being animated:

    el.animate([{ easing: "steps(2, start)" },
                { fontSize: "80px" }], 100000);

The element's computed font-size is 120px. Paused and seeked:

currentTime Chrome 155 Firefox 158 Safari 26.4 Safari 27.0
0 100px 120px 120px 120px
25000 100px 110px 110px 110px
49999 100px 100px 100.000397px 100.000397px
50000 80px 100px 100px 100px
75000 80px 90px 90px 90px

Chrome applies the steps easing. Firefox and Safari interpolate linearly and ignore it. Measured 2026-09-15.

Reading the algorithm, Firefox and Safari are right.

In the effect value of a keyframe effect, three steps in order:

  1. "Remove any keyframes from property-specific keyframes that do not have a property value for target property." The first keyframe has no font-size, so it goes here.
  2. "If there is no keyframe in property-specific keyframes with a computed keyframe offset of 0, create a new keyframe with a computed keyframe offset of 0, a property value set to the neutral value for composition, and a composite operation of add, and prepend it." An offset, a value and a composite operation. No easing, so the default linear.
  3. "Let transformed distance be the result of evaluating the easing function associated with the first keyframe in interval endpoints."

The authored keyframe is gone at step 1, and the one that replaces it is linear. So the easing cannot reach font-size.

If that is the intended answer, it would be worth saying so where the implicit keyframe is created, because "create a new keyframe" leaves its easing to be inferred. #2914 proposes rewriting that same step for a different reason, so the two could be handled together.

Nothing in the test suite covers it. effect-value-transformed-distance.html is the keyframe-easing test and every keyframe in it specifies the animated property, so the removal step is never reached. effect-value-step-easing-reversed-direction.html the same. processing-a-keyframes-argument-002.html builds [{ easing: invalidEasing }] but only to check that it throws. I grepped all of web-animations/ for a keyframe with only an easing and the only other hits are invalid-easing parsing fixtures.

It is easy to write by accident. I hit it in an SVG test that was translating a CSS animation into the Web Animations API, where the same intent is expressed as an element-level animation-timing-function and does apply.

Happy to write the test once the answer is settled.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions