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

> Also, as has I think been mentioned I find it a bit odd to add defer to axis when that is just one of the properties of the declared timeline. E.g. view timelines also have inset which will have the same oddity.

My issue (which has taken me a while to fully suss out from my own disquiet, sorry) is that the current design for `-attachment` is mixing responsibilities more than we usually do.

`-inset` is an elaboration on `-axis`, so it's fairly normal for it to simply not work when `-axis` isn't defining an axis. `-attachment` isn't an over-property of `-name` and `-axis`, tho, so it's less usual for it to have this sort of effect. It's doing two separate things right now.

If `defer` is moved off to `-axis`, tho, then `-attachment` becomes a paired property with `-name`, controlling whether you create (and use) a new timeline on the element, or search for an existing timeline on an ancestor. The lines of responsibility become cleaner: `-name` and `-attachment` select a timeline, and `-axis` (and `-view` for view timelines) attach controlling mechanisms to the selected timeline.

------

There are multiple ways to achieve this cleaner division, tho - using `-root` to force timeline *creation* (and letting `-name` auto-search, and just create-by-default if the search fails) is another way. It does mean slightly more repetition, but the overall weight is essentially identical.

I think @bramus's idea of a `-root` syntax that takes a name is more complex than we need, tho. Here's a simpler form:

```
*-timeline-root: [ auto | self | ancestor ]#
*-timeline-name: [ <custom-ident> ]#
*-timeline-axis: [ block | inline | ... | defer ]#
```

`-root` defines where the timeline root is to be found: `self` creates a fresh timeline on the element, `ancestor` searches for an unattached timeline on an ancestor, `auto` tries to search and instead creates if the search fails.

`-name` and `-axis` work as already explained. In particular, `-axis: defer` means the element doesn't attach anything to the timeline selected by `-name`/`-root`, while the other values do attach something.

(Yes, this is just renaming `-attachment` and its values to `-root`. The `-attachment` behavior isn't bad once you remove `defer` from it so it can focus on one thing.)

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


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

Received on Thursday, 27 April 2023 18:35:24 UTC