Re: [csswg-drafts] [css-view-transitions-2] Declarative opt-in for cross-document navigations (#8048)

The CSS Working Group just discussed `[css-view-transitions-2] Declarative opt-in for cross-document navigations`, and agreed to the following:

* `RESOLVED: Accept the final syntax proposal.`

<details><summary>The full IRC log of that discussion</summary>
&lt;noamr> https://github.com/w3c/csswg-drafts/issues/8048#issuecomment-1716035713<br>
&lt;TabAtkins> noamr: Same as previous, I posted a comment that summarized current thinking and has some HAQs<br>
&lt;TabAtkins> noamr: this is about cross-document VT<br>
&lt;TabAtkins> noamr: the way we look at this, it's a conditional dependency<br>
&lt;TabAtkins> noamr: An if() statement that's called twice, once when you leave the old doc, and once when you're ready to render the new doc<br>
&lt;TabAtkins> noamr: when this event happens we want to check the conditions are met<br>
&lt;TabAtkins> noamr: Some are environmental, like from MQ or supports, others are conditions about navigation itself<br>
&lt;TabAtkins> noamr: Sematnically this could mean "are we moving from 'play' page to 'song' page"<br>
&lt;TabAtkins> noamr: If conditions are met we want to start the VT, as if we were in JS. On the old page that means capturing the state of the old document and magically passing it along to the new one.<br>
&lt;TabAtkins> noamr: So on the new page if we successfully opted in, we start the VT with the stuff we captured from the old doc<br>
&lt;TabAtkins> noamr: And w'ell pass the transition types that we just talked about<br>
&lt;TabAtkins> noamr: So if going between a playlist and song page, this is an "expand" transition<br>
&lt;TabAtkins> noamr: So these are ways to declaratively map what VT is taking place<br>
&lt;TabAtkins> noamr: We're thinking of the whole thing as a transition behavior that's activated from a navigation<br>
&lt;TabAtkins> noamr: As we decided in last f2f we wanted a new at-rule<br>
&lt;TabAtkins> noamr: Currently called @navigation<br>
&lt;TabAtkins> noamr: First cross-document thing in CSS, exciting<br>
&lt;TabAtkins> noamr: Details all in the comment<br>
&lt;TabAtkins> noamr: We qualify the navigation in some way<br>
&lt;TabAtkins> noamr: Inside of it we ahve descriptors, like font descriptors.<br>
&lt;TabAtkins> noamr: view-transition-behavior, and which type names are passed along<br>
&lt;TabAtkins> noamr: There was a q from elika yesterday why we went with a name like "same-origin", or why it has to be urls<br>
&lt;TabAtkins> noamr: We really dug into this quite deep<br>
&lt;TabAtkins> noamr: The first proposal in this sapce was we parse both docs, and they each declare what type they are<br>
&lt;TabAtkins> noamr: Doc A could say it's "playlist" and doc b could say it's "song", but that's complicated, you have to know what the new page is before you can unload the old page, which is too hard to do right<br>
&lt;TabAtkins> noamr: Second option was controller based<br>
&lt;TabAtkins> noamr: To decide based on what link was clicked<br>
&lt;TabAtkins> noamr: Too limiting, sometimes you click the back button. Sometimes you want a transition from a `location.href` mutation<br>
&lt;TabAtkins> noamr: So clicking is too limiting<br>
&lt;TabAtkins> noamr: All we ahve left is URLs<br>
&lt;TabAtkins> noamr: They're the one thing we're guaranteed to have in cross-document navigation<br>
&lt;TabAtkins> noamr: So we qualify these by URLs, it's the only thing we can do as far as we can tell.<br>
&lt;TabAtkins> noamr: Reason why we put same-origin there by default is we dno't support cross-origin or same-site yet, for various reasons.<br>
&lt;TabAtkins> noamr: We wanted, for the reader, for it to be clear that this is a same-origin navigation. Later it's expandable to various things like urlpattern<br>
&lt;TabAtkins> noamr: Or qualifying with back/reload/etc navigation types<br>
&lt;TabAtkins> noamr: We were asked for what kinds of things we expect to see in the future<br>
&lt;TabAtkins> noamr: We expect same things that exist in Navigation API. Type, URL, and incoming/outgoing url<br>
&lt;TabAtkins> noamr: So anything that could go into startViewTransition() could go here<br>
&lt;TabAtkins> noamr: Names of types go into sVT(), so they go here. Future args also go here.<br>
&lt;TabAtkins> noamr: If we do anything like mixins it'll reflect here<br>
&lt;TabAtkins> (Unsure what is meant by "mixins" here but I dont' think it's important)<br>
&lt;TabAtkins> noamr: We also have something called "navigation" here, pretty general<br>
&lt;TabAtkins> noamr: We didn't think building into @supports or anything was appropriate<br>
&lt;TabAtkins> noamr: Also questions about and/or here<br>
&lt;TabAtkins> noamr: Okay to not resolve that yet, just general behavior.<br>
&lt;TabAtkins> noamr: If our vision of declarative nav transitions makes sense, even if we don't resolve on details now, just want to validate that the syntax is extendable in this way<br>
&lt;TabAtkins> astearns: Just as a scoping thing, I think it's great to look at future extensions of the syntax, so thanks for htat<br>
&lt;TabAtkins> astearns: All you're asking for resolution on for now is @navigation with those descriptors, and only same-origin?<br>
&lt;TabAtkins> noamr: Just the same-origin descriptor, and the vt class names that we just resolved on<br>
&lt;TabAtkins> noamr: For more behavior, we'll wait to resolve those generally<br>
&lt;eeeps> q+<br>
&lt;astearns> ack fantasai<br>
&lt;TabAtkins> fantasai: I think we do need to have a good sense of the whole package and decide this looks good in general<br>
&lt;zcorpan> q+<br>
&lt;TabAtkins> fantasai: Just don't want us to decide on something, ship it, and then it looks awkward or doesn't actually expand as we needed.<br>
&lt;TabAtkins> fantasai: So just want to make sure this is what we want to do<br>
&lt;TabAtkins> fantasai: I have concerns with urlpatterns. Generally we're opaque to what url you actually are.<br>
&lt;TabAtkins> fantasai: Some features where we're breaking that<br>
&lt;TabAtkins> fantasai: But for something like this, you need full regex to capture these<br>
&lt;noamr> q+<br>
&lt;TabAtkins> fantasai: Like for a blog, recognizing a date in the url, etc<br>
&lt;noamr> URL patterns contain regular expressions<br>
&lt;TabAtkins> fantasai: And that won't work for websites with random ids<br>
&lt;TabAtkins> fantasai: I understand th eproblems with pages defining their own classes; I don't have a great answer<br>
&lt;TabAtkins> astearns: Noam's response is that urlpatterns do contain regexes<br>
&lt;fantasai> TabAtkins: URL patterns are being developed elsewhere for a lot of other use cases, we just need a subet<br>
&lt;fantasai> TabAtkins: I think it's fine<br>
&lt;fantasai> TabAtkins: While I also agree it's probably a bit awkward, it seems like the best way forward afaict<br>
&lt;TabAtkins> astearns: And whether or not that's correct, I think we can shoehorn *something* that does this matching between URLs into this at-rule later<br>
&lt;fantasai> TabAtkins: current extensability plan in the comment seems reasonable<br>
&lt;astearns> ack eeeps<br>
&lt;TabAtkins> eeeps: Is there time to wait for *anything* from the second doc? Like an http header, or an early &lt;meta>?<br>
&lt;TabAtkins> eeeps: Or is there just no way to keep the outgoing doc alive<br>
&lt;TabAtkins> noamr: We can keep it alive for a bit, and this can be a future extension to the rendering model<br>
&lt;TabAtkins> noamr: But we don't want to rely on it for how transitions are defined. It's kinda an advanced, complicated addition to the web platform.<br>
&lt;TabAtkins> noamr: It's like prerendering but more<br>
&lt;TabAtkins> noamr: So actually quite complicated to do right and cross-browser<br>
&lt;TabAtkins> noamr: So don't want to rely on it for now. Can be a future UX enhancement.<br>
&lt;TabAtkins> eeeps: So the incoming URL really is the only thing you can rely on from the incoming page, so far<br>
&lt;TabAtkins> noamr: correct<br>
&lt;TabAtkins> astearns: And this can be a future discussion since we're not resolving on that bit today<br>
&lt;astearns> ack zcorpan<br>
&lt;TabAtkins> zcorpan: syntax q about urlpattern<br>
&lt;TabAtkins> zcorpan: I think it's a string? URLs can conflict with CSS syntax.<br>
&lt;khush> q+<br>
&lt;fantasai> TabAtkins: absolutely. Never want to repeat the unqouted URL mistake again<br>
&lt;TabAtkins> TabAtkins: Oh yeah we're never repeating the "unquoted urls" problem again, I didn't notice that.<br>
&lt;astearns> ack noamr<br>
&lt;astearns> ack fantasai<br>
&lt;Zakim> fantasai, you wanted to comment on the classifying links idea<br>
&lt;TabAtkins> fantasai: you mentioned the idea of changing the transition based on which link you clicked. that sounds like something people might want<br>
&lt;TabAtkins> fantasai: would be something to consider, i guess would override this general routing<br>
&lt;TabAtkins> fantasai: Also, I think it would be more udnerstandable if this wasn't named generically "@navigation". Would be clearer what it's for, wouldn't have to repeat "view-transition" in each thing.<br>
&lt;TabAtkins> noamr: Yeah, qualifying a transition by the "controller" (link clicked) is osmething we lik ein general, it's just a different feature<br>
&lt;fantasai> and more clearly a separate namespace as e.g. 'view-transition-name'<br>
&lt;TabAtkins> noamr: So you can cusotmize by URL and by "last-active" link (Bramus' term)<br>
&lt;TabAtkins> noamr: I think those can be taken separately without conflict, we're on the sam epage<br>
&lt;TabAtkins> noamr: Reason I wanted to call it @navigation, two reasons but not integral<br>
&lt;TabAtkins> noamr: First it's a qualified navigation, not a qualified VT. Sounds wierd to say "same origin view transition"<br>
&lt;TabAtkins> noamr: Also sounds a bit funky to have "view transtion between these url patterns"<br>
&lt;TabAtkins> noamr: Also we envision this being general navigation customization later. If you want to hold the page for a little bit while loading the new one, that's a generic feautre, not VT-specific.<br>
&lt;TabAtkins> noamr: Also if we want to disallow UA transitions, this is a good way to do it.<br>
&lt;TabAtkins> noamr: Like swipe UI<br>
&lt;TabAtkins> noamr: So that's why we think a generic name is better<br>
&lt;astearns> ack khush<br>
&lt;TabAtkins> noamr: But we're also okay with saying "don't try to solve those future cases yet"<br>
&lt;fantasai> I think disabling UA transitions fits fine into an @view-transitions or @page-transitions rule<br>
&lt;TabAtkins> khush: Right now you say "same-origin"<br>
&lt;TabAtkins> khush: If you later have urls, "same-origin" is the same as a very general URL<br>
&lt;noamr> I kind of like @page-transitions<br>
&lt;noamr> q+<br>
&lt;TabAtkins> khush: I think I convinced mysefl against this, never mind<br>
&lt;fantasai> I kind of do too, except now I'm wondering if that might conflict with paged media page turn transitions :)<br>
&lt;fantasai> if we ever go there<br>
&lt;TabAtkins> khush: Also, the old document can be held, until you have a response header that says the navigation will be successful<br>
&lt;fantasai> could do @nav-transition<br>
&lt;TabAtkins> khush: that's the extent of info we have for now that we can provide to the old document<br>
&lt;fantasai> (we already abbreviation navigation to nav in the nav-properties)<br>
&lt;zcorpan> I don't like @page-transition because it sounds like it's related to @page<br>
&lt;astearns> ack noamr<br>
&lt;TabAtkins> agree, zcorpan<br>
&lt;TabAtkins> noamr: Some name bikesheds in IRC<br>
&lt;TabAtkins> noamr: Suggestion was "@page-transition", we have a "pageTransition" event in JS that is exactly this sort of thing.<br>
&lt;TabAtkins> noamr: But elika mentioned something about wanting to do a paged-media transition at some point, I'm not sure I udnerstand that.<br>
&lt;TabAtkins> zcorpan: Yeah but the existing @page is what clashes<br>
&lt;fantasai> we already have named pages in pagd media, so actually defining classes of transitions would be pretty straightforward...<br>
&lt;TabAtkins> astearns: REason to not use @view-transition?<br>
&lt;TabAtkins> noamr: Just think this is qualifying the navigation, not the view-transition.<br>
&lt;TabAtkins> zcorpan: You can do a view-transition without a nav, but this only does navigation VTs. So just "@view-transition" seems incorrect<br>
&lt;astearns> that makes sense<br>
&lt;TabAtkins> miriam: Is there a chance in the future that all VTs could be controlled here?<br>
&lt;TabAtkins> noamr: For @auto-view-transition, I think it could maybe be trigger by the Navigation API automatially<br>
&lt;zcorpan>  @auto-view-transition-on-navigation<br>
&lt;TabAtkins> noamr: One thing is we can call it @view-transition or @auto-view-transition, and then call the descriptor `trigger`, with values "navigation" or "none"<br>
&lt;TabAtkins> astearns: I think we have objections to @navigation, and anything with @page-*<br>
&lt;TabAtkins> astearns: We have @view-transitions or @auto-view-transitions<br>
&lt;TabAtkins> astearns: Other options?<br>
&lt;TabAtkins> khush: Why the "auto"?<br>
&lt;bramus> q+<br>
&lt;astearns> ack bramus<br>
&lt;TabAtkins> noamr: To make it clear this doesn't control VTs in general, specifically only those that are auto-created by the UA.<br>
&lt;TabAtkins> bramus: At the previous f2f I floated @config, it's super generic and could maybe apply here.<br>
&lt;zcorpan> @view-transition { trigger: navigation; ... } seems ok<br>
&lt;khush> +1<br>
&lt;TabAtkins> TabAtkins: One of the objections to @navigation was it was too generic, so going even more generic seems unlikely to work<br>
&lt;zcorpan> @view-transition same-origin { trigger: navigation; ... }<br>
&lt;noamr> @view-transition { trigger: navigation }<br>
&lt;noamr> @view-transition same-origin { trigger: navigation }<br>
&lt;fantasai> if it's not triggered by navigation, does same-origin still make sense?<br>
&lt;TabAtkins> noamr: Another thing we put to the side is we want this rule to be nestable in MQ<br>
&lt;khush> the other keyword trigger takes is "none".<br>
&lt;fantasai> TabAtkins: The moment a navigation happens is when you figure out when it happens<br>
&lt;fantasai> TabAtkins: having it be conditional on MQ makes sense<br>
&lt;TabAtkins> astearns: I think that's neough bikeshedding for today. Suggest we resovle on Noam's proposal in IRC, we can bikeshed later.<br>
&lt;TabAtkins> astearns: Any objection to `@view-transition same-origin { trigger: navigation | none; }`<br>
&lt;TabAtkins> RESOLVED: Accept the final syntax proposal.<br>
&lt;TabAtkins> fantasai: Wondering if the prelude and trigger should swap places. Unsure what `trigger: none` would do.<br>
&lt;TabAtkins> astearns: In interest of time, I suggest opening an issue for that.<br>
&lt;zcorpan> none would do nothing<br>
</details>


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


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

Received on Thursday, 14 September 2023 16:13:28 UTC