← Chrome 160 reference · All APIs

v160 · css · enabled by default

View Transitions: shadowRoots option in startViewTransition()

The shadowRoots option on StartViewTransitionOptions (defaulting to []) lets document.startViewTransition() and element.startViewTransition() discover view-transition-name, view-transition-class, and view-transition-group declarations inside explicitly supplied descendant ShadowRoots — enabling seamless animations across shadow and slotted light DOM without breaking shadow encapsulation.

Limited availability — shadowRoots is Chromium-only (base same-document Document.startViewTransition() is Baseline Newly available since 2025-10-14)

  • Chrome · Filed under v160; ChromeStatus targets 161 (flag ViewTransitionShadowRoots)
  • Edge · Chromium-based (no BCD entry yet)
  • Firefox · No signal (Mozilla #1488)
  • Safari · No signal (WebKit #743)

The base view-transitions web-feature is Baseline Newly available since 2025-10-14 per webstatus.dev (Chrome/Edge 111, Safari 18, Firefox 144; options dictionary { update, types } in Chrome/Edge 125, Safari 18.2, Firefox 147 per BCD api/Document.json). Element-scoped Element.startViewTransition() is Chrome/Edge 147 only. Neither BCD file includes shadowRoots yet (checked 2026-11-24).

at a glance

Milestone / rolloutPublished under /v160/ (matching the Chrome Platform Showcase v160 route); as of 2026-11-24 the ChromeStatus API record targets Chrome 161 across desktop, Android, and Android WebView (also listed in the milestone=161 listing)
Origin trial / flagNo origin trial, no user-facing chrome://flags entry. Blink runtime feature ViewTransitionShadowRoots is currently status: "experimental" in runtime_enabled_features.json5; test on Chromium builds with --enable-blink-features=ViewTransitionShadowRoots
SpecificationCSS View Transitions Module Level 2 — StartViewTransitionOptions.shadowRoots (pending merge of CSSWG PR #14826)
CSSWG & TAGw3c/csswg-drafts#12953 (resolved 11 November 2026 to add shadowRoots to StartViewTransitionOptions); w3ctag/design-reviews#1315
Tracking bugissues.chromium.org/584738355
Chromium sourceview_transition_options.idl; view_transition_style_tracker.cc
ChromeStatus5206462350622720 — View Transitions: shadowRoots option in startViewTransition()

why it exists

In CSS View Transitions, view-transition-name, view-transition-class, and non-normal view-transition-group values are tree-scoped names. Previously, a transition started with document.startViewTransition() or element.startViewTransition() could only discover declarations in the same node tree as the transition’s root element — ignoring declarations authored inside Shadow DOM stylesheets. Web component authors had to expose internal elements via ::part() or move styles outside the shadow tree, breaking encapsulation and making it difficult to animate shadow internals alongside slotted light-DOM children. Passing an explicit shadowRoots list lets the code that already holds a ShadowRoot reference opt it into the transition without opening closed shadow roots to external callers.

Source: ChromeStatus motivation (5206462350622720); w3c/csswg-drafts#12953; w3ctag/design-reviews#1315.

Syntax

WebIDL from CSSWG PR #14826 extending StartViewTransitionOptions in CSS View Transitions Module Level 2 (shadowRoots is the new member; update and types are pre-existing dictionary members shown for context; Blink’s internal IDL file names this dictionary ViewTransitionOptions):

dictionary StartViewTransitionOptions {
  ViewTransitionUpdateCallback? update = null;
  sequence<DOMString>? types = null;
  sequence<ShadowRoot> shadowRoots = [];
};

Pass the options dictionary to either Document.prototype.startViewTransition(options) (global document transition) or Element.prototype.startViewTransition(options) (element-scoped transition):

const transition = document.startViewTransition({
  update: () => updateDOM(),
  types: ["card-morph"],
  shadowRoots: [cardHost.shadowRoot],
});

const scopedTransition = hostElement.startViewTransition({
  update: () => updateComponent(),
  shadowRoots: [privateClosedShadowRoot],
});

This reference covers both parts of the contract: the StartViewTransitionOptions.shadowRoots dictionary member and the participating tree roots resolution algorithm for view-transition-name, view-transition-class, and view-transition-group.

Source: CSSWG PR #14826; Blink view_transition_options.idl; Blink scoped_view_transition.idl.

StartViewTransitionOptions.shadowRoots — inputs and outputs

Inputs. An optional iterable sequence of ShadowRoot objects (defaulting to an empty sequence []). Both open shadow roots (host.shadowRoot) and closed shadow roots (the reference returned by attachShadow({ mode: "closed" })) are accepted when held by the caller. Duplicate entries in the sequence are deduplicated when stored in the transition’s participating tree roots set.

Outputs. startViewTransition() returns a ViewTransition object whose internal participating tree roots set contains the transition root element’s own tree root (Document for a document transition, or element.getRootNode() for a scoped transition) unioned with every ShadowRoot supplied in shadowRoots. Including a ShadowRoot is not recursive: nested shadow roots inside an included shadow tree do not participate unless they are also listed explicitly in shadowRoots.

Pseudo-element tree placement. Passing shadowRoots expands where view-transition CSS properties are discovered, not where the transition pseudo-element tree is mounted. The generated ::view-transition, ::view-transition-group(), ::view-transition-image-pair(), ::view-transition-old(), and ::view-transition-new() pseudo-elements still live on the transition’s root element (the document element or the scoped host element).

Source: CSSWG PR #14826; Blink view_transition_style_tracker.cc; Blink view_transition_supplement.cc.

Participating tree roots — name, class, and group resolution

During both old-state and new-state capture, Blink’s ViewTransitionStyleTracker::IsParticipatingTreeScope() and CSSWG PR #14826 restrict discovery to elements that are flat-tree inclusive descendants of the transition’s root element (not excluded by view-transition-scope: all) and then resolve three tree-scoped properties against participating tree roots:

How participating tree roots resolves tree-scoped CSS View Transitions properties
CSS propertyWhen declaring tree root is in participating tree rootsWhen declaring tree root is NOT in participating tree roots
view-transition-name (<custom-ident>, auto, match-element)Resolves the identifier string with its tree root stripped, placing all participating trees into one shared flat namespace for the transitionTreated as none (element is not captured as a named participant)
view-transition-classEach scoped class identifier whose declaring tree root participates is appended to the element’s transition class listOmitted from the element’s transition class list
view-transition-group (contain, nearest, <custom-ident>)Resolves normally against participating flat-tree ancestorsFalls back to normal

Flat shared namespace across participating trees. Because stripping the associated tree root puts all participating trees into a single flat namespace for that ViewTransition, an element inside Shadow Root A and an element in light DOM (or Shadow Root B) with the same view-transition-name will pair and morph across tree boundaries if one is present in the old state and the other in the new state — and will collide as duplicate names if both are present simultaneously in the same capture state. Passing a ShadowRoot that is not a flat-tree descendant of a scoped transition’s root element has no effect because elements outside the root’s flat-tree subtree are never visited.

Source: CSSWG PR #14826; Blink view_transition_style_tracker.cc (GetScopedClassList, ResolveScopedViewTransitionGroup, AddTransitionElementsFromCSSRecursive).

Errors, edge cases, and fallbacks

Source: Blink view_transition_options.idl; Blink view_transition_supplement.cc; CSSWG PR #14826.

Context and exposure

StartViewTransitionOptions.shadowRoots is available in Window contexts on both Document.prototype.startViewTransition() and Element.prototype.startViewTransition() (when element-scoped view transitions are supported). No secure context, permission, or user activation is required. To include a closed ShadowRoot, the call must originate from code that holds that ShadowRoot reference (typically inside the custom element’s own class).

Source: Blink view_transition_supplement.idl; Blink scoped_view_transition.idl; w3c/csswg-drafts#12953.

Lifecycle, cleanup, and accessibility

The participating tree roots set is snapshotted synchronously when startViewTransition() creates the transition’s style tracker and is used identically during both old-state and new-state capture; mutating the caller’s array afterward has no effect. When the transition finishes or is skipped, Blink clears participating_tree_roots_ and removes the temporary ::view-transition pseudo-element tree. Because view transitions do not automatically move keyboard focus and can be disorienting for motion-sensitive users, route focus programmatically once transition.finished settles (or after the DOM update) and disable animations under @media (prefers-reduced-motion: reduce).

Source: Blink view_transition_style_tracker.cc; CSSWG PR #14826.

Examples

Live demo & custom element transitioning closed shadow DOM with slotted light DOM

Live interactive demo morphing elements inside a component’s shadow tree with shadowRoots. Source: Chrome Platform Showcase — View Transitions: shadowRoots option.
class ExpandableCard extends HTMLElement {
  #shadow;

  constructor() {
    super();
    this.#shadow = this.attachShadow({ mode: "closed" });
    this.#shadow.innerHTML = `
      <style>
        .badge { view-transition-name: card-badge; view-transition-class: card-piece; }
        .panel { view-transition-name: card-panel; }
        @media (prefers-reduced-motion: reduce) {
          ::view-transition-group(*),
          ::view-transition-old(*),
          ::view-transition-new(*) { animation: none !important; }
        }
      </style>
      <div class="panel">
        <span class="badge">Featured</span>
        <slot></slot>
      </div>
    `;
  }

  toggleExpanded(expanded) {
    const applyState = () => {
      this.toggleAttribute("expanded", expanded);
    };

    // Prefer element-scoped transition if available, else fall back to document
    const start = this.startViewTransition
      ? (opts) => this.startViewTransition(opts)
      : document.startViewTransition
        ? (opts) => document.startViewTransition(opts)
        : null;

    if (!start) {
      applyState();
      this.querySelector("h2")?.focus();
      return;
    }

    // Closed ShadowRoot stays encapsulated: only this component holds #shadow
    const transition = start({
      update: applyState,
      shadowRoots: [this.#shadow],
    });

    transition.finished.finally(() => {
      // Maintain logical keyboard focus after layout morphs
      this.querySelector("h2")?.focus();
    });
  }
}

More live interactive demos on the Chrome Platform Showcase cover the capture inspector, design-system tabs, and ::part() workaround & edge cases.

Source: CSSWG PR #14826; w3c/csswg-drafts#12953.

Cross-shadow-root handoff with document.startViewTransition() and feature observation

// Morph a shared view-transition-name ("active-thumb") from one component's
// shadow tree into another component's shadow tree.
function moveThumb(fromCard, toCard, updateDom) {
  const roots = [fromCard.shadowRoot, toCard.shadowRoot].filter(
    (r) => r instanceof ShadowRoot,
  );

  if (!document.startViewTransition) {
    updateDom();
    return { supported: false };
  }

  let shadowRootsRead = false;
  const options = {
    update: updateDom,
    get shadowRoots() {
      shadowRootsRead = true;
      return roots;
    },
  };

  const transition = document.startViewTransition(options);
  return { transition, supported: shadowRootsRead };
}
Source: CSSWG PR #14826; Blink view_transition_options.idl.

Browser compatibility

Support for StartViewTransitionOptions.shadowRoots alongside base View Transitions support. BCD does not yet include shadowRoots; interim status comes from ChromeStatus, Blink source, and vendor standards positions (checked 2026-11-24).
BrowsershadowRoots optionEvidence / notesBase Document / Element.startViewTransition() (BCD)
Chrome (desktop, Android, WebView)161 (planned)
flag in dev
Filed under v160/; ChromeStatus 5206462350622720 targets Chrome 161 (desktop, Android, WebView); Blink ViewTransitionShadowRoots is currently status: "experimental"Document: 111 (options 125)
Element: 147
EdgeUnknownChromium-based; follows Chromium milestone rollout (no BCD or wpt.fyi entry yet)Document: 111 (options 125)
Element: 147
FirefoxNo supportMozilla standards position #1488: No signalDocument: 144 (options 147)
Element: No support
SafariNo supportWebKit standards position #743: No signalDocument: 18 (options 18.2)
Element: No support
Source: BCD api/Document.json; BCD api/Element.json; ChromeStatus API record; webstatus.dev view-transitions.

Security and privacy

The explicit shadowRoots sequence is a capability-based design chosen in CSSWG #12953 and TAG review #1315 specifically to preserve Shadow DOM encapsulation: alternatives such as automatic discovery across all shadow trees or a boolean includeShadowRoots flag were rejected because they would allow outer scripts to capture and animate internals of closed shadow roots without the component’s consent. With shadowRoots, only a caller that already holds a ShadowRoot object reference can opt that tree into the transition. ChromeStatus 5206462350622720 records no additional security risks; note that opted-in trees share a flat view-transition-name namespace with the transition root, so a host stylesheet can style the generated ::view-transition-* pseudo-elements for participating names.

Source: w3c/csswg-drafts#12953; w3ctag/design-reviews#1315; ChromeStatus 5206462350622720.

Specifications

see also