diff --git a/css-view-transitions-2/Overview.bs b/css-view-transitions-2/Overview.bs
index d1d10f1530d..f8201e1488a 100644
--- a/css-view-transitions-2/Overview.bs
+++ b/css-view-transitions-2/Overview.bs
@@ -118,7 +118,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
1. Once it's time to [=unload=] the old document, if the navigation is [=same origin=]
and the old {{Document}} has opted in to cross-document view-transitions, the old state is captured.
- 1. An event named {{RevealEvent|reveal}} is fired on the new {{Document}}, with a `viewTransition` property,
+ 1. An event named {{PageRevealEvent|reveal}} is fired on the new {{Document}}, with a `viewTransition` property,
which is a {{ViewTransition}} object. This {{ViewTransition}}'s {{ViewTransition/updateCallbackDone}}
is already resolved,
and its [=captured elements=] are populated from the old {{Document}}.
@@ -137,8 +137,8 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
```css
// in both documents:
- @view-transition same-origin {
- trigger: navigation;
+ @view-transition {
+ navigation: auto;
}
```
@@ -153,12 +153,12 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
- Opt-in to navigation-triggered view-transitions in both pages.
- Pass the click location to the new document, e.g. via {{WindowSessionStorage/sessionStorage}}.
- - Intercept the {{ViewTransition}} object in the new document, using the {{RevealEvent}}.
+ - Intercept the {{ViewTransition}} object in the new document, using the {{PageRevealEvent}}.
In both pages:
```css
- @view-transition same-origin {
- trigger: navigation;
+ @view-transition {
+ navigation: auto;
}
```
@@ -263,7 +263,7 @@ document.startViewTransition({update: updateTheDOMSomehow});
The ''@view-transition'' rule is used by a document to indicate that cross-document navigations
should setup and activate a {{ViewTransition}}. To take effect, it must be present in the old document
-when unloading, and in the new document when it is [=ready to render=].
+when unloading, and in the new document when it is [=reveal=].
## @view-transition rule grammar ## {#view-transition-grammar}
@@ -271,64 +271,73 @@ when unloading, and in the new document when it is [=ready to render=].
The ''@view-transition'' rule has the following syntax:
- @view-transition same-origin { + @view-transition { <-Note: currently> }
same-origin
has to be present, as a future placeholder for customizing
-the navigation behavior based on the URL.
-
Note: as per default behavior, the ''@view-transition'' rule can be nested inside a
[=conditional group rule=] such as ''@media'' or ''@supports''.
-## The [=@view-transition/trigger=] property ## {#view-transition-trigger-descriptor}
+## The [=@view-transition/navigation=] descriptor ## {#view-transition-navigation-descriptor}
- Name: trigger + Name: navigation For: @view-transition - Value: navigation | none + Value: auto | none Initial: none- The 'trigger' property opts in to automatically starting a view transition when performing a navigation. - It needs to be enabled both in the old document (when unloading) and in the new document (when ready to render). + The 'navigation' descriptor opts in to automatically starting a view transition when performing a navigation of a certain type. + It needs to be enabled both in the old document (when unloading) and in the new document (when reveal). -
+ Name: type + For: @view-transition + Value: <+ + The 'type' descriptor sets the [=ViewTransition/active types=] for the transition + when capturing and performing the transition, equivalent to calling {{Document/startViewTransition(callbackOptions)}} with that {{StartViewTransitionOptions/type}}. + Omitting the ''@view-transition/type'' descriptor is equivalent to calling {{Document/startViewTransition(callbackOptions)}} without a {{StartViewTransition/type}}. # API # {#api} -## The RevealEvent ## {#ready-to-render-event} +## The PageRevealEvent ## {#ready-to-render-event} Note: this should go in the HTML spec. See [Issue 9315](https://github.com/whatwg/html/issues/9315).>+ + Initial: n/a +
pagereveal
at |document|'s [=relevant global object=],
+ using {{PageRevealEvent}}, with [=PageRevealEvent/view transition=] initialized to .
- 1. If |transition| is not null and |document| does not [=opt in to cross-document view transitions=], then [=skip the view transition|skip=] |transition| and set |transition| to null.
+ 1. Set |document|'s [=document/page pagereveal fired=] to true.
+ reveal
on |document|'s [=relevant global object=],
- using {{RevealEvent}}.
+ 1. Let |matchingRule| be the last ''@view-transition'' rule in |document| which has a ''@view-transition/navigation'' descriptor whose [=computed value=] is ''@view-transition/navigation/auto''.
- 1. If |transition| is not null, then [=activate view transition|activate=] |transition|.
+ 1. If |matchingRule| is not found, then return "not found
".
- 1. Set |document|'s [=document/ready to render fired=] to true.
+ 1. If |matchingRule| contains a ''@view-transition/type'' descriptor, then return a [=list=] of strings corresponding to that descriptor's [=computed value=].
+
+ 1. Return null.
not found
", then call |onReady| and return.
Note: We don't know yet if |newDocument| has opted in, as it might not be parsed yet.
- We check the opt-in for |newDocument| when it is [=ready to render=].
+ We check the opt-in for |newDocument| when it is [=reveal=].
1. If |oldDocument|'s [=active view transition=] is not null,
then [=skip the view transition|skip=] |oldDocument|'s [=active view transition=]
@@ -466,7 +492,7 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule.
to unload.
1. Let |outboundTransition| be a new {{ViewTransition}} object in |oldDocument|'s [=relevant Realm=],
- whose [=ViewTransition/process old state captured=] is set to the following steps:
+ whose [=ViewTransition/active types=] is |resolvedRule|, and whose [=ViewTransition/process old state captured=] is set to the following steps:
Issue: should we check for the opt-in again, in case there was a CSSOM change in a requestAnimationFrame callback?
@@ -499,8 +525,10 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule.
Note: The process continues in [=setup view transition=], via [=perform pending transition operations=].
navigation
.
+ 1. If |resolvedRule| is "not found
", then [=skip the view transition|skip=] |transition| and return null.
+
+ 1. Set |transition|'s [=ViewTransition/active types=] to |resolvedRule|.
+
+ 1. [=activate view transition|Activate=] |transition|.
+
+ 1. Return |transition|.