Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Chrome read the svg circle radius from the style attribute?

I develop with chrome dev tools.

I just had a demo with IE11.

Well, yes my mistake for not checking with IE, and the syntax below wasn't intended (made a mistake setting properties in d3.js). But I'm hurt because my graph didn't display, and I want to understand the why I couldn't catch the error earlier...

The snippet below works in Chrome, not in IE11.

<html>
<body>
<svg width="120" height="120">
<circle style="fill: rgb(60,60,60); r: 20px; " cy="30" cx="20"></circle>
</svg>
</body>
</html>
like image 710
Rafael Emshoff Avatar asked Feb 11 '23 00:02

Rafael Emshoff


1 Answers

The current published version of the SVG specification is 1.1 it states that the radius of a circle is an attribute and not a CSS property. That's what IE implements.

There is a new version of the SVG specification being worked on, version 2. In it, the radius of a circle (along with many other things that are currently attributes) would be CSS properties. That's what Chrome implements.

Chrome is experimenting with implementing parts of the SVG 2 specification as is Firefox. Different UAs have implemented different parts of the SVG 2 specification as they investigate SVG 2 prior to its completion to prove that it's feasible to implement it.

like image 64
Robert Longson Avatar answered Feb 12 '23 12:02

Robert Longson