CSS View Transitions Level 2
adds Element.startViewTransition(): a view transition scoped to one element
instead of the whole document. The pseudo-element tree
(::view-transition, ::view-transition-group(), ...) is generated on
the scope element, only its subtree participates, and the rest of the page keeps running --
including other scoped transitions at the same time.
const transition = card.startViewTransition(() => updateCard());
await transition.finished;
93/93 is this build on the current upstream suite
(wpt
rev 536ae94, 77 tests + 16 crashtests), scored wpt.fyi-style: a test counts as
passing if its status is PASS, or OK with zero failing subtests. WebKit's in-tree import of
the scoped directory is at the same revision, so both numbers agree. The suite is fully
green: per-scope rendering suppression (pause-rendering,
pause-rendering-resize, ink-overflow-on-target), pseudo trees on
replaced and MathML scope renderers (scope-replaced-elements,
scope-mathml-root), fractional-border snapshot geometry
(fractional-border-shift), and all 8 tentative shadowRoots-option
tests pass.
Same build, same demo page, screenshot taken mid-transition with every animation parked at
50% (animation-play-state: paused plus a negative animation-delay,
in the stylesheet before startViewTransition() runs).
Before (flag off, the shipping behavior today): the DOM mutation applies instantly, there is
nothing to animate. After: tiles morph inside the scope while the spinner and ticker outside
the scope keep running -- parked at the same angle in both captures, so the only difference
is the transition itself.
The same transition as video, assembled from 25 per-frame captures of the same build with the
flag on (animations stepped through animation-delay, 1.5s duration). The before
video is the flag-off behavior: a few frames of the old state, then the end state.
A second capture page exercises the clipping and overflow rules: the pseudo tree escapes
the scope's own bounds but stays clipped by an ancestor overflow: hidden, and
a scope with overflow: auto gains no scroll range from the overlay.
The cross-browser overview page embeds one video pair per engine of
the same nested-clip scenario (ported from the
Firefox demo): both
#clipper and #card are named, the clipper's group has
overflow: clip + border-radius, and with
view-transition-group: contain the card's group nests inside
::view-transition-group-children(clipper) and stays clipped while the
clipper flies across the panel.
The four scenarios every engine sampler in the cross-browser VT project captures with identical ids, so the Rendered / Before / After tabs line up across Chromium, Firefox and WebKit.




<img> keeps its
view-transition-name while its source swaps, so the old and new images
cross-fade in place.

view-transition-name; the names resolve per scope, so all three groups
animate inside one scoped transition.

clip-path +
overflow: hidden (amber dashed): the overlay escapes the green scope bounds
but stays cut at the clipped region's rounded edge.



view-transition-name comes from an adopted stylesheet. The dynamic
::view-transition styles resolve in the shadow root's style scope, so the part morphs from
square to circle across the card.

overflow: hidden still cuts it at the edge. Mid-flight the circle is visibly
outside the scope and clipped by the ancestor.

overflow: auto with styled (non-overlay)
scrollbars. The flying group leaves the content box during the morph, yet no scrollbars
appear and scrollLeft/scrollTop stay 0,0: the overlay is excluded from the
scope's scrollable overflow.
One feature-flagged implementation pass, developed as an 18-commit branch on top of main
(PR #81741, draft while under
development): the Element.startViewTransition() API and scoped lifecycle, the
pseudo-element tree on arbitrary scope elements, the snapshot containing block and its
layout (no scrollable-overflow contribution to the scope), clip escape past the scope with
ancestor clips still applied, scoped capture and paint order, UA styles and dynamic
::view-transition styles resolved in the scope's (possibly shadow) style scope, concurrent
scoped transitions, the view-transition-group property with nested groups and
::view-transition-group-children(), the tentative shadowRoots
option with match-element name masking, and UA-sheet parsing of the new pseudos
with the flag off.
| before | after | |
|---|---|---|
| wpt css/css-view-transitions/scoped at rev 536ae94 (93 tests, in-tree import) | suite skipped, 0 passing | 93 of 93 pass, including per-scope rendering suppression, replaced and MathML scope roots, and fractional-border geometry |
| full css-view-transitions suite (482 run) | as expected | as expected, 0 unexpected results, no document-transition regressions |
| tentative shadowRoots option (8 tests) | 0 passing | 8 of 8 pass, including cross-tree morph and match-element masking |
| Gecko implementation (bug 2075158, same suite rev) | 77 of 93 at the same wpt revision: Gecko does not implement the tentative shadowRoots option yet. The Firefox sampler runs the same four cases with the same capture recipe: two independent implementations, same output. | |
# test counts
Tools/Scripts/run-webkit-tests -2 --release --pixel-tests \
imported/w3c/web-platform-tests/css/css-view-transitions/scoped
Tools/Scripts/run-webkit-tests -2 --release --pixel-tests \
imported/w3c/web-platform-tests/css/css-view-transitions
# 93/93: WebKit's in-tree import of the scoped directory matches wpt upstream
# rev 536ae94 (github.com/web-platform-tests/wpt, 77 tests + 16 crashtests);
# scored wpt.fyi-style (test passes if PASS, or OK with zero failing subtests)
# captures: same build, WebKitTestRunner pixel output; the capture page parks
# every animation at frame t/24 via animation-play-state: paused and a negative
# animation-delay in the stylesheet before startViewTransition() runs; the flag
# (ScopedViewTransitionsEnabled, via a webkit-test-runner header comment) is the
# only variable between before and after. WKTR's pixel dump renders the live
# frame including the ::view-transition overlay -- beware that DOM-snapshot APIs
# can re-rasterize without the overlay and show the end state instead.
Tools/Scripts/run-webkit-tests -2 --release --pixel-tests --reset-results tmp-cap
# the PNG lands next to each page as -expected.png
# videos from the 25 per-frame captures
ffmpeg -framerate 16 -i after-main-%02d.png -c:v libx264 -pix_fmt yuv420p after-main.mp4
ffmpeg -framerate 16 -i after-main-%02d.png -vf format=yuv420p -c:v libvpx-vp9 -b:v 0 -crf 32 after-main.webm
# per-case crops, identical geometry within each before/after pair
magick after-main-still.png -crop 420x460+0+0 +repage after-a.png