Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
SVG backend is assigning same id to clipPath elements #4349
If you create a simple HTML file with a couple of SVG elements:
and then using the developer tools in Chrome, you delete one of the images and zoom in (or zoom out), the remaining image has a problem with the clipping paths:
Before deleting image:
After deleting image and zooming in:
The reason is that both figures share the same
Essentially, Firefox and Chrome behave differently depending on the complexity of the figure but this can be solved by assigning different ids to the
I was suggesting to add a random value before generating ids (but maybe your tests are relying on the current behavior in some way).
Isn't this more like a namespace collision issue? The files by themselves
@WeatherGod I would phrase it this way: Figures with the same content share the same id, so if you have two or more figures with the same content in the same document, then you're going to have the issue described previously.
On the contrary, if you have two figures with different content (e.g. histogram and bar plot), they won't share the same ids and the issue will be avoided even if they are in the same document.