-
Notifications
You must be signed in to change notification settings - Fork 715
[css-view-transitions-2] Decide on naming for navigation-triggered view-transition rule #9383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'll add one to the list for consideration:
This remains specific to view-transitions but makes it clear it applies only to navigation-initiated and makes more sense for |
Yea, this is kind of like (4), I like it. will add to the list. thanks! |
@fantasai @jakearchibald @tabatkins @vmpstr @khushalsagar if you'd like to weigh in or add more options, and we can try to resolve this in one of the next WG calls. |
It's between 1. and 3. for me, with a slight preference to 3. The way I see this problem is we're either declaring something about the view transition, or we're declaring something about the navigation. 7 and 8 also blur the lines a bit and declare something about both. My preference is to talk about navigation here, and qualify it with something like same-origin or some other mechanism in the future. After we have sufficiently defined which navigation we're targeting, inside of it we say what we'd like to happen and here's where |
One thing I've pointed out elsewhere but want to record here. If we make this about the navigation then other navigation features may require adding qualifiers that view-transitions doesn't support. E.g. @navigation cross-origin {
view-transition: trigger;
some-other-feature-that-supports-cross-origin: enable;
} In this case I'm not sure how we'd surface the fact that the VT trigger isn't effective in this case? In a view-transitions syntax we'd simply disallow non-supported qualifiers (like |
Beginning to agree that trying to support future unknown things with this key rule is YAGNI that might end up creating more confusion than value. |
My favourite option so far is |
Proposing for the WG call: |
@fantasai @tabatkins since we didn't get to this in the CSSWG calls for several weeks, would you like to chime in here? |
One thought is that the naming likely depends in some ways on how you expect to extend this in the future. One concern about many of the proposals here is that it feels like they have a lot of future extension points (argument to at rule, adding new descriptors, adding new values to existing descriptors) and it's not clear to me how the possible uses of those extension points differ. The extension types that I see mentioned in #8048 are:
It might be helpful for group discussion to have a summary of the possible future extension areas and where you'd expect each one to fit in. (In particular, when I look at the above syntax options, I wonder whether there might be too many possible extension points, particularly when I see three places where there could later be multiple values but right now there's only one.) (I'm also a little confused by the term navigation-triggered, and curious when a navigation-triggered view transition is different from a cross-document view transition. Is one a subset of the other?) |
Thanks @dbaron, let me try to summarize. The extension points we see to this are what you mentioned:
To answer your other question, this is currently being triggered by cross-document navigations only, but an extension point could be enabling this for same-document navigations via the navigation API. My thought about that in particular is that it would probably not belong in CSS, but rather by some sort of JS opt-in that enables CSS navigation-triggered transitions for same-document navigaiton-API navs. It would be awkward if the author had the word So in short, this is about navigation-triggered view-transitions, where at this point it's enabled only for cross-document. See the OP for examples. |
+1 to dbaron, I think we need to think about the syntax with these extensions in mind. Wrt syntax proposals, here's a rough one:
This is pulling all the selection information into declarations, which gives us a bit more syntax to play with, and will probably make more complicated expressions easier to write. |
The CSS Working Group just discussed
The full IRC log of that discussion<bramus> noamr: continuation of TPAC convo about opt-in for VT on navigation<bramus> … we need to name it, and be clear how to extend int he future <bramus> … also worked with dbaron on this (thanks!) <bramus> … see the original post for code <bramus> … VT on navigation can be extended to a few diffferent parts <bramus> … 1 is name of the feature <bramus> … i call it “navigation-view-transition” <bramus> … other one is, if there any nav-performed VT, the way it can be extended is which navs does it supply to? <bramus> … from article to home? <bramus> … also type o fnavigation (reload, back, etc) <bramus> … so that is the first 2 things <bramus> … other one is “is this nav going to trigger a VT or not?” which is sort of a boolean you could say <bramus> … we might want to say it is, and then override with MQ (see example) <bramus> … from article to home it is one, but with a back navigation is off <bramus> …last thing is to extend for types. you can set a few idents to that classify the transition type and then use that in selectors <bramus> … elika proposed to also have the conditionals for navigation inside the rule <bramus> … which is also an option <bramus> … i think the conditional should b e outside (cfr. media query) but it is debatable <Rossen_> ack fantasai <bramus> fantasai: I tweaked the examples in the issue, so reload <bramus> … given conditioanals can be failry complicated: type, whereto, … – trying to cram that in the at-rule prelude is gnarly <bramus> … font is kinda a different concept: it is declaring a bunch of props that go together to define a conceptual font <bramus> … might make sense to take that mental model here <bramus> … define a transition with type+condition+etc as one package <bramus> … you end up with a pile of these, and take the last one that matches <bramus> … in terms of checking for navigation type (fwd, back, etc) is one thing, then there is also a URL-pattern scenario which can be a long list <emilio> q+ <bramus> … shoving all that in the prelude is going to be a mess I think <khush> q+ <bramus> astearns: OK, I see the problem you are outlining <bramus> noamr: proposal is to have a VT but no boolean but to say which navs trigger it and have a from-to and perhaps a list of types <astearns> s/astearns/Rossen_ / <bramus> Rossen_: I see <Rossen_> q? <bramus> fantasai: that resolves the awkwardness i thiknk <Rossen_> acm emilio <bramus> emilio: elika’s proposal sounds elegant. we are fine with not combininig different transition blocks <bramus> … we need to define an order, but one of them will match <bramus> fantasai: yeah, they should not cascade into each other <noamr> q+ <bramus> emilio: if you ahve different types (e.g reload then do this), my understanding was that the types would be added together <bramus> … with this proposal they would not? <bramus> fantasai: yeah. if you cascade them together you have a very big complex list. <bramus> … for navigating from there to here you don’t want to do ??? <bramus> … combining multiple types should be fine (cfr classes); i dont think they should cascade together <bramus> emilio: sgtm <Rossen_> ack khush <Rossen_> ack emilio <emilio> ack emilio <bramus> khush: the qualifiers after the at-rule, i wast hinking of them as a pseeudo-class that activates or not and depending on that the at-rule applies <bramus> … vs things inside the at-rule is what th eauthor is supplying <bramus> … if from and to are descriptors in the at-rule, is the mental model still the same? <bramus> … ??? <bramus> fantasai: from grouping at-rules, the conditioanls are on the outside yes <bramus> … other at-rules less strict, e.g. font-face <bramus> … the pile of properties that define the thing go in the block <bramus> … for VT this is something similary: navigation-vt has a bunch of info: url patterns, type of navigation, etc <bramus> … the UA should figure out which one that matches <bramus> … from the bottom up (i.e. last one wins) <emilio> q+ <bramus> khush: sounds like ??? which one matches latst value and apply that. we are thinking the same on this. if i try to read these values in JS, what from value would I read? <bramus> fantasai: might be nicer to read here: vtRule.from or vtRule.navigation or … i think this is easier as they are individual declarations <bramus> … they have accessors to each <bramus> Rossen_: let’s go over qeuue now <Rossen_> ack noamr <bramus> noamr: I like the idea, aligning with font-face is probably better than aligning with at-page <fantasai> s/grouping at-rules/grouping at-rules, which contain style rules inside them,/ <bramus> … i don’t know what the off-value would be. maybe `navigation: none`? <bramus> … i can see how this would work <Rossen_> ack dbaron <bramus> dbaron: im ok with it but want to call out one thing about analogy to font-face <bramus> … f-f rules are building up a dictionary or library that is then examinded by the font matching algo <bramus> … (explains) <bramus> … i am still ok with something that looks like it <Rossen_> ack emilio <bramus> emilio: if we go with condition in prelude or inside, we need to decide how complex it would be <bramus> … for simple conditions the prelude looks simpler, but many conditions seems easier in the block <bramus> … there could be 4 or 5 conditions <bramus> q+ <TabAtkins> +1 to emilio. Putting a name, or *one* type of check (a selector, a MQ, etc), in the prelude makes sense. More than that, keep things in the body for better syntax. <bramus> … i think i prefer fantasai’s proposal <Rossen_> ack fantasai <bramus> fantasai: to respond to dbaron: it is a good analogy. most ??? are conditional. the content you are pulling in is the src descriptor. font-style and font-weight are just conditionals. basically doing the same here. <TabAtkins> (I think @font-face *should* have put its family name in the prelude, but oh well, it was one of our first at-rules and we didn't have a consistent design yet.) <TabAtkins> s/???/declarations in the block/ <TabAtkins> scribe+ <fantasai> (Yeah, agreed, I'd have put font-family in the prelude also. But anyway...) <TabAtkins> bramus: If you put it in the prelude, you can most likely nest the various at-rules, which isnt' possible with a big block <Rossen_> ack bramus <TabAtkins> bramus: So if you want to change one param you have to duplicate everything and change one value <bramus> Rossen_: sounds like most ppl are agreeing … <khush> q+ <bramus> … should we take resolution? <Rossen_> ack khush <bramus> khush: fine with going the suggestion by fantasai. would be nice to take 2 separate resolutions: 1/ descriptors in at-rule block, 2/ names of things <bramus> PROPOSED RESOLUTION: take the descriptors in the at-rule block <bramus> RESOLVED: take the descriptors in the at-rule block <bramus> Rossen_: names should be bikeshed? <bramus> noamr: maybe resolve on current names? navigation: auto | none and the type <khush> q+ <Rossen_> ack khush <bramus> khush: `navigation-name` for the nav type? dont thikn we need that righ tnow <bramus> noamr: idea is we dont have all of them. right now would be a boolean (auto or none) which can be extended in the future <bramus> khush: rathe rnot name that navigation <bramus> … (missed) <bramus> Rossen_: let’s take back to the issue <bramus> noamr: OK |
For the upcoming naming discussion, @noamr clarified the idea on chat. Here it is with the proposed names:
|
- Use the `@view-transition { navigation: auto | none; type: ... }` syntax as per the resolution - `type: none` means that type is unspecified, needs a resolution - reloads are ignored as per previous resolution - Renamed the JS param "type" instead of "types" - Currently types are resolved both at old and new document separately, this needs a resolution. Closes w3c#9383 See resolution: w3c#9383 (comment)
* [css-view-transitions-2] Apply new CSS rule syntax - Use the `@view-transition { navigation: auto | none; type: ... }` syntax as per the resolution - `type: none` means that type is unspecified, needs a resolution - reloads are ignored as per previous resolution - Renamed the JS param "type" instead of "types" - Currently types are resolved both at old and new document separately, this needs a resolution. Closes #9383 See resolution: #9383 (comment) * Make resolving the inbound transition a separate algo * Extract algo that is to be used by HTML spec * Clean up spec, improve names
Mechanical rename of @view-transitions rule to match resolved changes in w3c/csswg-drafts#9383. Bug: 1463966 Change-Id: I8e9bf5565b435adae479bb959a27908f8e054b1b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5034018 Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1225131}
Updates navigation trigger based on resolutions in: w3c/csswg-drafts#9383 Namely: `navigation-trigger` becomes `navigation` `cross-document-same-origin` becomes `auto` Bug: 1463966 Change-Id: I79912d06c080b74ff8509d31605c66d4f3e1a995 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5033243 Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Commit-Queue: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/main@{#1225137}
Uh oh!
There was an error while loading. Please reload this page.
For context, see TPAC discussion as well of the rest of the conversation at #8048.
The resolution was that we would have an at-rule that defines the relationship between a navigation and a view-transition - for start, it would allow you to specify that any same-origin navigation results in triggering a view transition.
The final naming was left open.
The at rule is supposed to be extended in the future to convey the following things:
To structure this all into an @ rule, it would look something like
The previous resolution led us to
A few cons of the current resolution:
trigger: navigation
might be confusing, as currently the trigger is only cross-document navigations. However, when we want to enable same-document navigation transitions in the future, we probably don't want to have to change all the CSS that applies to it.Suggesting that:
Current suggestions (but open for more!):
@view-transition { trigger: navigation }
(what we settled on temporarily in the TPAC resolution).@view-transition-behavior { trigger: navigation }
@navigation-behavior { view-transition: trigger }
@nav-transition { behavior: trigger }
@view-transition navigation(same-origin) { behavior: trigger }
@auto-view-transition { trigger: navigation }
@navigation-view-transition { behavior: trigger; }
@navigation-view-transition { trigger: * }
(where * means the default type)If types are specified, it would look e.g. like
@navigation-view-transition { behavior: trigger; type: slide-in; }
I am currently leaning towards (7) as it conveys that it's a distinct feature.
which can later be extended to (for example):
The text was updated successfully, but these errors were encountered: