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

Don't re-add existing styles to SVGShapeElement #3039

Merged
merged 2 commits into from
Mar 19, 2024

Conversation

geomaster
Copy link
Contributor

This is a recreation of PR #2983, since that one erroneously used our fork's master, which has since gotten additional commits. See that PR for previous discussion.

When calling SVGShapeElement.reloadShapes(), searchShapes() will correctly reconcile modified and added shapes and reuse their elements. However, it will call setElementStyles(), which will add all style elements unconditionally to this.stylesList, even if the styles were already in there, making it grow indefinitely and causing other problems down the line.

Modify setElementStyles() to check for the existence of a particular style before adding it.

When calling `SVGShapeElement.reloadShapes()`, `searchShapes()` will
correctly reconciliate modified and added shapes and reuse their
elements. However, it will call `setElementStyles()`, which will add all
styles unconditionally to `this.stylesList`, even if the styles were
already in there.

Modify `setElementStyles()` to check for the existence of a particular
style before adding it.
@AliT3 AliT3 merged commit ff97f94 into airbnb:master Mar 19, 2024
1 check failed
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.

2 participants