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

> The same argument for reasonable defaults (which I think is consistent with a lot of CSS) goes for having reloads be same-origin only by default.

My concern wasn't with the default, but whether the non-default case is possible : reload with a same-site navigation. In general, I'd say our syntax should ensure that any combination of mutually exclusive navigation params (same vs cross doc, from/to url and nav type) can be expressed. We should have a good reason to disallow a combination and it being an edge case is not a good one.

The syntax @vmpstr proposed above sounds good in that regard. One thing I'd say is to include `<<doc-change>>` to the qualifier as well.

```
@view-transition <<route>> <<navtype>> <<doc-change>> { ... }
```
where

```
<<doc-change>> = "same-document | cross-document"
```

A few more clarifications around it:
- Each at-rule declaration must provide a route, nav type and doc-change. If not supplied, there will be a default.
- The relationship between each qualifier is "and", i.e., the at-rule reads as "navigation to url(a) and back".
- The default for route is same-origin, nav type is all navigations excluding reload and doc-change is cross-document.

@noamr does that sound reasonable to you?

If the above sounds good then a couple of questions come to mind:
- I'm assuming we'll allow an "or" type syntax for each qualifier for use-cases like `from: urlpattern(a),urlpattern(b)`. But the relationship between qualifiers is and. So if you want the rule to say "back or navigation to urlpattern(a)", that needs 2 at-rule declarations. That sounds fine to me, just wanted to confirm.
- Why do we need to require the "same-origin" qualifier? Sounds like similar to nav type, the default value of same-origin avoids the need for it.

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


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

Received on Thursday, 28 September 2023 19:16:06 UTC