W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2019

[csswg-drafts] [resize-observer] ResizeObserver callback order. (#4518)

From: Emilio Cobos Álvarez via GitHub <sysbot+gh@w3.org>
Date: Tue, 19 Nov 2019 14:50:44 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-525057857-1574175040-sysbot+gh@w3.org>
emilio has just created a new issue for https://github.com/w3c/csswg-drafts:

== [resize-observer] ResizeObserver callback order. ==
The specification has a well-defined callback order, however it requires keeping alive observers for too long (see [this firefox bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1596992)).

It seems that WebKit is doing the same thing I'm going to do in Gecko (add to the `Document.resizeObservers` slot on `observe()`, and remove on the last `unobserve()` call).

It seems Blink uses [a hash set](https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/resize_observer/resize_observer_controller.h?l=51&rcl=47bf0c9c1c4532aafac244de9ee0784a576d36c4) so I don't even know if the iteration order there is well defined for them.

I'm going to align with WebKit for now as it seems simpler to implement and doesn't create an insert-only list / set.

Doing this creates an issue, which is that the observers can be removed when delivering observations. This was already a problem for additions, but explicitly copying the contents of the slot before iteration in the spec may be clearer.

cc @smfr @atotic 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4518 using your GitHub account
Received on Tuesday, 19 November 2019 14:50:46 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:56 UTC