From 17acd1b1a3dd67b6049c0226f13542b882fd56be Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Fri, 17 Nov 2023 15:32:01 +0000 Subject: [PATCH 1/3] [css-view-transitions-2] cross-document transition preceeds startViewTransition on outgoing page Closes #9512 --- css-view-transitions-1/Overview.bs | 20 ++++++++++++++++++++ css-view-transitions-2/Overview.bs | 6 ++++++ 2 files changed, 26 insertions(+) diff --git a/css-view-transitions-1/Overview.bs b/css-view-transitions-1/Overview.bs index d90034be575..a3525cc6d91 100644 --- a/css-view-transitions-1/Overview.bs +++ b/css-view-transitions-1/Overview.bs @@ -949,6 +949,23 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface; 1. Let |document| be [=this's=] [=relevant global object's=] [=associated document=]. + 1. If |document|'s [=auto-skip view transitions=] is true, then: + + 1. [=Queue a global task=] on the [=DOM manipulation task source=], + given |transition|'s [=relevant global object=], + to execute the following steps: + + 1. [=Call the update callback=] for |transition|. + + 1. [=Reject=] |transition|'s [=ViewTransition/ready promise=] with an "{{InvalidStateError}}" {{DOMException}}. + + 1. [=Mark as handled=] |transition|'s [=ViewTransition/ready promise=]. + + 1. [=Resolve=] |transition|'s [=ViewTransition/finished promise=]. + + 1. Return |transition|. + + 1. If |document|'s [=active view transition=] is not null, then [=skip the view transition|skip that view transition=] with an "{{AbortError}}" {{DOMException}} in [=this's=] [=relevant Realm=]. @@ -1142,6 +1159,9 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface; with [=this=]'s [=document element=] is its [=originating element=]. Note: The position of the [=ViewTransition/transition root pseudo-element=] within the [=document element=] does not matter, as the [=ViewTransition/transition root pseudo-element=]'s [=containing block=] is the [=snapshot containing block=]. + + : auto-skip view transitions + :: A boolean. Initially false. ### Additions to Elements ### {#elements-concept} diff --git a/css-view-transitions-2/Overview.bs b/css-view-transitions-2/Overview.bs index 58a639a4f69..555b4174b34 100644 --- a/css-view-transitions-2/Overview.bs +++ b/css-view-transitions-2/Overview.bs @@ -502,6 +502,10 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule. Note: this means that any running transition would be skipped when the document is ready to unload. + 1. Set |document|'s [=auto-skip view transitions=] to true. + + Note: this means that calling {{Document/startViewTransition()}} while capturing the old document for a cross-document view-transition would fail. + 1. Let |outboundTransition| be a new {{ViewTransition}} object in |oldDocument|'s [=relevant Realm=], whose [=ViewTransition/active types=] is |resolvedRule|, and whose [=ViewTransition/process old state captured=] is set to the following steps: @@ -516,6 +520,8 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule. Note: The ViewTransition object on the old Document should be destroyed after its state has been copied to the new Document below. We explicitly clear it here since the old Document may be cached by the UA. + 1. Set |document|'s [=auto-skip view transitions=] to false. + 1. [=Queue a global task=] on the [=DOM manipulation task source=] given |newDocument|'s [=relevant global object=], to perform the following step: From 05af0b8191d4090b820a6d65fbdf22ee1d547cc6 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Fri, 17 Nov 2023 17:11:44 +0000 Subject: [PATCH 2/3] Add to change list --- css-view-transitions-1/Overview.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css-view-transitions-1/Overview.bs b/css-view-transitions-1/Overview.bs index a3525cc6d91..7f084ba5823 100644 --- a/css-view-transitions-1/Overview.bs +++ b/css-view-transitions-1/Overview.bs @@ -1947,7 +1947,7 @@ Changes from issue 9365. * Animate back-drop filter similar to transform/size. See issue 9358. * Copy `color-scheme` from DOM element to ''::view-transition-group()''. See issue 9276. - +* Expose [=auto-skip view transition=] for a {{Document}}, to allow having outbound cross-document transitions preceed programmatic view transiitons. see issue 9512.

Changes from 2022-05-25 Working Draft

From 7901e7993cf2d6e0cc449be1b038360a85438c4e Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Fri, 17 Nov 2023 17:24:09 +0000 Subject: [PATCH 3/3] Reapply --- css-view-transitions-2/Overview.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css-view-transitions-2/Overview.bs b/css-view-transitions-2/Overview.bs index 555b4174b34..34c646c6f65 100644 --- a/css-view-transitions-2/Overview.bs +++ b/css-view-transitions-2/Overview.bs @@ -504,7 +504,7 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule. 1. Set |document|'s [=auto-skip view transitions=] to true. - Note: this means that calling {{Document/startViewTransition()}} while capturing the old document for a cross-document view-transition would fail. + Note: this means that calling {{Document/startViewTransition()}} while capturing the old document for a cross-document view-transition would run the callback but skip the animation. 1. Let |outboundTransition| be a new {{ViewTransition}} object in |oldDocument|'s [=relevant Realm=], whose [=ViewTransition/active types=] is |resolvedRule|, and whose [=ViewTransition/process old state captured=] is set to the following steps: