#756: ContentVisibilityAutoStateChanged event
Discussions
Discussed
Jul 1, 2022 (See Github)
Yves: can't you do this already
Tess: yes, with IntersectionObserver etc., but it would be clunky & error-prone
[... discussion of what would happen if you had old code doing this the hacky way and new code doing this the new way on the same page ... we eventually concluded that they've covered the relevant concerns, at least as far as we can tell.]
Comment by @hober Jul 26, 2022 (See Github)
@ylafon and I took a look at this during our London F2F this week and, broadly speaking, this seems reasonable to us. We're wondering if you've thought about this edge case, though:
Say you have a large website that many developers have hacked on. Before the introduction of this feature, someone does something roughly equivalent with IntersectionObserver
and MutationObserver
as you've alluded to. Later, after the introduction of this feature, someone does something else on the same site, with the same subtree, with the new element. Is there any risk that this new event handler could cause a cycle with the old code? Is there a way for the spec or the implementation to mitigate this?
Comment by @vmpstr Jul 26, 2022 (See Github)
So I understand correctly, do you mean if there's both an IntersectionObserver type of code and this new event handling? I can't immediately think of a situations where this can cause a problem where both handlers are triggered in a loop. The only way that would be possible is if one of the handlers changes layout of the page such that the affected c-v element keeps being toggled between skipped and not skipped states. But that seems like a behavior that could already be caused with only one of IntersectionObserver or this new event. IOW (and IMHO), nothing fundamentally changes now that there are two different ways to observe these state changes.
I hope that answers your question
Discussed
Aug 1, 2022 (See Github)
Yves: we asked about the issue of having a complex and (now) simpler way of doing the same thing and the possible bad interactions... would there be a way to mititage this issue we're raised. They've said they are aware but no way to mitigate.
Tess: at least on par with the rest of the platform... at least they are aware and thought about it. It would be nice if we could break the cycle but in this case...
Dan: they need a "please make sure this is documented"...
<blockquote>Hi @vmpstr,
Thanks again for bringing this to our attention. We're happy with your design and will close this review. We are hoping that you can note (non-normative text would be fine) the possibility of cycles with related features in the spec, so that authors can be warned, but we're not blocking the review on that.
</blockquote>Dan: close with satisfied?
Tess & Yves: Yes
Comment by @hober Aug 29, 2022 (See Github)
Hi @vmpstr,
Thanks again for bringing this to our attention. We're happy with your design and will close this review. We are hoping that you can note (non-normative text would be fine) the possibility of cycles with related features in the spec, so that authors can be warned, but we're not blocking the review on that.
OpenedJul 11, 2022
Hello TAG!
I'm requesting a TAG review of ContentVisibilityAutoStateChanged 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.Further details:
We'd prefer the TAG provide feedback as:
💬 leave review feedback as a comment in this issue and @-notify @vmpstr