Skip to content

Editorial review: Document element-scoped view transitions#44217

Open
chrisdavidmills wants to merge 8 commits into
mdn:mainfrom
chrisdavidmills:element-scoped-view-transitions
Open

Editorial review: Document element-scoped view transitions#44217
chrisdavidmills wants to merge 8 commits into
mdn:mainfrom
chrisdavidmills:element-scoped-view-transitions

Conversation

@chrisdavidmills
Copy link
Copy Markdown
Contributor

@chrisdavidmills chrisdavidmills commented May 21, 2026

Description

Chrome 147 adds support for element-scoped view transitions; see https://chromestatus.com/feature/5109852273377280. This PR documents this new feature.

Specifically, it adds:

  • A guide covering element-scoped view transitions
  • An Element.startViewTransition() ref page
  • An Element.activeViewTransition ref page
  • A ViewTransition.transitionRoot ref page
  • A view-transition-scope ref page

Motivation

Additional details

Related issues and pull requests

@chrisdavidmills chrisdavidmills requested review from a team as code owners May 21, 2026 20:17
@chrisdavidmills chrisdavidmills requested review from dipikabh and removed request for a team May 21, 2026 20:17
@github-actions github-actions Bot added Content:WebAPI Web API docs size/l [PR only] 501-1000 LoC changed labels May 21, 2026
@chrisdavidmills chrisdavidmills changed the title Document element-scoped view transitions Technical review: Document element-scoped view transitions May 21, 2026
@chrisdavidmills chrisdavidmills marked this pull request as draft May 21, 2026 20:18
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

Preview URLs (12 pages)

Flaws (2)

Note! 10 documents with no flaws that don't need to be listed. 🎉

Found an unexpected or unresolvable flaw? Please report it here.

URL: /en-US/docs/Web/API/Element
Title: Element
Flaw count: 1

  • macros:
    • Macro domxref produces link /en-US/docs/Web/API/Element/getBoxQuads which doesn't resolve

URL: /en-US/docs/Web/API/View_Transition_API/Using
Title: Using the View Transition API
Flaw count: 1

  • macros:
    • Macro domxref produces link /en-US/docs/Web/API/Promise which is a redirect
External URLs (3)

URL: /en-US/docs/Web/API/View_Transition_API
Title: View Transition API


URL: /en-US/docs/Web/API/View_Transition_API/Using_element-scoped
Title: Using element-scoped view transitions

(comment last updated: 2026-05-25 17:18:34)

@github-actions github-actions Bot added Content:CSS Cascading Style Sheets docs size/xl [PR only] >1000 LoC changed and removed size/l [PR only] 501-1000 LoC changed labels May 22, 2026
@chrisdavidmills chrisdavidmills marked this pull request as ready for review May 22, 2026 17:34

- `updateCallback` {{optional_inline}}
- : An optional callback function typically invoked to update the DOM during the SPA view transition process, which returns a {{jsxref("Promise")}}. The callback is invoked once the API has taken a snapshot of the current page. When the promise returned by the callback fulfills, the view transition begins in the next frame. If the promise returned by the callback rejects, the transition is abandoned.
- : An callback function, invoked to update the DOM during the SPA view transition process, which returns a {{jsxref("Promise")}}. The callback is invoked once the API has taken a snapshot of the current page. When the promise returned by the callback fulfills, the view transition begins in the next frame. If the promise returned by the callback rejects, the transition is abandoned.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An callback -> A callback

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed; ta!


## Description

When a view transition is triggered, as part of [the process](/en-US/docs/Web/API/View_Transition_API/Using#the_view_transition_process), the browser captures snapshots of elements that have a non-`none` {{cssxref("view-transition-name")}} set on them. These snapshots are then animated via CSS animations. The `view-transition-scope` property allows you to limit the scope inside which the browser will search for elements to snapshot to a particular DOM tree.
Copy link
Copy Markdown

@kevers-google kevers-google May 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last sentence reads a bit awkward. What does "limit the scope" really mean? I think we can be more concrete here without being too wordy.

The view-transition-scope property provides control over whether view-transition-names in an element's subtree are discoverable during the capture phase of a view-transition on an ancestor element or the document itself.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wording is a bit different now, but let me know if it still needs attention.


When a view transition is triggered, as part of [the process](/en-US/docs/Web/API/View_Transition_API/Using#the_view_transition_process), the browser captures snapshots of elements that have a non-`none` {{cssxref("view-transition-name")}} set on them. These snapshots are then animated via CSS animations. The `view-transition-scope` property allows you to limit the scope inside which the browser will search for elements to snapshot to a particular DOM tree.

When `view-transition-scope: all` is set on an element, it limits the scope of [element-scoped view transitions](/en-US/docs/Web/API/View_Transition_API/Using_element-scoped) to that element and its descendants. The default value, `view-transition-scope: none`, means that no scope limiting will take place.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

view-transition-scope also applies to document view transitions. Again the term "scope limited" is rather vague here. When view-transition-scope: all is used, any view-transition-names in the element's subtree are not visible from the element's ancestors during the capture phase.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, got it. In my next commit, I've updated the page so that it isn't saying they are specific to element-scoped VTs.


When `view-transition-scope: all` is set on an element, it limits the scope of [element-scoped view transitions](/en-US/docs/Web/API/View_Transition_API/Using_element-scoped) to that element and its descendants. The default value, `view-transition-scope: none`, means that no scope limiting will take place.

The `view-transition-scope` property was implemented so that element-scoped view transitions can be made self-contained. Whenever an element-scoped view transition is triggered, the browser automatically sets `view-transition-scope: all` on the transition scope's root element so that elements are only snapshotted and view transition animations applied inside the transition scope.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting view-transition-scope: all manually on a descendant element prior to starting a view-transition enables a running a view transition on the descendant concurrently without incurring a name collision.

An example can be found in
https://developer.chrome.com/docs/css-ui/view-transitions/element-scoped-view-transitions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned over email, I have now added better content here. Let me know what you think.

Copy link
Copy Markdown

@kevers-google kevers-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, it looks good. A few suggested wording changes.

Copy link
Copy Markdown

@kevers-google kevers-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technical side looks good.

@chrisdavidmills chrisdavidmills changed the title Technical review: Document element-scoped view transitions Editorial review: Document element-scoped view transitions May 26, 2026
@chrisdavidmills
Copy link
Copy Markdown
Contributor Author

Technical side looks good.

Excellent, thanks for your review, @kevers-google. I'll move this to the editorial review stage now, but feel free to jump in if you notice anything else that needs attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:CSS Cascading Style Sheets docs Content:WebAPI Web API docs size/xl [PR only] >1000 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants