Changes between Version 9 and Version 10 of SVG properties

Mar 9, 2019 10:46:23 PM (2 years ago)
Said Abou-Hallawa



  • SVG properties

    v9 v10  
    18185. The animal() of the animated property is read only; no changes from the DOM is allowed.
    19196. The SVG property can be attached to an SVGElement or it can be detached.
     20 * When the property is attached, a change in its value has to be synchronized with the attribute value.
     21 * When the property is detached, a change in its value has no effect on any other element.
    20227. Some properties are SVG lists of SVG types, e.g. SVGNumberList and SVGPointList. In addition of having the list itself Refcounted, all the items of this list have to be RefCounted also. The items can outlive the owner list.
     24**SVG Tear-Off objects**
     26The old design of managing the SVG properties relied on storing only the underlaying data in the SVG element. For example, the SVGRectElement was storing an SVGLengthValue for the baseVal of 'x' property. When the property is requested from the DOM a SVGAnimatedLength has to be constructed. Constructing the SVGAnimatedLength happens through creating and caching an animated SVG tear-off object. The animated tear-off object is a RefCounted and it holds two SVGLength objects for the baseVal and the animVal. The SVGLength object is another type of tear-off objects. This design has many flaws:
     271. The animated tear off objects are cached in a hash table outside of the SVGElement although it holds a raw pointer to the property raw data in the SVGElement.
     282. It was difficult to deal with optional properties, for example the 'stdDeviation' property of SVGFEGaussianBlurElement. This is because the key of hash table is the pair <SVGElement, attributeName>
     293. It was difficult to deal with list properties, for example the 'x' property of SVGTextPositioningElement. The individual items of the SVG tear off object holds raw pointers to the raw data items in the SVGElement. It becomes even more difficult when animating. The animVal tear off list owns the values of the items while the baseVal tear off list items hold pointers to the raw data which is held by the SVGElement.
     31**New Design for the SVG properties**
     33The goal of the new design is to make the life cycle of the SVG properties clear. It has to well define the relationship between the property and its owner such that synchronizing the change in the property with the SVGElement becomes straightforward.
     34* The SVGElement will own the RefCounted animated SVG property with will own the RefCounted SVG properties for the baseVal and the animVal. This eliminate the need to cache animated SVG property outside the SVGElement like what the SVG tear off objects were doing.
    2237**Mechanic of the SVG property**