Re: [csswg-drafts] [css-contain] content-visibility: auto visibility check timing needs details (#8542)

> I think rather than having each step recalculate styles and layout I'd would rather have a single additional pass if either of the things changed.

For content-visibility, we repeat the loop because of possible nesting so we can run more than once here. Of course, we can change that, but this is currently intentional.

> I also think for scroll driven animations (and possibly this case as well), that it may make more sense to run after ResizeObserver as that is the time developers typically size / position sub-components based on ancestor components so it is likely to introduce visible content.

Since content-visibility can (and frequently does) change the size of the element, for that case I prefer to have this happen before resize observer callbacks. It would allow resize observer to see the visible size right away. If this is run after the resize observer callbacks, then because of the visibility state change, the resize observer callbacks have to run again for the shallower depth which without any other changes causes a resize observer loop error. It feels like for c-v specifically, running the steps before resize observer is more correct



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


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

Received on Monday, 1 May 2023 14:23:12 UTC