You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-view-transitions-2/Overview.bs
+18-13Lines changed: 18 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -557,28 +557,31 @@ When capturing the old or new state for an element, perform the following steps
557
557
### Setting up the view-transition in the old {{Document}} ### {#setup-old-document-vt}
558
558
559
559
<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.
562
564
563
565
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.
565
567
566
-
1. If |navigationType| is {{NavigationType/reload}}, then return.
568
+
1. If |navigationType| is {{NavigationType/reload}}, then return false.
567
569
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.
569
571
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.
572
573
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.
575
575
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:
578
581
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|.
580
583
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.
582
585
583
586
Note: We don't know yet if |newDocument| has opted in, as it might not be parsed yet.
584
587
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
644
647
* its [=active view transition=]'s [=ViewTransition/phase=] is "`done`".
645
648
646
649
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|.
647
652
</div>
648
653
649
654
### Accessing the view-transition in the new {{Document}} ### {#access-view-transition-in-new-doc}
0 commit comments