[resize-observer] Observations *do* fire for non-replaced inline Elements
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- PR merge metrics
- PR metrics pending
Description
From https://drafts.csswg.org/resize-observer-1/#intro
Observations do not fire for non-replaced inline Elements.
Well that contradicts Blink, WebKit and Gecko:
<!DOCTYPE html>
<div id="test" style="width: 100px; height: 50px"></div>
<script>
new ResizeObserver(entries => {
for (let entry of entries) {
console.log(entry.contentRect);
}
}).observe(test);
requestAnimationFrame(() => requestAnimationFrame(() => {
test.style.display = "inline";
}));
</script>
First they log x=0, y=0, width=100, height=50 and then x=0, y=0, width=0, height=0.
This is even defined in https://drafts.csswg.org/resize-observer-1/#content-rect-h
non-replaced inline Elements will always have an empty content rect.
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 Resize Observer draft's intro and content-rect definition, then run the provided HTML and JavaScript reproduction in the referenced browser engines. Done means resolving the contradiction between the draft's statement about non-replaced inline elements and the observed behavior, with the specification text updated or clarified accordingly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, html, 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