[scroll-animations] Broader scope of scroll timelines · Issue #7759 · w3c/csswg-drafts (original) (raw)
From #7047, it might be worth looking into the ability to split the declaration of a timeline (together with its scoping) from its actual attachment to a scroll container.
This would allow authors, for example, to declare a name on a subtree and make it available to all descendants of that subtree, and attach it to a scroll container that is a descendant within the subtree. (At the top level, declaring the name on the root element would make it global.)
Maybe something like scroll-timeline-attachment: local | defer | ancestor | closest
where:
local
has the current behavior of binding the name to this element’s scroll containerdefer
declares and scopes the name, but does not bind it to a scroll containerancestor
looks up the ancestor chain for a matching timeline name and attaches to that instance; failing a match, declares it locallyclosest
looks back up the tree including previous siblings for a matching timeline name (same lookup as animation-timeline), and attaches to the first matching instance; failing a match, declares it locally