Re: [csswg-drafts] [css-contain-2]: Should the first `contentvisibilityautostatechange` event be fired without knowing if the element is close to the viewport (#9803)

> This could happen, because `inner.getBoundingClientRect().height` triggers layout, and layout could trigger `relevant to the user` checking.

I see. Am I correct in understanding that you mean if we force a layout before we had a change to determine proximity to the viewport, then we decide that the element is not relevant to the user (assuming no other conditions). Then, when we do check the proximity, we may determine that the element _is_ relevant, causing a second event?

If that's the case, then I agree we probably don't want the first event on forced layout. What do other browsers do in this case right now?

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


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

Received on Thursday, 18 January 2024 19:24:40 UTC