When it comes to web development you cannot get more 'Now' than working with Scalable Vector Graphics (SVG). You may think AJAX and the XMLHTTPRequest object is pretty cool but the Adobe SVG Viewer 3.0 (ASVG3) has supported a postURL method, that operates asynchronously, for years now, and for that matter so does the Apache open source SVG toolkit Batik.
But when you're pushing at the edges of things you start to notice where the cracks are. For example, If you pay attention to some of the tutorials/examples you will notice that you can use JavaScript to get the CSSStyleDeclaration object, for a node in your SVG DOM, by using the contextNode.getStyle() method. However, the W3C CSS DOM specification exposes this as a read-only property to be accessed thus; contextNode.style.
Now ASVG3 and Batik seem happy with either, but the FireFox 1.5 and Opera 9 browsers throw a thrum. So you'd better stick to the specs and use '.style' if you want to keep everyone happy.
You may be thinking why does this matter?
Well, unlike XHTML + CSS + DOM you cannot affect style changes just by using contextNode.setAttribute(propertyName, propertyValue). You have to get the context node's style object first and then use contextNode.setProperty(propertyName, propertyValue) instead. Bit of a mouthful? Well yes but it works, and maybe that's how it should work for all mark-up languages.
Monday, 24 July 2006
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment