WICG / resize-observer

This repository is no longer active. ResizeObserver has moved out of WICG into
https://github.com/w3c/csswg-drafts/tree/master/resize-observer-1
Other
255 stars 18 forks source link

A complimentary observer for changes to client rectangle position? #33

Closed micahscopes closed 8 years ago

micahscopes commented 8 years ago

I discovered this new observer thanks to comments on a StackOverflow question asked here.

The question was:

Is there a way to detect when an element's getBoundingClientRect() rectangle has changed without actually calculating getBoundingClientRect()?

It seems that the answer to this question is no. So I'm asking here: Why not create something like this? It would be extremely useful to have a high level event that says "relative to the view, this object has moved".

atotic commented 8 years ago

Sounds like you are looking for a complementary LocationObserver.

Why not create something like this?

Same answer as for many other features missing from web platform: browser implementors have limited bandwidth. They need to be convinced that feature is useful, necessary.

You can start a discussion on https://discourse.wicg.io/

My personal take is that the use case for LocationObserver is not as clear cut, but I could be wrong.