Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions css-view-transitions-2/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ spec:css2; type:dfn; text:viewport
This specification introduces a DOM API and associated CSS features
that allow developers to create animated visual transitions,
called <dfn export>view transitions</dfn>
between different states of a [=/document=],
between different states of a [=/document=] or an [=/element=],
or between distinct same-origin documents.

## Level 2 Updates ## {#intro-l2}
Expand All @@ -129,6 +129,7 @@ spec:css2; type:dfn; text:viewport
and more specifically based on the active view transition being of a certain type.
* [[#shared-style-with-vt-classes|Sharing styles between view transition pseudo-elements]], a way to declare a style once,
and use it for multiple view transition pseudo-elements. This includes the 'view-transition-class' property, and [[#pseudo-element-class-additions|additions to named pseudo-elements]]
* [[#scoped-vt|Scoped view transitions]], a way to perform view transitions within the scope of a DOM subtree.

## Separating Visual Transitions from DOM Updates ## {#separating-transitions}

Expand All @@ -155,10 +156,12 @@ spec:css2; type:dfn; text:viewport

## View Transition Customization ## {#customizing}

By default, <code>document.{{Document/startViewTransition()}}</code>
creates a [=view transition=] consisting of
a page-wide cross-fade between the two DOM states.
Developers can also choose which elements are captured independently
By default, <code>element.{{Element/startViewTransition()}}</code>
and <code>document.{{Document/startViewTransition()}}</code>
create a [=view transition=] consisting of a cross-fade of the entire
[=ViewTransition/root element=] between the two DOM states.

Developers can instead choose which descendant elements are captured independently
using the 'view-transition-name' CSS property,
allowing these to be animated independently of the rest of the page.
Since the transitional state (where both old and new visual captures exist)
Expand All @@ -171,12 +174,13 @@ spec:css2; type:dfn; text:viewport

A successful [=view transition=] goes through the following phases:

1. Developer calls <code>document.{{Document/startViewTransition}}({{ViewTransitionUpdateCallback|updateCallback}})</code>,
1. Developer calls <code>document.{{Document/startViewTransition}}({{ViewTransitionUpdateCallback|updateCallback}})</code>
or <code>element.{{Element/startViewTransition}}({{ViewTransitionUpdateCallback|updateCallback}})</code>,
which returns a {{ViewTransition}}, <var>viewTransition</var>.

1. Current state captured as the “old” state.

1. Rendering paused.
1. Rendering paused within the [=ViewTransition/root element=].

1. Developer's {{ViewTransitionUpdateCallback|updateCallback}} function, if provided, is called,
which updates the document state.
Expand Down