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

> > The old element is out of viewport when capturing the old state, and the usef scrolls to a position where it's in viewport. So we considered it invisible when capturing but that state changed.
> 
> So the `view-transition-name` is ignored in the old DOM but it is applied in the new DOM (when scrolling brought that element into the viewport). There won't be a `::view-transition-old` pseudo for that name. If the name has an ancestor with a name 2 cases are possible:
> 
> * The named ancestor is the root in which case the old content is not captured at all (because root snapshots clip to the viewport).

Right, I guess animations with captured roots anyway don't work well with scroll.
But this element can be a child of a captured element other than root as well.

> * The named ancestor is not the root in which case the old content could be in this ancestor's snapshot.
> 
> There will be a `::view-transition-new` for it though. Would the `:only-child` pseudo-class suffice to detect this state?

That would be option (2). you'd scroll down and the element would disappear immediately rather than fade out. This is ok but perhaps not always the desired outcome.


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


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

Received on Wednesday, 24 April 2024 14:43:55 UTC