Skip to content

[css-view-transitions-2] cross-document transition preceeds startViewTransition on outgoing page #9609

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 3 commits into from
Nov 17, 2023

Conversation

noamr
Copy link
Collaborator

@noamr noamr commented Nov 17, 2023

When starting a transition in an old page and there's a capture ongoing for a cross-document view transition, the programatically-created transition is automatically skipped, calling its callback and resolving the promises on the next task. The ready promise is rejected.

As per resolution.
Closes #9512

@noamr noamr requested review from khushalsagar and vmpstr November 17, 2023 15:35
Copy link
Member

Choose a reason for hiding this comment

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

Can you add the changes made here into the appendix as well "changes since " thing at the bottom

@noamr noamr merged commit 3499ece into w3c:main Nov 17, 2023
@noamr noamr deleted the vt-skip branch November 17, 2023 17:31
@@ -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=],
Copy link
Member

Choose a reason for hiding this comment

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

Indentation is off.

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=],
Copy link
Member

Choose a reason for hiding this comment

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

Should we be doing all this in a separate task or just the update callback dispatch? skip transition only makes running the callback async: https://drafts.csswg.org/css-view-transitions-1/#skip-the-view-transition.


1. [=Reject=] |transition|'s [=ViewTransition/ready promise=] with an "{{InvalidStateError}}" {{DOMException}}.

1. [=Mark as handled=] |transition|'s [=ViewTransition/ready promise=].
Copy link
Member

Choose a reason for hiding this comment

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

I thought this isn't needed, rejecting above will automatically mark it as handled?


1. [=Mark as handled=] |transition|'s [=ViewTransition/ready promise=].

1. [=Resolve=] |transition|'s [=ViewTransition/finished promise=].
Copy link
Member

Choose a reason for hiding this comment

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

In the default case, we mirror the result of update callback promise into finished. IIRC the rationale was that developers use the finished promise to execute code that should run when the DOM update was successful.

I sent a PR to refactor a bit so we can use the skip the view transition algo instead of repeating a bunch of same stuff here: #9611

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[css-view-transitions-2] Starting a same-doc view transition while a cross-doc view transition is pending
3 participants