SVG:Data Storage: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 2: Line 2:


== Introduction ==
== Introduction ==
One of the ways the SVG specification differs from other W3C XML specifications is in the way it crams a lot of data into attributes. For example, it's not uncommon to see an SVG file containing a <path> tag with a 'd' attribute (for the path data points) similar to the following:
<pre>
<path d="M600,350 l 50,-25
        a25,25 -30 0,1 50,-25 l 50,-25
        a25,50 -30 0,1 50,-25 l 50,-25
        a25,75 -30 0,1 50,-25 l 50,-25
        a25,100 -30 0,1 50,-25 l 50,-25">
</pre>
Having so much data crammed into attributes could make it difficult to programmatically access and change much of the data in an SVG graphic. To make that easier, almost all SVG element attributes (data crammed or otherwise) have a corresponding tree of objects full of typed data in the SVG DOM. This eliminates the need for simple scripters to write their own parsing code. However, it presents many challenges to implementers who must provide these object heavy interfaces while minimising memory use and maximising rendering speed.


This page contains thoughts regarding how we might redesign the way we store the typed values associated with the attributes of SVG elements. E.g., the SVG 'transform' attribute is mirrored by an SVGAnimatedTransformList object, which contains baseVal and animVal lists of SVGTransform objects, where each SVGTransform owns an SVGMatrix. (Many other attribute values are also represented by different types of object trees such as SVGLength[List], SVGPointList, SVGAngle, SVGColor, SVGPreserveAspectRatio, SVGPathSegList, etc.)  
This page contains thoughts regarding how we might redesign the way we store the typed values associated with the attributes of SVG elements. E.g., the SVG 'transform' attribute is mirrored by an SVGAnimatedTransformList object, which contains baseVal and animVal lists of SVGTransform objects, where each SVGTransform owns an SVGMatrix. (Many other attribute values are also represented by different types of object trees such as SVGLength[List], SVGPointList, SVGAngle, SVGColor, SVGPreserveAspectRatio, SVGPathSegList, etc.)  
Confirmed users, Bureaucrats and Sysops emeriti
969

edits

Navigation menu