Re: [csswg-drafts] [selectors] :local-link should have a more precise name (#10975)

The CSS Working Group just discussed `[selectors] :local-link should have a more precise name`.

<details><summary>The full IRC log of that discussion</summary>
&lt;kbabbitt> keithamus: headline features for these is that there needs to be a way to differentiate links on a different origin vs different parts of a hierarchical navigation<br>
&lt;kbabbitt> ... e.g. on github.com/settings there might be sublinks on that, we have a big menu, a little visual treatment to show what page you're on<br>
&lt;kbabbitt> ... many sites do this, this selector attempts to abbreviate that<br>
&lt;kbabbitt> ... look at URL of current page, parts of it<br>
&lt;kbabbitt> ... selectors-5 currently just has local-link as a selector<br>
&lt;kbabbitt> ... I would like to extend that<br>
&lt;kbabbitt> ... jyasskin had some great commentary on that<br>
&lt;kbabbitt> ... resolution I'm looking for is: what selectors to enable, what to name them<br>
&lt;astearns> ack fantasai<br>
&lt;kbabbitt> ... not sure if I made sufficient justification for :local-link(n) but happy to make it<br>
&lt;fantasai> https://www.w3.org/TR/2013/WD-selectors4-20130502/#local-pseudo<br>
&lt;kbabbitt> fantasai: we had much more control in original version of spec<br>
&lt;kbabbitt> ... there was a proposal to cut it down to a more minimal set<br>
&lt;kbabbitt> ... if there's interest in making it more powerful that would be fine<br>
&lt;kbabbitt> ... but this issue is asking for a renaming<br>
&lt;kbabbitt> keithamus: topic is around the renaming but I'd like to discuss in context of if we had a suite of these selectors<br>
&lt;jyasskin> And fwiw, the :local-link(n) is still in https://drafts.csswg.org/selectors-5/#local-pseudo. It was removed from level 4.<br>
&lt;kbabbitt> ... there's a chance to approach this with a look at all of them and get some symmetry<br>
&lt;jyasskin> +1<br>
&lt;kbabbitt> ,,, to that end, we have [missed]-target already, should we have same-*? same-target, same-origin, same-path?<br>
&lt;kbabbitt> fantasai: difference between origin and domain?<br>
&lt;jyasskin> q+<br>
&lt;kbabbitt> keithamus: I don't think there's a distinction between those. there is between path and target<br>
&lt;kbabbitt> s/[missed-]/:/<br>
&lt;kbabbitt> fantasai: for matching fragment, there was proposal in the thread for :target<br>
&lt;kbabbitt> ... expanding out to all those things [missed]<br>
&lt;fantasai> s/:target/:target-link/<br>
&lt;kbabbitt> keithamus: symmetry would be :target-link, :local-link, ...<br>
&lt;kbabbitt> ... would :local-link still exist as matching origin?<br>
&lt;kbabbitt> ... or would we have :origin-link?<br>
&lt;kbabbitt> fantasai: previous proposal had :local-link(n) where n=0 represents same domain, 1 represents same first segment, etc.<br>
&lt;kbabbitt> ... one thing it didn't handle was query parameter, etc<br>
&lt;kbabbitt> keithamus: yes which is doable but difficult with one single selector<br>
&lt;kbabbitt> ... because if you have an arbitrary path it can grow to an arbitrary number<br>
&lt;fantasai> 1. :target-link matches including fragment<br>
&lt;fantasai> 2. :local-link matches page URL ignoring fragment<br>
&lt;keithamus0> q?<br>
&lt;fantasai> 3. :local-link(&lt;integer>) matches domain + number of path segments<br>
&lt;astearns> ack jyasskin<br>
&lt;kbabbitt> astearns: jyasskin had concerns about using local in name<br>
&lt;kbabbitt> jyasskin: local is not great for this purpose because of what it means in the rest of platform<br>
&lt;kbabbitt> ... we want CSS to be consistent with those<br>
&lt;kbabbitt> ... and not confuse people wrt other parts of platform<br>
&lt;kbabbitt> fantasai: I think we have a structure and need better names<br>
&lt;kbabbitt> jyasskin: origin vs domain - domain isn't great but there is a site concept in other parts of platform which could be used here<br>
&lt;kbabbitt> ... not clear it's needed but could be right term<br>
&lt;kbabbitt> keithamus0: one suggestion in thread is same-path, same-site<br>
&lt;kbabbitt> ... same-path paramaterized with an integer<br>
&lt;kbabbitt> ... and then same-target<br>
&lt;kbabbitt> jyasskin: not sure target is exactly right, not sure [?] is what you want to match in a link, but it's not terrible<br>
&lt;kbabbitt> astearns: context is that keithamus0 is implementing local-link<br>
&lt;kbabbitt> ... looking to ensure whatever gets implemented can get extended<br>
&lt;kbabbitt> keithamus0: I've prototyped parameterized version in Chrome<br>
&lt;kbabbitt> ... that's the version most useful to github<br>
&lt;jyasskin> s/not sure [?] is what you want to match in a link/:target matches the thing referred to by the active fragment, so it might not be the right name when matching a link/<br>
&lt;kbabbitt> ... bare one could visually treat intra-page navigations as inter-page navigations<br>
&lt;kbabbitt> ... lot of posts about cross-origin links<br>
&lt;kbabbitt> fantasai: what if we called it match-link?<br>
&lt;kbabbitt> ... but that doesn't quite capture what you're matching<br>
&lt;kbabbitt> keithamus0: I like the idea of saying dash-whatever, it matches the problem space<br>
&lt;fantasai> `:self-link(&lt;integer>)`<br>
&lt;kbabbitt> fantasai: also suggestion of self-link<br>
&lt;kbabbitt> keithamus0: does self-path(3) ...<br>
&lt;kbabbitt> fantasai: you don't need to distinguish in that case<br>
&lt;kbabbitt> jyasskin: is it self-origin, self-path, ...?<br>
&lt;kbabbitt> fantasai: parameter 0 means site, 1 means site + 1 path segment<br>
&lt;kbabbitt> jyasskin and then keyword for fragment, paremeters, etc?<br>
&lt;kbabbitt> fantasai: yes<br>
&lt;jyasskin> :self-link(path(3)) ?<br>
&lt;kbabbitt> keithamus0: how would keywords look? positional parameters?<br>
&lt;jyasskin> :self-link(site)<br>
&lt;kbabbitt> ... would both be preculded?<br>
&lt;flackr> q+<br>
&lt;fantasai> :self-link(&lt;integer> | target || query)<br>
&lt;kbabbitt> astearns: like self a little more than same<br>
&lt;astearns> ack flackr<br>
&lt;kbabbitt> flackr: self-link is from the proposal to generate pseudo-element links from current element<br>
&lt;jyasskin> q+<br>
&lt;kbabbitt> ... in that discussion we talked about approaching it from different direction<br>
&lt;kbabbitt> ... if we choose self-link here, we need to make sure we have something that makes sense in that other context<br>
&lt;kbabbitt> fantasai: maybe that one can be anchor-link?<br>
&lt;fantasai> ::anchor-link ?<br>
&lt;kbabbitt> flackr: maybe<br>
&lt;astearns> ack jyasskin<br>
&lt;kbabbitt> jyasskin: hearing a bunch of concerns from CSS experts<br>
&lt;kbabbitt> ... shying away from same-path, same-site, same-origin terminology<br>
&lt;kbabbitt> ... where they've been used in other parts of platform, curios why that is<br>
&lt;kbabbitt> fantasai: we do want to have an integer parameter, right? once you have that, that gets you site + path without a keyword<br>
&lt;kbabbitt> jyasskin: it gets you origin + prefix of path<br>
&lt;kbabbitt> fantasai: or a keyword or default value or something that specifies full path<br>
&lt;kbabbitt> jyasskin: we still need something that specifies whole query<br>
&lt;kbabbitt> astearns: I was a little concerned about adding path and site and origin<br>
&lt;kbabbitt> ... not sure authors have those concepts in mind<br>
&lt;kbabbitt> fantasai: we can add keywords corresponding to them if that would be more user friendly<br>
&lt;kbabbitt> astearns: would it make sense to hold off on this and have a discussion in upcoming f2f<br>
&lt;dbaron> (it might also help the discussion to define path and origin for the rest of the group)<br>
&lt;kbabbitt> jyasskin and keithamus0 both remark that they won't be able to be there<br>
&lt;jyasskin> Re dbaron: and site, query, and fragment.<br>
&lt;kbabbitt> keithamus0: I think there's a good direction for the semantics but naming is where we got stalled<br>
&lt;dbaron> (oops, I meant to say "site and origin" :-)<br>
&lt;kbabbitt> fantasai: suggest we sketch it out and put some suggestions down<br>
</details>


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


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

Received on Wednesday, 8 January 2025 17:39:11 UTC