From 02fbadb6c946f8a215eb926ad5eff5a1a3303b6e Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Thu, 16 Oct 2025 10:33:12 +0100 Subject: [PATCH 1/2] [css-view-transitions-2] Resolve finished promise at own task when animations are done Closes #12442 --- css-view-transitions-2/Overview.bs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/css-view-transitions-2/Overview.bs b/css-view-transitions-2/Overview.bs index c0fe3bca1c1..60a069668df 100644 --- a/css-view-transitions-2/Overview.bs +++ b/css-view-transitions-2/Overview.bs @@ -3133,13 +3133,17 @@ To adjust nested view transition group transform given a |transform| - |document|'s [=pending animation event queue=] has any events associated with |animation|. - 1. If |hasActiveAnimations| is false: + 1. If |hasActiveAnimations| is false and transition|'s [=ViewTransition/phase=] to "`animating`", - 1. Set |transition|'s [=ViewTransition/phase=] to "`done`". + 1. Set |transition|'s [=ViewTransition/phase=] to "`pending-done`". - 1. [=Clear view transition=] |transition|. + 1. [=Queue a global task=] on the [=DOM manipulation task source=], + given |transition|'s [=relevant global object=], + to perform the following step: + If |transition|'s [=ViewTransition/phase=] is "`pending-done`", then: + 1. [=Resolve=] |transition|'s [=ViewTransition/finished promise=]. - 1. [=Resolve=] |transition|'s [=ViewTransition/finished promise=]. + 1. [=Clear view transition|clear=] |transition|. 1. Return. From 53169348a422a0ab192c10e5163404d3f2dd67f8 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Thu, 16 Oct 2025 10:34:39 +0100 Subject: [PATCH 2/2] Add phase --- css-view-transitions-2/Overview.bs | 1 + 1 file changed, 1 insertion(+) diff --git a/css-view-transitions-2/Overview.bs b/css-view-transitions-2/Overview.bs index 60a069668df..2cf2f8b3180 100644 --- a/css-view-transitions-2/Overview.bs +++ b/css-view-transitions-2/Overview.bs @@ -1788,6 +1788,7 @@ Issue: Is this updated by a rootEl.startViewTransition() call, too? 1. "`pending-capture`". 1. "`update-callback-called`". 1. "`animating`". + 1. "`pending-done`". 1. "`done`". Note: For the most part, a developer using this API does not need to worry about the different phases, since they progress automatically.