Re: [csswg-drafts] [css-navigation-1] Allow `navigation-param()` to specify whether it should read params from the old/new/current URL (#13179)

The CSS Working Group just discussed ``[css-navigation-1] Allow `navigation-param()` to specify whether it should read params from the old/new/current URL``, and agreed to the following:

* `RESOLVED: specify from/to and this/other for navigation-param(), at least for now, and add examples`

<details><summary>The full IRC log of that discussion</summary>
&lt;emilio> bramus: right now navigation-param() gets one argument which is the named param<br>
&lt;emilio> ... If you're going from details page to another details page, sometimes you want to know the id from the old or the new page<br>
&lt;emilio> ... so you can style things differently<br>
&lt;emilio> q+<br>
&lt;emilio> ... there's an example there in the issue<br>
&lt;astearns> ack romain<br>
&lt;emilio> ... it'd be handy to know what was the ID in the older page<br>
&lt;emilio> ... so proposal would be to add a param to distinguish between old / new<br>
&lt;emilio> ... noamr raised that you might want to specify<br>
&lt;emilio> ... but also should we specify from / to rather than "the other page"<br>
&lt;fantasai> scribe+<br>
&lt;astearns> ack emilio<br>
&lt;fantasai> emilio: What's the intended behavior when something like restoring your session?<br>
&lt;fantasai> emilio: For View Transitions you wouldn't trigger a transition, no problem<br>
&lt;fantasai> emilio: But these selectors are more general, maybe you're styling color or whatever<br>
&lt;fantasai> emilio: So it seems weird if I get different behavior when closing/opening window<br>
&lt;fantasai> bramus: If you reopen, there's no navigation<br>
&lt;fantasai> noamr: Semantics for this follow the navigation API semantics<br>
&lt;fantasai> noamr: what is the current navigation, etc.<br>
&lt;fantasai> dbaron: Navigation_param() will only have values while a navigation is in progress<br>
&lt;fantasai> emilio: Oh, ok<br>
&lt;fantasai> bramus: The examples are always wrapped in @navigation, which targets an ongoing navigation<br>
&lt;lea> q?<br>
&lt;fantasai> dbaron: That said, :link-to() could be used without navigation param<br>
&lt;lea> q+<br>
&lt;fantasai> dbaron: So it could be used when a navigation is not in progress<br>
&lt;fantasai> dbaron: but in that case you can't use navigation_param<br>
&lt;fantasai> emilio: I understand for view transitions it's what you want<br>
&lt;iank_> Ding ding<br>
&lt;iank_> Dong*<br>
&lt;fantasai> emilio: But if you want, e.g. when I navigate from this page I want the link to be bigger... and then it stops matching, maybe that's confusing?<br>
&lt;fantasai> ChrisL: Is this matching / not-matching defined in terms of ???<br>
&lt;fantasai> ChrisL: Defines partial availability of previous page<br>
&lt;fantasai> emilio: defined in terms of Navigation API, which is hopefully reasonably well-defined<br>
&lt;fantasai> dbaron: The spec has a few issues about getting that integration right<br>
&lt;fantasai> dbaron: But these are issues that are at a pretty detailed level<br>
&lt;fantasai> dbaron: Need to do some spec editing to make it tight<br>
&lt;fantasai> dbaron: IIRC, in the old page you don't really ever see the styles with these matching, but you take View Transition snapshots at that time. Or something.<br>
&lt;fantasai> noamr: Starts navigate event, that is when you click the link,<br>
&lt;fantasai> noamr: Once you're ready for cross-document view transitoin, then ??<br>
&lt;fantasai> noamr: The styles last until the first frame of the next document or end of view transition<br>
&lt;astearns> ack lea<br>
&lt;fantasai> lea: Common to have different types of effects depending on where you're from<br>
&lt;fantasai> emilio: Yes, but it stops matching once you finished the transition<br>
&lt;fantasai> noamr: :link-to() will work, but navigation_param() won't work<br>
&lt;fantasai> noamr: :link-to() is just url pattern matching without<br>
&lt;fantasai> emilio: Forget about view transitions, have a selector :link-to( navigation_param(old_id1))<br>
&lt;fantasai> emilio: When I navigate from that page to my page, maybe the link is bold<br>
&lt;fantasai> emilio: but then once navigation ends it's no longer bold<br>
&lt;emilio> lea: so this navigation-param() thing takes the param from the current url<br>
&lt;emilio> emilio: only during the navigation AIUI, tho<br>
&lt;emilio> lea: then what I wanted to say doesn't apply<br>
&lt;emilio> astearns: the point of this issue is distinguishing whether we need to distinguish old and new<br>
&lt;emilio> ... sounds like the answer is yes<br>
&lt;emilio> bramus: I have a view-transition example<br>
&lt;bramus> https://view-transitions.chrome.dev/profiles/mpa/<br>
&lt;emilio> ... there's specific in pageswap and pagereveal<br>
&lt;emilio> ... I'm extracting values from both ends<br>
&lt;emilio> q+<br>
&lt;emilio> ... I had to use js for this back in the day<br>
&lt;astearns> ack dbaron<br>
&lt;emilio> dbaron: I think we discussed two different pairs of concepts<br>
&lt;emilio> ... old vs. new page<br>
&lt;emilio> ... and "this vs. other page"<br>
&lt;emilio> ... we should probably put both for now but this vs. other might be the more important pair<br>
&lt;emilio> dbaron: when you navigate to the new page is the page you navigate to<br>
&lt;emilio> ... but the reason to care for this vs. other is so the animation can easily be symmetric<br>
&lt;fantasai> scribe+<br>
&lt;fantasai> emilio: So this page will match basically both pages of the navigation?<br>
&lt;fantasai> emilio: at different times<br>
&lt;fantasai> emilio: If I havigate from A to B, "this page" will match both the old and new page<br>
&lt;fantasai> emilio: the old page while navigating away, and new page while navigating into?<br>
&lt;fantasai> dbaron: Depends where style is writte<br>
&lt;fantasai> dbaron: In page A, it's talking about itself. In page B, it's talking about other<br>
&lt;fantasai> bramus: In examples, @navigation rule is used for that<br>
&lt;fantasai> bramus: e.g. @navigation from A to B { ... }<br>
&lt;fantasai> bramus: There's a navigation at() as well<br>
&lt;fantasai> emilio: Agree with dbaron that it makes more sense<br>
&lt;fantasai> emilio: New vs old is confusing<br>
&lt;fantasai> emilio: Seems hard to reason about<br>
&lt;dbaron> s/it makes/this versus other makes/<br>
&lt;fantasai> ChrisL: Current page could be page I'm defined in, vs page I'm viewing<br>
&lt;fantasai> bramus: fwiw, the terminology is "from" and "to"<br>
&lt;fantasai> dbaron: We also have side issue on making @navigation better at doing things symmetrically<br>
&lt;fantasai> dbaron: Commonly want to do vice versa navigation<br>
&lt;fantasai> bramus: next issue on the agenda!<br>
&lt;fantasai> astearns: So suggestion here is to specify both old and new, and this and other?<br>
&lt;fantasai> astearns: And see if in the end we need them all?<br>
&lt;fantasai> bramus: from and to, to match @navigation terminology<br>
&lt;dbaron> PROPOSED: specify from/to and this/other for navigation-param(), at least for now, and add examples<br>
&lt;noamr> at: and with:<br>
&lt;fantasai> fantasai: this/other or here/there? :)<br>
&lt;emilio> RESOLVED: specify from/to and this/other for navigation-param(), at least for now, and add examples<br>
&lt;dbaron> (with this/other names to be bikeshedded)<br>
</details>


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


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

Received on Wednesday, 28 January 2026 17:20:11 UTC