Open Bug 2087840 Opened 24 days ago Updated 14 days ago

View Transitions behave inconsistently and incorrectly inside and outside iframes

Categories

(Core :: CSS Parsing and Computation, defect)

Firefox 160
defect

Tracking

()

UNCONFIRMED

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:

It allows you to set a pending state either before calling document.startViewTransition() or from within its callback.

  • Open iframe.html to test View Transitions directly, outside an iframe.
  • Open index.html to 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.startViewTransition callback 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.
  • 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.

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.startViewTransition callback 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.

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.

Component: Untriaged → General
Component: General → CSS Parsing and Computation
Product: Firefox → Core

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)

Severity: -- → S3
Flags: needinfo?(smaug)
You need to log in before you can comment on or make changes to this bug.