[resize-observer] svg interaction
@gregwhitworth is already working on this.
Since Jul 10, 2019.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 24
Description
ResizeObserver mentions SVG specially several times (see, for example https://drafts.csswg.org/resize-observer/#calculate-box-size). I don't recall the intent of this, but I am wondering if perhaps it is intended for observing the resizing of things inside the SVG and not the SVG itself? It seems that if I had some construct with a svg with width="100%" the SVG itself is resizing, but if it is observing the boundingBox then those things will not be reported. This little pen illustrates what I mean - here, I believe the path should fill green, but it doesn't because it seems that what is being observed is the bounding box. The pen also updates the reporting of the size of that bounding box every 100ms and as you can see, it never updates.
This seems strange and it does seem (at least from what I can tell) implemented this way in all of the browsers. As an author, it's true that you can work around this by wrapping a div around it and monitoring that instead, but that seems like a strange workaround and like maybe this creates a need for special understanding. It seems what we want to observe here is not this?
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.
Assessment
This issue has not been assessed yet.