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

I’m not sure I agree, ignoring the functional version for a moment, I think `:local-link` encapsulates the idea quite nicely (or at least in a better way than any other name I can think of, perhaps `:current-link` could be an alternative). We don't want _too_ much precision, since it doesn’t do the same thing in every case: if the page has a fragment, it needs to match, if the page doesn't have a fragment, it doesn't. I would argue the same should be true for query params.

The functional version is less well-motivated IMO and has a more confusing syntax.
Basically the use cases are:
1. Same origin + path + same fragment if page has a fragment + same query params (in any order) if page has query params
2. Same origin + path + same query params (in any order) if page has query params
3. Same origin + path
4. Same origin + path up to a point
5. Same origin
6. Same domain

Of which 1 is by far the most prevalent, followed by 2 and 3. For 4, I think we need to revisit use cases to see what the best syntax might be (e.g. maybe a way to match URLPatterns would work better). So I would suggest we focus initial efforts on 1 + 2 + 3 and maybe 5.

Some ideas to start the brainstorming:
1. `:same-*`: `:same-hash`, `:same-query`, `:same-path`: Same as what though?
2. `:local-*`
3. `:current-*`
4. `:current-target`, `:current-page`, `:current-page-*`
5. `:page-*`
7. `:self-*`
8. `:internal-link`

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


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

Received on Friday, 4 October 2024 13:37:58 UTC