[resize-observer] ResizeObserver callback order.
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- PR merge metrics
- PR metrics pending
Description
The specification has a well-defined callback order, however it requires keeping alive observers for too long (see this firefox bug).
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 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the ResizeObserver specification text around the Document.resizeObservers slot and the observe(), unobserve(), and observation-delivery steps. Compare the proposed WebKit-aligned lifetime and callback iteration behavior, then update the specification so removals during delivery and callback order are defined; done means the intended algorithm is unambiguous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- documentation, web-dev
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100