Re: [csswg-drafts] [scroll-animations-1] Do we need container-name references? (#7046)

The CSS Working Group just discussed `container name references`, and agreed to the following:

* `RESOLVED: remove the container name argument from the scroll() function`

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> Topic: container name references<br>
&lt;TabAtkins> github: https://github.com/w3c/csswg-drafts/issues/7046<br>
&lt;TabAtkins> bramus: if we ahve a scroll-timeline name, we add some ident to it, and we do the same for containers<br>
&lt;TabAtkins> bramus: so you're adding names here and there<br>
&lt;TabAtkins> bramus: q is when referring to a scroll timeline, could we reuse the container-name so we don't have to add multiple names for various purposes?<br>
&lt;flackr> q+<br>
&lt;TabAtkins> bramus: going forward, do we want a way to specify a type of reference so you can reuse them in various contexts?<br>
&lt;TabAtkins> bramus: example in issue is the main element which adds a name both as container and scroller, setting both properties to the same ident<br>
&lt;astearns> ack flackr<br>
&lt;bkardell_> q+<br>
&lt;TabAtkins> flackr: given the previous discussion about how lookup is not strictly ancestors, it feels like it would be weird to use container-name just for descendants for CQ, but descendants and siblings for scroll-timeline<br>
&lt;astearns> ack bkardell_<br>
&lt;miriam> q+<br>
&lt;TabAtkins> bkardell_: we seem to be ahving a lot of discussions about names and scopes, not just in CSS.<br>
&lt;TabAtkins> bkardell_: wondering if we should give thought to aligning these<br>
&lt;TabAtkins> bkardell_: don't think we want to have a hundred slightly different answers, maybe just one or two good ones<br>
&lt;astearns> ack miriam<br>
&lt;TabAtkins> miriam: i like the idea of container-name being reusable for other container purposes<br>
&lt;TabAtkins> miriam: i don't think we should necessarily consider these name properties being specific<br>
&lt;TabAtkins> miriam: understand Rob's point about the different scope of the name<br>
&lt;TabAtkins> miriam: don't have a solution for that, but i like the feature idea<br>
&lt;bramus> q+<br>
&lt;TabAtkins> flackr: totally okay with the concept, just think we should use them in contexts where the scope is the same<br>
&lt;TabAtkins> flackr: reuse container name in contexts that are ancestor-only, come up with something else for things with counter scope, etc<br>
&lt;TabAtkins> fantasai: this was more about the scroll() function, which makes an anonymous timeline based on the scroll container<br>
&lt;TabAtkins> miriam: wondering if we could attach the scope to the container name - that's a property of queries<br>
&lt;TabAtkins> fantasai: so the scope is more about what's your lookup function, not the "scope of the name"?<br>
&lt;TabAtkins> astearns: so the lookup scope is determined by where you refer to the name. where you declare it has nothing to do with the lookup scope.<br>
&lt;fantasai> TabAtkins: possibly problematic implementationwise, because changes how you store the name<br>
&lt;TabAtkins> astearns: yeah, so for ipml purposes you'd have to know what kinds of scopes could refer to it and maybe take multiple storage strategies<br>
&lt;TabAtkins> TabAtkins: just invent th eone correct data structure, easy<br>
&lt;astearns> q?<br>
&lt;TabAtkins> bramus: [question]<br>
&lt;TabAtkins> fantasai: so say container-name is a kinda generic naming prop<br>
&lt;TabAtkins> fantasai: various things can be like "I want X element", if a container-name has X you can use it for wahtever<br>
&lt;TabAtkins> fantasai: now for scroll timelines, scroll() can refer to an anonymou scroller, it can take a name to filter<br>
&lt;TabAtkins> fantasai: could define to have it look across, etc<br>
&lt;TabAtkins> fantasai: so it's not the naming something declares the scope, the lookup declares the lookup scope<br>
&lt;astearns> ack bramus<br>
&lt;TabAtkins> q+<br>
&lt;TabAtkins> bramus: maybe introduce a generic naming property?<br>
&lt;TabAtkins> astearns: before we get that generic, maybe need use-cases<br>
&lt;TabAtkins> astearns: here we have two instances of container names<br>
&lt;TabAtkins> fantasai: reason scroll() only looks at ancesstors, not siblings, is becuase fundamentally it only looks for scroller ancestors, "nearest scroll container"<br>
&lt;TabAtkins> fantasai: so the container name there is just filtering the search, not expanding it<br>
&lt;TabAtkins> emilio: how is the scroll() function defined to look at ancestors? CQs do something weird wrt shadow dom<br>
&lt;TabAtkins> TabAtkins: Just using the scroll ancestors<br>
&lt;TabAtkins> emilio: so just the flat tree, different from CQs<br>
&lt;TabAtkins> emilio: it would still be weird if something looking for a container-name returned different results in different contexts<br>
&lt;TabAtkins> fantasai: I don't particular care if we have this container name, it was just to ask if we need this. we can jsut drop the name from scroll()<br>
&lt;astearns> ack TabAtkins<br>
&lt;fantasai> TabAtkins: I'm with emilio, the scope of a name is an important part of the existance of a name<br>
&lt;fantasai> TabAtkins: should be part of the declaration, not the lookup<br>
&lt;fantasai> TabAtkins: I don't have a great problem with us having a proliferation of ways to declare names<br>
&lt;fantasai> TabAtkins: there's often special information associated with the name<br>
&lt;fantasai> TabAtkins: or you might ???<br>
&lt;fantasai> TabAtkins: That's why having only one ID or class is annoying<br>
&lt;fantasai> TabAtkins: I think it's useful to have multiple name properties, I think it reduces confusion<br>
&lt;fantasai> miriam: We do allow multiple names in that one property<br>
&lt;fantasai> TabAtkins: But additional context is useful. container-name might not need more info, but other things might<br>
&lt;fantasai> fantasai: like the view timeline stuff<br>
&lt;TabAtkins> astearns: I'm fine with closing this issue<br>
&lt;fantasai> astearns: I'm perfectly fine with closing this issue, but if we find we have a proliferation of name properties and authors are declarting the same name on multiple properties just because they have to, then we can revisit and see if we can come at solution for that specific authoring problem<br>
&lt;TabAtkins> astearns: I think if we find we do have this proliferation of name properties, and authors are declaring the same name in multiple props bc they have to, then we can reopen the issue and come up with a solution for that specific problem<br>
&lt;TabAtkins> fantasai: this issue can't just be closed - we need to answer if scroll() needs a name or not<br>
&lt;TabAtkins> fantasai: so scroll() is a way of saying 'i want to bind this anmation to this timeline'<br>
&lt;flackr> q+<br>
&lt;TabAtkins> fantasai: you can give it a name, but you can just say scroll() to mean "i want the nearest scroll container"<br>
&lt;TabAtkins> fantasai: so this is a way to declare that<br>
&lt;TabAtkins> fantasai: if your parent or grandparent is  ascroller, etc<br>
&lt;TabAtkins> fantasai: for many simple animations you don't need a name, so this is good<br>
&lt;TabAtkins> fantasai: the container name lets you filter this list by name<br>
&lt;TabAtkins> fantasai: so question in this issue is do we want this container name filter or not?<br>
&lt;astearns> ack flackr<br>
&lt;TabAtkins> flackr: i don't think there's any reason th ename has to be a filter<br>
&lt;TabAtkins> flackr: could literally use the nearest ancestor with the given name<br>
&lt;TabAtkins> flackr: scroll-timeline doesn't require it to be a scroller<br>
&lt;TabAtkins> flackr: could be useful for a reading progress<br>
&lt;TabAtkins> fantasai: if your element declaring the scroll timeline isnt' a scroller, you're not getting a timleine out of that, so i'm confused<br>
&lt;TabAtkins> dbaron: I think the example is an abspos whose containing block is outside the scroller, but is positioned inside the scroller<br>
&lt;TabAtkins> TabAtkins: are you suggesting that with and without the name use different lookups?<br>
&lt;TabAtkins> flackr: yes, i think that's fine<br>
&lt;TabAtkins> fantasai: i think if you're doing something more complex than "nearest ancestor scroller", then go name your timelines<br>
&lt;TabAtkins> fantasai: purpose fo scroll() was ot just get "the nearest" or "the document" scroller. don't think it should expand to looking elsewhere.<br>
&lt;TabAtkins> flackr: i'm suggesting that a name makes it use the strict parent chain, not the CB chain<br>
&lt;TabAtkins> fantasai: oh that's okay<br>
&lt;fantasai> “By default, scroll() references the block axis of the nearest ancestor scroll container.”<br>
&lt;TabAtkins> emilio: CQs don't use the flat tree strictly<br>
&lt;dbaron> s/positioned inside the scroller/a descendant of the scroller/<br>
&lt;fantasai> Technically it's already defined the way flackr wants<br>
&lt;TabAtkins> emilio: I'd be more comfortable if we did container lookups consistently using whatever method<br>
&lt;TabAtkins> flackr: i'd be in support of that, using the same method<br>
&lt;TabAtkins> TabAtkins: i'd be okay with revisiting the CQ lookup method, if we're concerned with consistency. want to think about it.<br>
&lt;TabAtkins> fantasai: so q is if we even want the scroller name, since we can provide a timeline name<br>
&lt;fantasai> TabAtkins: if you can provide a timeline name anyway, what additional value do we get from the container name here?<br>
&lt;fantasai> TabAtkins: have scroll() or timeline name, and they both do what you expect<br>
&lt;fantasai> flackr: It would be  minor convenience, but I don't think it's necessary<br>
&lt;ydaniv> +1 to defer<br>
&lt;TabAtkins> astearns: so proposed resolution is we don't add this functionality to the draft<br>
&lt;TabAtkins> fantasai: which would be a spec change, yeah<br>
&lt;TabAtkins> RESOLVED: remove the container name argument from the scroll() function<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7046#issuecomment-1204014693 using your GitHub account


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

Received on Wednesday, 3 August 2022 14:20:18 UTC