Skip to content

[css-view-transitions-1] Refactor skip during cross-doc transition on old Document #9611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 17, 2023
27 changes: 7 additions & 20 deletions css-view-transitions-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -949,22 +949,9 @@ 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|.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need this, no?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think skip transition calls this

Copy link
Member Author

@khushalsagar khushalsagar Nov 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skip the view transition is supposed to handle that here: https://drafts.csswg.org/css-view-transitions-1/#skip-the-view-transition:~:text=If%20transition%E2%80%99s%20phase%20is%20before%20%22update%2Dcallback%2Dcalled%22.

But I just realized we were not initializing phase. Fixed.


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 [=auto-skip view transitions=] is true,
then [=skip the view transition=] for |transition| with "{{InvalidStateError}}" {{DOMException}},
and return.

1. If |document|'s [=active view transition=] is not null,
then [=skip the view transition|skip that view transition=]
Expand Down Expand Up @@ -1051,7 +1038,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
Initially a new [=map=].

: <dfn>phase</dfn>
:: One of the following ordered phases:
:: One of the following ordered phases, initially "`pending-capture`":

1. "`pending-capture`".
1. "`update-callback-called`".
Expand Down Expand Up @@ -1649,16 +1636,15 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;

1. Let |document| be |transition|'s [=relevant global object's=] [=associated document=].

1. [=Assert=]: |document|'s [=document/active view transition=] is |transition|.

1. [=Assert=]: |transition|'s [=ViewTransition/phase=] is not "`done`".

1. If |transition|'s [=ViewTransition/phase=] is before "`update-callback-called`", then [=queue a global task=] on the [=DOM manipulation task source=],
given |transition|'s [=relevant global object=], to [=call the update callback=] of |transition|.

1. Set [=document/rendering suppression for view transitions=] to false.

1. [=Clear view transition=] |transition|.
1. If |document|'s [=document/active view transition=] is |transition|,
[=Clear view transition=] |transition|.

1. Set |transition|'s [=ViewTransition/phase=] to "`done`".

Expand Down Expand Up @@ -1948,6 +1934,7 @@ Changes from <a href="https://www.w3.org/TR/2023/WD-css-view-transitions-1-20230
* Animate back-drop filter similar to transform/size. See <a href="https://github.com/w3c/csswg-drafts/issues/9358">issue 9358</a>.
* Copy `color-scheme` from DOM element to ''::view-transition-group()''. See <a href="https://github.com/w3c/csswg-drafts/issues/9276">issue 9276</a>.
* 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>.

<h3 id="changes-since-2022-05-25">
Changes from <a href="https://www.w3.org/TR/2023/WD-css-view-transitions-1-20230525/">2022-05-25 Working Draft</a>
</h3>
Expand Down