Re: [csswg-drafts] [css-contain-3] Proposal: Add an event to fire when content-visibility: auto state changes (#7384)

> to be clear, would this ContentVisibilityAutoStateChanged event respond to changes to an elements "relevant to the user" state based on any criteria, not just the "on-screen" condition?

Yes, I believe so based on the summary in the [explainer]( https://github.com/vmpstr/web-proposals/blob/main/explainers/cv-auto-event.md#css-content-visibility-state-change-event)

> This proposal is to add an event that would fire on a content-visibility: auto element when the rendering state of the element changes due to any of the attributes that make the element [relevant to the user](https://www.w3.org/TR/css-contain-2/#relevant-to-the-user).

Though further down it talks about polyfilling without including `selectionchange` and `focus` events which I think would be necessary to have feature parity, so it'd be good to confirm with @vmpstr:

> Note that even without this event, it is still possible to polyfill the behavior with a combination of IntersectionObserver and MutationObserver. From this perspective, the event does not add a capability to observe new behaviors, but rather an easier way to discover events that are should already be discoverable.

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


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

Received on Wednesday, 13 July 2022 18:05:20 UTC