Primary eng (and PM) emails
Summary
Deprecate the overflowchanged event.
Motivation
This is a WebKit/Blink-only feature. I've not been able to find any discussion about standardizing it. There are some interesting comments in https://bugs.webkit.org/show_bug.cgi?id=67583
Compatibility Risk
Unknown, the event handler can do anything. Firefox has a supposedly similar overflow event, which leaves IE as the only evidence that the Web can work without the event. Still, the low usage is very encouraging.
Alternative implementation suggestion for web developers
Depends on what the event handler actually does. In the general case it looks like there are other ways of determining if scrollbars are visible:
http://stackoverflow.com/questions/4814398/how-can-i-check-if-a-scrollbar-is-visible
Without the event one would have to poll for changes whenever the window is resized or when a user-resizable widget is resized.
Usage information from UseCounter
http://www.chromestatus.com/metrics/feature/timeline/popularity/208 (~0.006%)
Entry on chromestatus.com and/or MDN
None.
Requesting approval to remove too?
I'd prefer we push standardisation for this instead of removing our impl. This event seems a valuable way for developers to get information we give them no other way.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
Blink does not support Mail.app:
https://bugs.webkit.org/show_bug.cgi?id=67583#c6
My understanding is that this was one of few things which can cause us
to run JS in response to layout(). If we can ditch that complexity,
sgtm.
Responding to Adam Barth:I am making an editor using a contenteditable div. I want to do some special things involving how the text wraps at the end of a line.I have been checking after each keypress whether the line of text has gone past the edge of the box. I recently realized I can use the overflowchanged event.I am doing a moderate amount of work on each keypress to check whether I've gone past the limit. For me, it is great to have an event that says exactly that.
Responding to Adam Barth and Andrei Bucur:Here I am more stating an opinion than giving information, so give this less attention. :^)1) There may be intermediate overflows that aren't there in the final result.2) Different rendering engines may give overflow events at different times.
Yeah, those are both true, and hard to fix. Kick it up to the user. Put a big sign on the API saying the overflows may happen at different times as the browser evolves and as one moves between browsers. The user can take whatever steps are necessary to his purpose. If he ties his code to a particular sequence of overflows and underflows, it's his own darn fault.
I realize that may be hard for a standards body to accept.
> document.body.addEventListener('overflowchanged', function(){});
[!] The 'overflowchanged' event is deprecated and may be removed. Please do not use it.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
The questions is whether to remove it, not to deprecate it, because it is a nonstandard and mostly unused feature.If standards emerge and include it (and the API owners think it is a good idea), the deprecation would of course be lifted.
In any case, it's not related to the overflowchanged event.
> Through the usage of css-element-queries some websites/application are based
> on overflowchanged event and it would be really uncool if you're going to
> remove it. :-)
It looks like you removed the overflowchanged code path after writing
this email:
https://github.com/marcj/css-element-queries/commit/d96e17397c3fa3e6cea96b239ef02628169267f0
Is the new implementation fine, or is there some API needed to make it
work really well? All I know is that element queries are an unsolved
problem: http://www.xanthir.com/b4PR0
This would have been a nice-to-have standard feature -- there are a couple odd cases where CSS overflow options aren't sufficient; inserting DOM elements on overflow, for example. I prefer to avoid handling the resize event whenever possible since it fires so rapidly.