I think this is a SVG 1.1 vs SVG 2 issue. In SVG 1.1, which is the version that browsers generally support, the transform
attribute was not valid for the <svg>
element. It is allowed in SVG 2.
Firefox have started implementing some SVG 2 features, whereas Chrome is not so far along.
The simplest solution is just to put your transform on the <rect>
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…