Skip to content

Commit

Permalink
Move onReady to the correct place and rename
Browse files Browse the repository at this point in the history
  • Loading branch information
noamr committed Feb 13, 2024
1 parent fbb66f7 commit 4d40d9b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions css-view-transitions-2/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ When capturing the old or new state for an element, perform the following steps
</div>
<div algorithm>
To <dfn export>setup cross-document view-transition</dfn> given a {{Document}} |oldDocument|,
a {{Document}} |newDocument|, and |onReady|, which is an algorithm accepting nothing:
a {{Document}} |newDocument|, and |proceedWithNavigation|, which is an algorithm accepting nothing:

1. Let |resolvedRule| be the result of [=Resolve @view-transition rule|resolving the @view-transition rule=] for |oldDocument|.

Expand All @@ -602,7 +602,7 @@ When capturing the old or new state for an element, perform the following steps

Issue: should we check for the opt-in again, in case there was a CSSOM change in a requestAnimationFrame callback?

1. If |outboundTransition|'s [=ViewTransition/phase=] is "`done`", then call |onReady| and return.
1. If |outboundTransition|'s [=ViewTransition/phase=] is "`done`", then call |proceedWithNavigation| and return.

1. Assert: |outboundTransition|'s [=ViewTransition/phase=] is "`pending-capture`".

Expand All @@ -627,21 +627,21 @@ When capturing the old or new state for an element, perform the following steps

1. Set |inboundTransition|’s [=ViewTransition/phase=] to "`update-callback-called`".

1. Call |onReady|.

Note: The |inboundTransition| is activated after the dispatch of {{Window/pagereveal}} to ensure mutations made in this event apply to the captured new state.

1. At any given time, the UA may decide to skip |inboundTransition|, e.g. after an [=implementation-defined=] timeout.
To do so, the UA should [=queue a global task=] on the [=DOM manipulation task source=] given |newDocument|'s [=relevant global object=] to perform the following step:
If |transition|'s [=ViewTransition/phase=] is not "`done`", then [=skip the view transition=] |transition| with a "{{TimeoutError}}" {{DOMException}}.

Note: The |inboundTransition| is activated after the dispatch of {{Window/pagereveal}} to ensure mutations made in this event apply to the captured new state.

Note: |outboundTransition| is not exposed to JavaScript, it is used only for capturing
the state of the old document.

1. Set |oldDocument|'s [=active view transition=] to |outboundTransition|.

Note: The process continues in [=setup view transition=], via [=perform pending transition operations=].

1. Call |proceedWithNavigation|.

1. The user agent should display the currently displayed frame until either:
* The {{Window/pagereveal}} event is fired.
* its [=active view transition=]'s [=ViewTransition/phase=] is "`done`".
Expand Down

0 comments on commit 4d40d9b

Please sign in to comment.