Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[resize-observer] Why does ResizeObserver not fire on non-replaced inline elements? #6358

Open
trusktr opened this issue Jun 8, 2021 · 1 comment

Comments

@trusktr
Copy link

trusktr commented Jun 8, 2021

The resize-observer spec says

Observations do not fire for non-replaced inline Elements.

I am guessing this is because such elements are split into pieces (rows).

I see that the latest ResizeObserver spec allows it to return an array of sizes when content is split across columns. Based on this, it seems feasible to also have it give us an array of the sizes of the pieces of a non-replaced inline element's rows.

Or it could just give us the size of the bounding box, but this would make the use cases more limited, though the limited use cases could still be useful.

Is it simply that nothing has been decided on how to handle multiple pieces of a non-replaced inline element?

@Loirooriol
Copy link
Contributor

Loirooriol commented Dec 16, 2022

getClientRects() has no problem returning the actual sizes of a non-atomic inline, so I think that ResizeObserver should just stop pretending that the size is zero and just populate the arrays with the fragment sizes.

It may be fine (or even required by compat) to keep contentRect being an empty rect or something special, but populating borderBoxSize, contentBoxSize and devicePixelContentBoxSize as normal seems useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants