- From: Keith Cirkel via GitHub <sysbot+gh@w3.org>
- Date: Fri, 04 Oct 2024 17:03:31 +0000
- To: public-css-archive@w3.org
Going through our (GitHub's) use cases led me to prioritise prototyping out `:same-link-path` & `:same-link-path(N)` which I believe cover a lot of the use cases. (I chose `:same-link-path` vs `:same-path-link` because I believe matching the symmetry left-to-right makes more sense). I'd slightly re-order @LeaVerou's list - I don't think fragments are as high a priority as heirachical nav, so my order would be: 1. Same origin + path up to a point 1. Same origin + path 1. Same origin 1. Same domain 1. Same origin + path + same query params (in any order) if page has query params 1. Same origin + path + same fragment if page has a fragment + same query params (in any order) if page has query params It's very common to match path fragments, for example on GitHub we extensively use this heirarchical navigation, for example repositories follows a pattern of `github.com/:owner/:repo/:section` where `:section` could be one of `issues`, `pulls`, `actions`, `projects`, `pulse`, `security` and of course the empty section which is the repository index/homepage. The way I have currently prototyped this in Chrome is that `:same-link-path(N)` matches segments at the `/` code point, removing any trailing `/` which satisfies this kind of heirarchical navigation use case. It also allows for `:same-link-path(0)` to effectively match the eqiuvalent of Same Origin links or `:same-link-path` (no arg) to match the entire path, which allows for my second prioritised use case. In other words, this one pseudo class (or two if you cound the functional/non-functional combo) covers use-cases 1-3. It's worth pointing out that - as currently implemented - `:same-link-path` won't match if origins (scheme+host+port) don't match. It might also be interesting to explore the utility/demand for combinations of these. Is there ever a need to match different path but same fragment, or different origin but same path? These seem very edge case for me; but I'd imagine `:same-link-origin(N)` could match just the host, and ignore the path, while `:same-link-fragment` could match just the fragment and ignore the origin and path. Perhaps this warrants removing the same origin restriction on `:same-link-path`, which, if really needed, could be handled with combining `:same-link-origin:same-link-path(N)`. -- GitHub Notification of comment by keithamus Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10975#issuecomment-2394156947 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 17:03:32 UTC