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

Discussion summary for the different options:

1. apply only types specified in the new document (override)
   This option is easiest to reason about, the type is a document-scoped property. So new Document gets the type in its declaration only. It would also work if the transition type depends on parameters the new Document is aware of: navigation type and from URL.

2. apply both the types in the old and new documents (union)
   This option helps with use-cases where the from URL is not enough to define the transition type. For example, a different transition happens if the user scrolls to a particular element or interacts with the page. We could use some use-cases to understand how common this is. There are ways to polyfill this in script (examples below) so this option would be a more declarative way to do something feasible in script:
   
   - Send info about the old Document's state to the new Document via other APIs. For example, https://github.com/whatwg/html/issues/9760 will provide a reference to the last navigation entry on the new Document which has `getState()` for arbitrary information. Though that won't work for `location.replace` cases where the from navigation entry is not preserved. @jakearchibald did you say there's a workaround for this?
   
  - Can also be done with session storage.

3. apply only the types that are in both documents (intersection)
   The downside of this option is that the old Document needs to add a type for all possible states the new Document could be served in. And this might be dependent on state on the server.

4. fail the transition if the types don't match
   Same con as above. There is a legit use-case here to use types to detect a change in website version (if a deployment happened before the transition starts). But seems better to use an explicit "version" descriptor for it.

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


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

Received on Tuesday, 7 November 2023 16:23:44 UTC