wiki:SVG properties

Version 5 (modified by Said Abou-Hallawa, 3 years ago) (diff)

--

SVG Properties

What is an SVG property?

It is a data type which can be primitive DOM type or SVG type. Example of primitive types are int, float, boolean. Examples for DOM type is DOMString. And examples for SVG types are SVGNumber, SVGNumberList, SVGLength, SVGLengthList, SVGAngle, SVGPoint, SVGPointList.

What is so special about SVG property?

  1. It has its own DOM interface which is separate from getAttribute() and setAttribute() methods.
  2. It is a reflection of a DOM attribute. This means, setAttribute() should, affect the SVG property once it is called. Also getAttribute() should reflect the latest changed value of the SVG property. Let's call updating the SVG property from the attribute 'synchronize'. And let's call updating the attribute from the SVG property 'commit'
  3. Most of the properties are animated properties. The animated property has two members baseVal() and the animal(). Each of them are from the same SVG property type. animal() differs from baseVal() only when animating. Otherwise they have to be the same value.
  4. The animal() of the animated property is read only; no changes from the DOM is allowed.
  5. The SVG property can be attached to an SVGElement or it can be detached.

What things to consider for storing, modifying and animating the SVG property?

  1. It has to be RefCounted because the DOM object will encapsulate the same SVG property and this DOM object can outlive the owner element.
  2. Some properties are SVG lists of SVG types, e.g. SVGNumberList and SVGPointList. In addition of having the SVGNumberList itself Refcounted, all the items themselves have to be RefCounted also. The items can outlive the owner list itself.