[csswg-drafts] [css-view-transitions-2] Hold paint of old Document until new Document draws a frame (#8888)

khushalsagar has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-view-transitions-2] Hold paint of old Document until new Document draws a frame ==
During a cross-document navigation, there is a duration when the active Document associated with the browsing context (tab) has been swapped. But there is no visual content from the new Document because it hasn't produced a frame yet. The browser has a few options for what to paint during this duration:

1. Keep the last frame from the old Document onscreen. This has security implications if the navigation is cross-origin.
2. Clear the screen immediately and paint any UA defined color.
3. Display cached rendering of the new Document (if available). This is possible for session history navigations where the browser can cache the rendering of a Document when navigating away from it.

View Transitions require 1 since by design we want the new Document to define the transition animations. The new Document starts by displaying images captured from the old Document's last frame. This is done via the pseudo DOM defined [here](https://drafts.csswg.org/css-view-transitions-1/#setup-transition-pseudo-elements-algorithm). Until the new Document has produced a frame, the browser needs to paint the last frame from the old Document to avoid visual glitches.

There are also no security implications to this since View Transitions are limited to same-origin.

Proposed Resolution: During a cross-document View Transition, the browser must continue to paint the last frame from the old Document until the new Document produces its first frame.

The behavior for such navigations when there is no View Transition is left to the UA (same as current behaviour).

@smaug---- @noamr 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8888 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 31 May 2023 16:28:50 UTC