[csswg-drafts] [css-view-transitions-1] Handling DOM updates when a transition's animation is reverse back to start/canceled (#7957)

ydaniv has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-view-transitions-1] Handling DOM updates when a transition's animation is reverse back to start/canceled ==
Consider a case where the user has interacted with a page in a way which caused the animation playing in reverse back to the start, or was seeked back to start, like mentioned [here](https://github.com/w3c/csswg-drafts/issues/7785#issuecomment-1279473860) for example. In such case the animation would either finish back on the "old" state or get `cancel()`'ed by the author, and should result in showing the "old" DOM again.

Such a case will require additional DOM update to render back previous state, prior to transition start. This may be both tricky for the author to handle, and slow since the transition finishes but the DOM's state isn't ready beforehand.

I see several options here:

1. User needs to create a new ViewTransition back to previous state - same as a "back" navigation - which will trigger the flow of a new transition starting and aborting the current one.
2. The browser can somehow cache the old DOM (like in a `DocumentFragment`s or something?) - either declaratively or magically - for a quick reinsertion (though a framework would still need to "rehydrate" that).
3. Provide other endpoints on the current API for such a case.

Not sure which, I guess 1 could be the easiest default perhaps.

cc @jakearchibald @khushalsagar @vmpstr 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7957 using your GitHub account


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

Received on Wednesday, 26 October 2022 10:38:31 UTC