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

I think it's reasonable to consider making animations that begin and end off-screen not animate by default (and hear me out).

It is indeed going to become easier to mark things as participating in a view transition, via auto naming and auto matching. There are also thoughts about making something like transition: content where a view transition may implicitly start on an element when something about it changes.

All of these features would make it easy to have animations happening completely off-screen. And by easy I mean even without the author realizing it. To Khushal's point, this is going to likely regress performance more than a CSS animation would (although I would challenge that offscreen CSS animations are "free"). This is due to the fact that view transitions include visual captures.

If by default, we don't run an animation if the start and the end states are off-screen, then in currently Chromium implementation we would still run a capture, but we can get rid of it quickly. We can also see if we can figure out some implementation optimization for this, but I can't think of anything off top the of my head. In any case, we'd at least have a possibility of optimizing this.

What we lose is the list reorder case, where a thing intentionally flies through the viewport. That's ok? We can add a property that opts into the behavior of always capturing regardless of off-screen-ness

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


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

Received on Thursday, 11 April 2024 15:36:46 UTC