Re: [csswg-drafts] [scroll-animations] Broader scope of scroll timelines (#7759)

> > I think each named timeline could still implicitly serve as a local root for that name as well as the selected timeline for the ancestor declared name if one existed. This would allow descendants to continue to be valid and use the same timeline in their happy subtree bubble.
> 
> Apologies @flackr, could you elaborate on this? I'm not completely sure what behavior you're suggesting here.
> 
> I _think_ you're saying that if you, say, write `scroll-timeline: foo block;`, this will automatically attach to an ancestor establishing a `foo` timeline (but not attaching an axis) if one exists, and create its own `foo` timeline if there's one (and attach the axis). And you can force the "create a timeline" behavior regardless of ancestors by setting `-scope: foo`?

Almost. I'm saying that `*-timeline-root: foo` only establishes the name foo. `*-timeline-name: foo` attaches a scroll/view timeline for the current element as scroller/subject to the nearest ancestor `*-timeline-root: foo`, *and* also makes that timeline-name available to itself / any descendant elements referring to that `animation-timeline`.

This means that for the happy little subtree case:
```html
<style>
unhappy-root {
  /* Establishes the name foo, none of the other view-timeline-* properties matter for foo */
  view-timeline-root: foo;

  /* Could even provide a view-timeline for this subject with a different name which would use the axis: */
  view-timeline: bar block;
}
happy-subtree {
  view-timeline: foo block; 
}
.observer {
  animation: frames;
  animation-timeline: foo;
}
</style>
<unhappy-root>
  <happy-subtree> <!-- defines view-timeline foo for this subtree AND adds it to the unhappy-root foo timeline -->
    <div class="observer"></div> <!-- happily uses its parent timeline -->
  </happy-subtree>
  <happy-subtree> <!-- defines view-timeline foo for this subtree AND adds it to the unhappy-root foo timeline -->
    <div class="observer"></div> <!-- happily uses its parent timeline -->
  </happy-subtree>
  <div class="observer"></div> <!-- unhappy - has two timelines associated with the root so doesn't run -->
</unhappy-root>
```

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


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

Received on Wednesday, 26 April 2023 15:57:48 UTC