Re: [csswg-drafts] [css-view-transitions-2] Ignore offscreen elements from participating in transitions (#8282)

> The thing I think we should solve here is - allowing the web developer to decide that for particular view-transition participants, if it's offscreen in one of the phases, the animation should act like an exit/entry transition.

That's fair. This is the primary use-case for this issue. That said, because this property is defining the behaviour for offscreen elements in View Transitions it intersects with the UA optimizing offscreen animations. Even if we don't change the default, we'd want authors to use this property to opt-out of caching offscreen content if they know the transition won't bring it onscreen.

> It feels like this would become unreliable under the proposed behaviour.

This property can always be used to explicitly specify whether an element is captured irrespective of its viewport relative position. So the author can opt-in to any behaviour (which would reliably happen across browsers) if the default doesn't work for them.

Just to reiterate, my concern is limited to caching a representation of old DOM elements. As per spec, the author can bring an image of a named element in the old DOM in the viewport at any point. So the UA must generate and cache it for the lifetime of the transition. And while it's visually correct, I'm not sure if authors need that behaviour in most cases or understand the additional performance cost associated with it. There is no such issue with the new DOM snapshots because they come from a live element. The UA can already decide whether to paint them based on the position of the pseudo-element rendering that image.

-- 
GitHub Notification of comment by khushalsagar
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8282#issuecomment-2056583174 using your GitHub account


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

Received on Monday, 15 April 2024 11:18:11 UTC