-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
.className can't be used to set classes on SVG elements #1224
Comments
JSDOM does the right thing; we just didn't have adequate tests. Fixed in #1226 |
Rich-Harris
added a commit
that referenced
this issue
Mar 12, 2018
allow SVG elements to have scoped CSS
This was referenced Mar 14, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Via sveltejs/v2.svelte.dev#216
As of Svelte 1.57.0 we are using classes to scope styles instead of attributes, and SVG DOM elements do not implement a
className
setter, so trying to set that throws an exception. Classes are allowed on SVG elements, but they can't be programmatically set that way.I see that when classes are used on SVG elements normally, the generated code uses
setAttribute
, and so we should probably make sure we use that for CSS scope classes as well.I'm not sure why this didn't show up in unit tests. Either there aren't any unit tests have scoped CSS and SVG or (more worrisome) jsdom erroneously supports .className setting on SVG elements.
The text was updated successfully, but these errors were encountered: