You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
consttransition=newSameDocumentTransition();transition.prepare(callback);awaittransition.finished;// Should this work:transition.prepare(differentCallback);
My gut feeling is that one SameDocumentTransition instance should be used for one same document transition.
However, Animation objects can be restarted once they're complete, and can even have their target & keyframes modified. For example, their finished promise changes when the animation is cancelled, or changes from a 'finished' state to a 'not-finished' state.
However I'm not sure this model makes sense here. SameDocumentTransitions are meant to be a transition between states, whereas animations can be ongoing within a single state.
Maybe this points to a bigger design issue with the API: Is there any point in creating a SameDocumentTransition without preparing it?
We could avoid this issue altogether with a design like this:
consttransition=document.stateTransition({asyncupdateState(){// Perform the DOM update// (like our prepare callback)},});awaittransition.ready;// Pseudos and animations are createdawaittransition.finished;// Transition is complete// transition.abandon() also exists
The text was updated successfully, but these errors were encountered:
We decided to not allow them to be reusable and its enforced in the spec text.
@jakearchibald did you still want to use this issue to track switching from a ctor to document.startTransition(..) so getting an object is coupled with starting a transition? Our last discussion was about both making sense, Animation allows you to construct and pass the object to lazily start the animation. I'm ok with the current ctor option and adding something like this later if needed.
My gut feeling is that one
SameDocumentTransition
instance should be used for one same document transition.However,
Animation
objects can be restarted once they're complete, and can even have their target & keyframes modified. For example, theirfinished
promise changes when the animation is cancelled, or changes from a 'finished' state to a 'not-finished' state.However I'm not sure this model makes sense here.
SameDocumentTransition
s are meant to be a transition between states, whereas animations can be ongoing within a single state.Maybe this points to a bigger design issue with the API: Is there any point in creating a
SameDocumentTransition
without preparing it?We could avoid this issue altogether with a design like this:
The text was updated successfully, but these errors were encountered: