-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
fix(): nested duplicated clipPath causes infinite recursion #10667
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
fix(): nested duplicated clipPath causes infinite recursion #10667
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
Build Stats
|
|
the unit test I added hangs on vitest without the fix |
| if (gradientDef) { | ||
| const opacityAttr = el.getAttribute(property + '-opacity'); | ||
| const gradient = Gradient.fromElement(gradientDef, obj, { | ||
| const gradient = Gradient.fromElement(gradientDef.def, obj, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we are using gradientDef.def, the if condition above needs to check for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch will add few more unit tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed new commit, please recheck
fix condition and add 2 more unit tests
|
I m not sure how this fix works. I didn't dig in the code when i checked this issue, but my impression was that i would have had to duplicate the double referenced clipPath with a clone of itself in order to avoid the infinite recursion |
you are right |
|
Leave it open, the hardest task is to make an svg that has a nested clipPath and that has visual differences with one that doesn't have a nested clipPath. Once we have a reproducible use case of an svg that can render something that works we can add it here and see what happens |
I have reopened it now |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs 😔. Thank you for your contributions. |
|
closing in favor of #10774 |
fixes #10659