I've simplified an SVG animation I'm working on (which should look like a container filling up) to the example below which runs smoothly in Chrome, but is choppy/stutters in Firefox. It's an SVG with three layers: The first layer is a <mask> for the last layer which is a red circle. The middle layer of the SVG is a grey circle. So the red circle sits on top of the grey circle and is made visible by the mask which gets animated via CSS:
#color-mask {
fill: white;
}
#color-mask path {
animation: waves .75s infinite linear;
}
@keyframes waves {
from {
transform: translateX(17rem);
}
to {
transform: translateX(-17rem);
}
}
#color-mask g {
animation: raise 6s infinite ease-in-out;
animation-direction: alternate;
}
@keyframes raise {
from {
transform: translateY(11rem);
}
to {
transform: translateY(-18rem);
}
}
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" viewBox="0 0 400 400">
<mask id="color-mask">
<g>
<path d="m 909.1,353.4 0,-67.6 c -70.8,0 -106.9,-14.7 -141.7,-29 -34.9,-14.3 -71,-29 -142.1,-29 -71,0 -107.2,14.8 -142.1,29 -34.8,14.2 -70.9,29 -141.7,29 -70.8,0 -106.9,-14.7 -141.7,-29 -34.9,-14.3 -71,-29 -142.1,-29 -71.1,0 -107.2,14.8 -142.1,29 -34.8,14.2 -70.9,29 -141.7,29 -70.8,0 -106.9,-14.7 -141.7,-29 -34.9,-14.3 -71,-29 -142.1,-29 l 0,632.2 1419,0 z"/>
</g>
</mask>
<g id="grey">
<circle id="top_grey" style="fill: rgb(180, 180, 180);" cx="200" cy="200" r="200"></circle>
</g>
<g id="color" mask="url(#color-mask)">
<circle id="top_color" style="fill: rgb(196, 3, 3);" cx="200" cy="200" r="200"></circle>
</g>
</svg>
The CSS animation translates the <mask> both horizontally and vertically but at different rates.
I've also tried using a <clipPath> instead of a <mask> and get the same results. I get the same choppy/stuttering results in Firefox on Windows and Linux.
One very odd quirk I noticed in Firefox is that if I have the dev tools open, the animation occasionally will run smoothly. Firefox's dev tools also don't seem to indicate any problems, but I'm not an expert in SVG animations. Why is Firefox choking on this while Chrome isn't?