[resize-observer] In shipping browsers, observe() doesn't call unobserve()
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- PR merge metrics
- PR metrics pending
Description
Per the current spec, observe(target, options) is suppose to call unobserve(target) if target is already in the observationTargets.
From my understanding, this should clear the lastReportedSizes array for the target. Hence, even if the target hasn't changed size, re-calling observe with the target should always fire an observation.
In practice, all major web browsers do not appear to implement this. Instead, to get the observation to fire, I must manually call unobserve(target) first and then call observe(target) again.
In this example, adding or removing a column should always trigger an observation. However, it only triggers an observation if I explicitly call unobserve() first.
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 with the ResizeObserver observe() and unobserve() algorithms in the current specification, then reproduce the behavior using the linked JSFiddle example. Compare the specification's expected handling of observationTargets and lastReportedSizes with shipping-browser behavior; done means the discrepancy and required specification change are resolved or clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100