<svg style="width: 200px; height: 200px;">
<rect id="rect" width="100" height="100" fill="lightsalmon"></rect>
</svg>
<script>
var factor = 50;
var id = setInterval(function() {
rect.setAttribute('rx', factor);
rect.setAttribute('ry', factor);
factor--;
if (!factor) clearInterval(id);
}, 100);
</script>