Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ContentVisibilityAutoStateChanged event #756

Closed
1 task done
vmpstr opened this issue Jul 11, 2022 · 3 comments
Closed
1 task done

ContentVisibilityAutoStateChanged event #756

vmpstr opened this issue Jul 11, 2022 · 3 comments

Comments

@vmpstr
Copy link

vmpstr commented Jul 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.

  • Explainer¹ (minimally containing user needs and example code): explainer
  • Specification URL: This will be an amendment to css-contain spec. I will update the issue once the spec text is available.
  • Security and Privacy self-review²: self-review
  • Primary contacts (and their relationship to the specification):
  • Organization(s)/project(s) driving the specification: Google
  • Key pieces of existing multi-stakeholder review or discussion of this specification: CSSWG discussion
  • External status/issue trackers for this specification (publicly visible, e.g. Chrome Status): https://chromestatus.com/feature/5179553291436032

Further details:

  • I have reviewed the TAG's Web Platform Design Principles
  • Relevant time constraints or deadlines: None
  • The group where the work on this specification is currently being done: CSSWG
  • Major unresolved issues with or opposition to this specification: None
  • This work is being funded by: Google

We'd prefer the TAG provide feedback as:

💬 leave review feedback as a comment in this issue and @-notify @vmpstr

@hober
Copy link
Contributor

hober commented Jul 26, 2022

@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?

@hober hober added Resolution: satisfied The TAG is satisfied with this design Venue: CSS WG Topic: events Progress: propose closing we think it should be closed but are waiting on some feedback or consensus and removed Progress: untriaged labels Jul 26, 2022
@vmpstr
Copy link
Author

vmpstr commented Jul 26, 2022

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

@torgo torgo added this to the 2022-08-29-week milestone Aug 29, 2022
@hober hober added Progress: review complete and removed Progress: propose closing we think it should be closed but are waiting on some feedback or consensus labels Aug 29, 2022
@hober
Copy link
Contributor

hober commented Aug 29, 2022

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.

@hober hober closed this as completed Aug 29, 2022
@torgo torgo removed this from the 2022-08-29-week milestone Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants