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

> What's the use case for the limitation of mandating that the types are identical on both sides?

Mostly complexity of the API. There are some things we set that are immutable and need to be known at the start of the transition, like the update callback for example. I figured types would be the same here. We use types during tag discovery, for example, which runs (and correct me if I'm wrong) outside of the lifecycle.

Here are some complexities for the developer to think about:
```
let transition = document.startViewTransition({
  type: ["foo"],
  update: ...
});
transition.typeList.Add("bar");
```

Would discover tags with just "foo", but then all other stages happen with "foo" and "bar". This also prevents the implementation from doing this as a separate task, but that's a smaller concern.

```
transition.updateCallbackDone.then(transition.types.Add("bar"))
transition.ready.then(transition.types.Add("bar"))
```

also happen to hit on two opposing sides of animate tag discovery, so they have different effects.


All in all, I just want to point out that the ability to mutate these types isn't "free", there are considerations we need to make. I'm fine with it if that's the consensus, but I don't want to take it as lightly as "why not"


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


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

Received on Wednesday, 15 November 2023 17:06:55 UTC