Re: [csswg-drafts] [css-view-transitions-2] Behiavor of mismatching types between old and new document (#9526)

Those are excellent points @bokand! Another use-case to allow the new Document to specify types is render-blocking. The old Document doesn't know how much of the new Document will be fetched before the browser stops render-blocking. So letting the new Document add/specify types allows it to dynamically pick a fallback transition.

My preference would be option 1 or 2. Not leaning strongly on either of them. If we go with option 1 (only types from the new Document), authors can easily still do option 2 (union) by using `NavigationHistoryEntry`'s [`getState`](https://developer.mozilla.org/en-US/docs/Web/API/NavigationHistoryEntry/getState) API.

-----------
Btw, we might need to solve the use-case you mentioned (if it turns out to be common) regardless of this issue:

> However, I've since seen https://github.com/w3c/csswg-drafts/issues/8960#:~:text=Another%20option%20is%20to%20let%20the%20old%20Document%20be%20the%20decider%20but%20that%27s%20bad%20if%20the%20new%20Document%20chooses%20a%20different%20transition%20based%20on%20load%20state%20(transition%20to%20content%20if%20cache%20hit%20vs%20a%20loading%20screen). rebutting this. i.e. B can have transition-affecting state that A may not know about (e.g. cache hit vs. loading page).

If the UI on the new Document is going to be different based on whether there's a cache hit, that could influence which elements on the old Document have a `view-transition-name`. Navigation API could help here: we could expose a bit indicating the Document is cached or not for same-origin pages; or allow the Document to update `state` stored on its `NavigationHistoryEntry` when its being evicted.

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


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

Received on Monday, 13 November 2023 17:26:21 UTC