Resize event on DOM elements


#1

Currently, only IE implements a resize event on DOM elements. Making this standard would address / help fix https://github.com/ajaxorg/ace/issues/2153, SVG element resize event, and many other headaches involving changes in content size.


Resize event for elements
#2

I think this could use something similar to a matchMedia() query for element queries if/when that solidifies: http://responsiveimagescg.github.io/eq-usecases/

There is even an open issue which matches this:

This would certainly give far more fine grained control.


#3

For what it’s worth, here is the Firefox issue, that I submitted over 3 years ago: https://bugzilla.mozilla.org/show_bug.cgi?id=701648


#4

II believe blink layout engineers are against this for performance reasons. But they’re trying to enable the scenarios via “custom layout” as part of CSS Houdini.


#5

Nope, Blink is for it. We discussed it in public with other browser vendors at the last Extensible Web meetup.


#6

When you say you discussed in public, do you mean you discussed it in person at a public meetup? Because, to the internet, “in person” discussions are private (unless they’re webcast and saved).


#7

Oh sorry - I stand corrected!


#8

Not to be a troll or anything, but the lack of simple features like this one are why “native” developers that don’t like web tech don’t like web tech.

Then again, a “native” developer (who will manually ship an app that doesn’t run in the web anyway) could fork a browser and easily add this feature and then ship the browser as part of the app’s stack. :laughing:

But,

Blink is for it.

So, then hopefully this will be fixed soon?

What’s taking so long!


#9

I suspect it is something about 5-10 years as usual. :slight_smile:


#10

Implemented in Chrome Dev 54 behind experimental web platform features flag.

new ResizeObserver(callback).observe(element)

https://crbug.com/612962