Skip to content

Commit e48ebbd

Browse files
authored
[css-view-transitions-2] Separte MPA transition start from check (#9819)
* [css-view-transitions-2] Separte MPA transition start from check * change algorithm title * Change things a bit * nits
1 parent 99403a8 commit e48ebbd

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

css-view-transitions-2/Overview.bs

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -557,28 +557,31 @@ When capturing the old or new state for an element, perform the following steps
557557
### Setting up the view-transition in the old {{Document}} ### {#setup-old-document-vt}
558558

559559
<div algorithm>
560-
To <dfn export>setup cross-document view-transition</dfn> given a {{Document}} |oldDocument|,
561-
a {{Document}} |newDocument|, a {{NavigationType}} |navigationType|, a boolean |isBrowserUINavigation|, and |onReady|, which is an algorithm accepting nothing:
560+
To check if a <dfn export>navigation can trigger a cross-document view-transition?</dfn> given
561+
an [=origin=] |oldOrigin|, an [=origin=] |newOrigin|, a boolean |navigationHasCrossOriginRedirects|, a {{NavigationType}} |navigationType|, and a boolean |isBrowserUINavigation|:
562+
563+
Note: this is called during navigation, potentially [=in parallel=], for documents that have opted-in to view-transitions using the ''@view-transition'' rule.
562564

563565
1. If the user agent decides to display an [=implementation-defined=] navigation experience, e.g. a gesture-based transition for a back navigation,
564-
the user agent may ignore the author-defined view transition. If that is the case, return.
566+
the user agent may ignore the author-defined view transition. If that is the case, return false.
565567

566-
1. If |navigationType| is {{NavigationType/reload}}, then return.
568+
1. If |navigationType| is {{NavigationType/reload}}, then return false.
567569

568-
1. If |isBrowserUINavigation| is true, and |navigationType| is {{NavigationType/push}} or {{NavigationType/replace}}, then return.
570+
1. If |isBrowserUINavigation| is true, and |navigationType| is {{NavigationType/push}} or {{NavigationType/replace}}, then return false.
569571

570-
1. If |oldDocument|'s [=environment settings object/origin=] is not [=same origin=] as
571-
|newDocument|'s [=environment settings object/origin=] then call |onReady| and return.
572+
1. If |oldOrigin| is not [=same origin=] as |newOrigin| then return false.
572573

573-
1. If |newDocument| [=was created via cross-origin redirects=] is true
574-
and |newDocument|'s [=latest entry=] is null, then call |onReady| and return.
574+
1. If |navigationHasCrossOriginRedirects| is true, then return false.
575575

576-
Note: A document with a non-null [=latest entry=]
577-
is being [=Document/reactivated=], in which case we don't need to check for cross-origin redirects.
576+
1. Return true.
577+
</div>
578+
<div algorithm>
579+
To <dfn export>setup cross-document view-transition</dfn> given a {{Document}} |oldDocument|,
580+
a {{Document}} |newDocument|, and |onReady|, which is an algorithm accepting nothing:
578581

579-
1. [=Resolve @view-transition rule=] for |oldDocument| and let |resolvedRule| be the result.
582+
1. Let |resolvedRule| be the result of [=Resolve @view-transition rule|resolving the @view-transition rule=] for |oldDocument|.
580583

581-
1. If |resolvedRule| is "<code>skip transition</code>", then call |onReady| and return.
584+
1. If |resolvedRule| is "<code>skip transition</code>", then return null.
582585

583586
Note: We don't know yet if |newDocument| has opted in, as it might not be parsed yet.
584587
We check the opt-in for |newDocument| when we fire the {{Window/pagereveal}} event.
@@ -644,6 +647,8 @@ When capturing the old or new state for an element, perform the following steps
644647
* its [=active view transition=]'s [=ViewTransition/phase=] is "`done`".
645648

646649
Note: this is to ensure that there are no unintended flashes between displaying the old and new state, to keep the transition smooth.
650+
651+
1. Return |outboundTransition|.
647652
</div>
648653

649654
### Accessing the view-transition in the new {{Document}} ### {#access-view-transition-in-new-doc}

0 commit comments

Comments
 (0)