Skip to content

Commit e695902

Browse files
noamrkhushalsagar
andauthored
[css-view-transitions-1][css-view-transitions-2] Initial draft for cross-document view transitions (#9022)
* WIP css-view-transitions-2 * Add examples * Update css-view-transitions-2/Overview.bs Co-authored-by: Khushal Sagar <63884798+khushalsagar@users.noreply.github.com> * Update css-view-transitions-2/Overview.bs Co-authored-by: Khushal Sagar <63884798+khushalsagar@users.noreply.github.com> * Update css-view-transitions-2/Overview.bs Co-authored-by: Khushal Sagar <63884798+khushalsagar@users.noreply.github.com> * Many PR changes * Add Vlad * Make it explicit when we capture the old state * Fix biblio ref * Move HTML monkey patch * Clarify HTML entry point in old document * Bring back render-blocked check * Update css-view-transitions-1/Overview.bs Co-authored-by: Khushal Sagar <63884798+khushalsagar@users.noreply.github.com> * Update css-view-transitions-1/Overview.bs Co-authored-by: Khushal Sagar <63884798+khushalsagar@users.noreply.github.com> * Update css-view-transitions-2/Overview.bs Co-authored-by: Khushal Sagar <63884798+khushalsagar@users.noreply.github.com> * Update css-view-transitions-2/Overview.bs Co-authored-by: Khushal Sagar <63884798+khushalsagar@users.noreply.github.com> * Fix many PR comments * Call ready callback on skip * Few nits * Fix calling the process old state captured callback * Unintended edit * Clear ViewTransition on old doc for BFCache --------- Co-authored-by: Khushal Sagar <63884798+khushalsagar@users.noreply.github.com>
1 parent e7734da commit e695902

File tree

2 files changed

+431
-0
lines changed

2 files changed

+431
-0
lines changed

css-view-transitions-1/Overview.bs

+15
Original file line numberDiff line numberDiff line change
@@ -1048,8 +1048,19 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
10481048
Note: This is used to detect changes in the [=snapshot containing block size=],
10491049
which causes the transition to [=skip the view transition|skip=].
10501050
[Discussion of this behavior](https://github.com/w3c/csswg-drafts/issues/8045).
1051+
1052+
: <dfn>old state captured steps</dfn>
1053+
:: An algorithm accepting nothing, or null.
1054+
Initially null.
1055+
1056+
Note: this is used for cross-document view transitions.
10511057
</dl>
10521058

1059+
A {{ViewTransition}} must never have both an [=ViewTransition/update callback=] and a [=ViewTransition/old state captured steps=].
1060+
1061+
Note: [=ViewTransition/update callback=] is optionally set for same-document view transitions,
1062+
and [=ViewTransition/old state captured steps=] is set for cross-document view transitions.
1063+
10531064
The {{ViewTransition/finished}} [=getter steps=] are to return [=this's=] [=ViewTransition/finished promise=].
10541065

10551066
The {{ViewTransition/ready}} [=getter steps=] are to return [=this's=] [=ViewTransition/ready promise=].
@@ -1207,6 +1218,8 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
12071218
If failure is returned, then [=skip the view transition=] for |transition| with an "{{InvalidStateError}}" {{DOMException}} in |transition|'s [=relevant Realm=],
12081219
and return.
12091220

1221+
1. If |transition|'s [=ViewTransition/process old state captured=] is not null, then call [=ViewTransition/process old state captured=] and return.
1222+
12101223
1. Set |document|'s [=document/rendering suppression for view transitions=] to true.
12111224

12121225
1. [=Queue a global task=] on the [=DOM manipulation task source=],
@@ -1587,6 +1600,8 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
15871600
Note: Since the rejection of |transition|'s [=ViewTransition/update callback done promise=] isn't explicitly handled here,
15881601
if |transition|'s [=ViewTransition/update callback done promise=] rejects,
15891602
then |transition|'s [=ViewTransition/finished promise=] will reject with the same reason.
1603+
1604+
1. If |transition|'s [=ViewTransition/process old state captured=] is not null, then call |transition|'s [=ViewTransition/process old state captured=].
15901605
</div>
15911606

15921607
## [=Capture the image=] ## {#capture-the-image-algorithm}

0 commit comments

Comments
 (0)