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

SVGLoader: fix use.href in non-browser environments #23297

Merged
merged 1 commit into from
Jan 24, 2022

Conversation

nkrkv
Copy link
Contributor

@nkrkv nkrkv commented Jan 21, 2022

The current code processing <use> tag tries to access href attribute using DOM element property ignoring the fact it is namespaced (conventionally with xlink alias).

It works in major browsers but fails in some environments that follow the W3C standard. Notably, jsdom. This patch makes it possible to use SVGLoader in NodeJS, and still keeps the original behavior in browsers. Also, it makes the code a little more consistent with surroundings that explicitly use getAttribute method rather than propetry-based access.

@mrdoob mrdoob requested a review from yomboprime January 21, 2022 22:17
@mrdoob mrdoob added this to the r137 milestone Jan 21, 2022
Copy link
Collaborator

@yomboprime yomboprime left a comment

Choose a reason for hiding this comment

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

It seems correct to me.

@mrdoob mrdoob merged commit be9d017 into mrdoob:dev Jan 24, 2022
@mrdoob
Copy link
Owner

mrdoob commented Jan 24, 2022

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants