w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.43k stars 656 forks source link

[css-view-transitions-1] Skip ViewTransitions in detached iframes #10264

Open khushalsagar opened 4 months ago

khushalsagar commented 4 months ago

If startViewTransition is called on an iframe which is detached from the tree, or the iframe becomes detached during the transition, should we skip the transition? It seems similar to how we handle document visibility here.

@nt1m @noamr

nt1m commented 4 months ago

Is there a tangible benefit into doing so?

khushalsagar commented 4 months ago

If the iframe is detached we'll never render any frames for it and will be stuck at the step here, waiting for the next frame to capture the old state. Seems better to skip and invoke the update callback to show the new DOM directly. Same reasoning as the visibility case IMO.

nt1m commented 4 months ago

Ah right, I don't see a reason not to then.

noamr commented 4 months ago

A detached iframe is always hidden, and becomes hidden when it is detached from the tree, so this should already be the case.

khushalsagar commented 4 months ago

^ cool. Leaving this open to drop a note in the spec.