Re: [webcomponents] Resize events needed? (#352)

_resize_ probably shouldn't be an event, I think it would suffer some of the same issues that DOM mutation events have (performance, infinite loop footgun).

I was thinking recently about this problem for custom elements, many of them would need to know when they've resized, but there are use cases outside of custom elements too. One of the ideas I had was an observer for element rendering that covers more use cases than just detecting size changes.  For example, the hypothetical observer could trigger for elements that are obscured by other elements or are scrolled out of view, which would allow pausing of animations or videos, skip complex drawing routines or disable server polling, etc.  However, without being familiar with browser internals, I can't really know how feasible this kind of API would be.

What do others think?

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/352#issuecomment-171366302

Received on Wednesday, 13 January 2016 17:09:39 UTC