Skip to content

Commit 3499ece

Browse files
authored
[css-view-transitions-2] cross-document transition preceeds startViewTransition on outgoing page (#9609)
* [css-view-transitions-2] cross-document transition preceeds startViewTransition on outgoing page Closes #9512 * Add to change list * Reapply
1 parent eaf7fdd commit 3499ece

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

‎css-view-transitions-1/Overview.bs

+21-1
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,23 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
949949

950950
1. Let |document| be [=this's=] [=relevant global object's=] [=associated document=].
951951

952+
1. If |document|'s [=auto-skip view transitions=] is true, then:
953+
954+
1. [=Queue a global task=] on the [=DOM manipulation task source=],
955+
given |transition|'s [=relevant global object=],
956+
to execute the following steps:
957+
958+
1. [=Call the update callback=] for |transition|.
959+
960+
1. [=Reject=] |transition|'s [=ViewTransition/ready promise=] with an "{{InvalidStateError}}" {{DOMException}}.
961+
962+
1. [=Mark as handled=] |transition|'s [=ViewTransition/ready promise=].
963+
964+
1. [=Resolve=] |transition|'s [=ViewTransition/finished promise=].
965+
966+
1. Return |transition|.
967+
968+
952969
1. If |document|'s [=active view transition=] is not null,
953970
then [=skip the view transition|skip that view transition=]
954971
with an "{{AbortError}}" {{DOMException}} in [=this's=] [=relevant Realm=].
@@ -1142,6 +1159,9 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
11421159
with [=this=]'s [=document element=] is its [=originating element=].
11431160

11441161
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=].
1162+
1163+
: <dfn export>auto-skip view transitions</dfn>
1164+
:: A boolean. Initially false.
11451165
</dl>
11461166

11471167
### Additions to Elements ### {#elements-concept}
@@ -1927,7 +1947,7 @@ Changes from <a href="https://www.w3.org/TR/2023/WD-css-view-transitions-1-20230
19271947
* The [=view transition tree=] is not exposed to accessibility tree. See <a href="https://github.com/w3c/csswg-drafts/issues/9365">issue 9365</a>.
19281948
* Animate back-drop filter similar to transform/size. See <a href="https://github.com/w3c/csswg-drafts/issues/9358">issue 9358</a>.
19291949
* Copy `color-scheme` from DOM element to ''::view-transition-group()''. See <a href="https://github.com/w3c/csswg-drafts/issues/9276">issue 9276</a>.
1930-
1950+
* Expose [=auto-skip view transition=] for a {{Document}}, to allow having outbound cross-document transitions preceed programmatic view transiitons. see <a href="https://github.com/w3c/csswg-drafts/issues/9512">issue 9512</a>.
19311951
<h3 id="changes-since-2022-05-25">
19321952
Changes from <a href="https://www.w3.org/TR/2023/WD-css-view-transitions-1-20230525/">2022-05-25 Working Draft</a>
19331953
</h3>

‎css-view-transitions-2/Overview.bs

+6
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,10 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule.
502502
Note: this means that any running transition would be skipped when the document is ready
503503
to unload.
504504

505+
1. Set |document|'s [=auto-skip view transitions=] to true.
506+
507+
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.
508+
505509
1. Let |outboundTransition| be a new {{ViewTransition}} object in |oldDocument|'s [=relevant Realm=],
506510
whose [=ViewTransition/active types=] is |resolvedRule|, and whose [=ViewTransition/process old state captured=] is set to the following steps:
507511

@@ -516,6 +520,8 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule.
516520
Note: The ViewTransition object on the old Document should be destroyed after its state has been copied to the new Document below.
517521
We explicitly clear it here since the old Document may be cached by the UA.
518522

523+
1. Set |document|'s [=auto-skip view transitions=] to false.
524+
519525
1. [=Queue a global task=] on the [=DOM manipulation task source=] given |newDocument|'s [=relevant global object=],
520526
to perform the following steps:
521527

0 commit comments

Comments
 (0)