- From: Boris Zbarsky <bzbarsky@MIT.EDU>
- Date: Wed, 17 Nov 2004 10:55:56 -0600
- To: Jim Ley <jim@jibbering.com>
- CC: www-svg@w3.org
Jim Ley wrote: > It complicates scripting - because CSS properties are always higher > specificity than attribute properties, it means you have to do > setAttributeNS(null,'style','construct a string of all style > operties') - this is both slower and more complicated than just setting > the stroke-width attribute. I'm sorry, but that doesn't seem to be true. Per the SVG 1.1 spec [1] (and the SVG 1.2 proposal claims to be simply an extension of SVG 1.1 and does not change this part), a UA that has CSS support must support the relevant DOM CSS interfaces. So you can do: node.style.setProperty("stroke-width", value, ""); which is not particularly more complicated than node.setAttribute("stroke-width", value); (and in some UAs may in fact be faster...). Now I won't claim that I know what the state of implementation of this functionality is in current SVG UAs.... (and I would be curious to find out). -Boris [1] http://w3.org/TR/SVG11/svgdom.html#CSSDOMFeaturesWithCSSSupport
Received on Wednesday, 17 November 2004 16:56:08 UTC