[csswg-drafts] [css-animations-2][web-animations-2][scroll-animations-1] Timeline returned for scope with no timeline providing that name. (#13807)

flackr has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-animations-2][web-animations-2][scroll-animations-1] Timeline returned for scope with no timeline providing that name. ==
The wpt test `Animation.timeline returns a timeline with no source for inactive deferred timeline` in https://github.com/web-platform-tests/wpt/blob/master/scroll-animations/css/animation-timeline-deferred.html is testing that if you have the following:

```html
<style>
.scope {
  timeline-scope: --foo;
}
.animation {
  animation-name: my-anim;
  animation-timeline: --foo;
}
</style>
<div class=scope>
  <div class=animating></div>
</div>
```

That if you get the animation you will get a timeline with a null source:
```js
    let animation = main.querySelector('.animating').getAnimations[0];
    assert_equals(animation.timeline.source, null);
```

This seems reasonable, however I do not believe we have discussed or specified it, so opening this to take a resolution to specify this behavior and I think it is a bit tricky, so we should agree on it. In particular, there are a few details we should agree on.

1. Per the test expectation, `animation.timeline` returns a generic AnimationTimeline object.
2. Since we cannot know what type the eventually attached animation timeline is (e.g. ViewTimeline or ScrollTimeline), it is a generic [AnimationTimeline](https://www.w3.org/TR/web-animations-2/#the-animationtimeline-interface) instance which means source is not a field on it.
3. Since the type of the timeline depends on the eventual source, I expect that the timeline instance you get will not have the same identity as when a real source is attached. This raises the question of what should the identity match to? The simplest implementation-wise would be to have a single unresolved timeline instance that is used anytime we have an unresolved animation timeline, so I would propose this - all scoped timelines without an attached timeline return a shared unresolved timeline instance.

@kevers-google @andruud please add anyone else who may have context.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13807 using your GitHub account


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

Received on Tuesday, 14 April 2026 15:45:58 UTC