I have been breaking my head for hours now. It doens't make any sense.
I reduced the problem I am experiencing to this codepen: https://codepen.io/Octopous/pen/OJORpJQ
HTML:
*the two inline SVG's* (too many characters), see the CodePen
CSS:
svg.one {
display: none;
}
svg.two {
display: block;
}
There's two inline SVG elements on a page. They are identical. When the first SVG is set to "display: none", the second SVG gets scrambled/displays differently. In this case all elements that used to be clipped by a clipping path now ignore the clipping path. When the first SVG is not set to "display: none", the second SVG display correctly, just like the first one.
As the CSS declarations are as simple as can be and couldn't be any more specific, I just can't wrap my head around why the second SVG is even affected by any of this. In all my years as a webdeveloper and working with SVG's I have never come across a problem even close to this.
Things I have tried:
- renaming all the ID's within the second SVG (even though this doesn't make sense)
- Exporting an addition SVG with different dimensions and such so that the second SVG has different properties all together without making it visually different.
Any help is greatly appreciated. It is paramount for this project that both SVG's are indeed the same SVG. As long as this problem exists I simply cannot continue the project.
EDIT: Safari seems to be doing fine, behaviour as expected. Firefox and Chrome both screw it up.