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

Okay, after chatting with flackr privately I finally understand what they're suggesting. The model they're asserting was flying over my head. ^_^

Okay, so flackr's idea is this:

* `-name` and `-axis` work together to create and attach a **local timeline**, *always*. No exceptions, no behavior changes, you just set them both (or rely on defaults, whatever) and you'll get a local timeline drawing from your scroller, which is visible to yourself and your descendants. (If you're not scrollable, this is just an inactive timeline.)

* `-root` creates a *different* kind of object, a **deferred timeline**, which by definition doesn't have an axis attached directly. Instead, it tries to match up with a single descendant local timeline with the same name. If it finds one (not 0 or >1), then it uses that local timeline's scroller. (If it can't find exactly one match, it's an inactive timeline, too.)

* whenever something is trying to find a timeline of a given name, it just looks at itself and its ancestors and uses the first timeline it finds with that name. This might be a local timeline, or a deferred timeline; the difference is meaningless.

This model means we don't need to do any shenanigans with the shorthand. `scroll-timeline` just sets `-name` and `-axis`, creating local timelines. (`view-timeline` also sets `-inset`, or I guess *could* do so if we allow it in the shorthand.) To set up a deferred timeline you use `scroll-timeline-root` instead, which is not part of the property group.

After giving it some thought while writing this out, I think this is my favorite mental model so far. It doesn't require any syntax contortions, you don't have useless syntax combos, and while it creates more theoretical objects (both a local and a deferred timeline object, rather than just creating one timeline object that's lives higher up than its attached scroller) this multiplication gives a simpler model overall, I think.

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


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

Received on Friday, 28 April 2023 18:26:31 UTC