View Transitions behave inconsistently and incorrectly inside and outside iframes
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
People
(Reporter: nawfel.bgh, Unassigned, NeedInfo)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:160.0) Gecko/20100101 Firefox/160.0
Steps to reproduce
I've created a minimal test case to compare Firefox's View Transitions implementation inside and outside iframes.
The test case is available in this Github repository
It can also be tested from:
- https://nawfelbgh.github.io/view-transitions-inside-and-outside-iframe/iframe.html
- https://nawfelbgh.github.io/view-transitions-inside-and-outside-iframe/
It allows you to set a pending state either before calling document.startViewTransition() or from within its callback.
- Open
iframe.htmlto test View Transitions directly, outside an iframe. - Open
index.htmlto test View Transitions inside an iframe. - Toggle the "Set pending state BEFORE startViewTransition()" checkbox to control whether the pending state is rendered before calling document.startViewTransition() or from within its callback.
- Click the button to trigger a View Transition and observe when the pending state is rendered.
Actual results
Firefox exhibits different rendering issues depending on whether the document is inside or outside an iframe.
- When you open
iframe.html:- If you check "Set pending state BEFORE startViewTransition()":
- ⚠️ Firefox does not paint the latest version of the DOM (with the pending indicator).
- ⚠️ It pauses painting during the view transition, so the pending indicator is not displayed.
- ❌ When the
document.startViewTransitioncallback returns, Firefox immediately renders the DOM with the pending indicator and then animates from this suddenly rendered state to the DOM's post-transition state.
- If you uncheck "Set pending state BEFORE startViewTransition()":
- ✅ Firefox works as expected.
- If you check "Set pending state BEFORE startViewTransition()":
- When you open
index.html:- If you check "Set pending state BEFORE startViewTransition()":
- ✅ Firefox works as expected.
- If you uncheck "Set pending state BEFORE startViewTransition()":
- ❌ Firefox renders a pending state that was written to the DOM inside
document.startViewTransition, then animates from this state to the DOM's post-transition state. Although Firefox sometimes behaves correctly, moving the mouse consistently triggers the faulty behavior.
- ❌ Firefox renders a pending state that was written to the DOM inside
- If you check "Set pending state BEFORE startViewTransition()":
In short:
- Outside iframes, Firefox does not render the latest DOM content before pausing painting at the start of a view transition. Then, when the transition ends, it suddenly renders the DOM content from before the transition and animates from that state to the page's new state.
- Inside iframes, Firefox renders DOM changes written during the view transition, even though painting should be paused.
Expected results
View Transitions should behave consistently, both inside and outside iframes.
Specifically:
- The browser should paint all DOM updates made before the
document.startViewTransitioncallback is called. - The browser should capture a snapshot of the DOM state at the start of the transition.
- The browser should pause painting new content while the transition callback is running.
- Once the callback completes, the browser should animate from the captured snapshot to the resulting DOM state, without displaying intermediate DOM states.
In particular, DOM updates made inside the transition callback should not be painted as an intermediate state before the transition animation begins.
Comment 1•24 days ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, but is not confident enough to move the bug to that component.
Updated•23 days ago
|
Comment 2•14 days ago
|
||
smaug, you know the state of view transitions better than I do -- do you know if this is a known view transitions issue? (And should this be reclassified?)
Tentatively triaging as S3 because it doesn't seem to be a regression; I can repro in Firefox 149 Nightly 2026-02-01 (and current Firefox 162 Nightly)
Description
•