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

Add a test to cover using ResizeObserver on SVG elements #35230

Closed
wants to merge 1 commit into from
Closed

Conversation

w1ndy
Copy link

@w1ndy w1ndy commented Jul 26, 2022

This PR adds a test to see if ResizeObserver correctly fires events when the SVG elements themselves are resized. All major browsers I've tested failed this test, but spec seems to support this usage (see https://www.w3.org/TR/resize-observer/#calculate-box-size and w3c/csswg-drafts#4032 (comment)).

Copy link
Contributor

@atotic atotic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is behaving as intended. According to spec, RO observers svg's bounding box getBBox(), which does not change when you change the height attribute.

@w1ndy
Copy link
Author

w1ndy commented Jul 26, 2022

I think this is behaving as intended. According to spec, RO observers svg's bounding box getBBox(), which does not change when you change the height attribute.

Thanks for pointing this out. So it looks like this resolution haven't made its way into the spec yet (honestly I wonder if it's ever going to happen...)

@w1ndy w1ndy closed this Jul 26, 2022
@atotic
Copy link
Contributor

atotic commented Jul 27, 2022

If you update the spec, this test will be useful. It would be useful to expand it to cover a few more cases.

In the spec discussion, the elements with layout box were defined as svg:root, *:not(svg|*) > svg, svg|foreignObject > svg.

@w1ndy
Copy link
Author

w1ndy commented Jul 28, 2022

If you update the spec, this test will be useful. It would be useful to expand it to cover a few more cases.

In the spec discussion, the elements with layout box were defined as svg:root, *:not(svg|*) > svg, svg|foreignObject > svg.

Yeah, I've submitted a PR to update the spec. This test would be useful after that PR gets merged (and probably we need to wait until it becomes recommendation?). I can work on this PR to add a few more tests to cover the additional SVG elements with layout box.

@w1ndy w1ndy reopened this Jul 28, 2022
@w1ndy w1ndy marked this pull request as draft July 28, 2022 01:21
@w1ndy w1ndy closed this by deleting the head repository Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants