Re: Attribute and SVG object synchronization.

Blaine,

At 09:09 AM 10/26/00 -0700, Blaine Brodie wrote:
>The current SVG specification does not mention this, but I assume that an
>SVGElement's attributes must be synchronized with their corresponding SVG
>objects.  For example, an SVGCircleElement's 'cx' attribute must be
>synchronized with its 'cx' SVGAnimatedLength object.  So, if I perform the
>following calls on SVGCircleElement named 'circle':
>   circle.setAttribute("cx", "100");
>   circle.getCx().getBaseVal().setValue(50);
>
>then circle.getAttribute("cx") should return '50'.  Right?

Yes. I'll add a clarification to the spec before Proposed Recommendation.


>This leads me into another question regarding outstanding references to
>SVG objects.  What is expected to happen to these references when the
>attribute's string value becomes updated.  Do these objects simply get
>detached from their parent elements or do they get updated with new
>values?  Here's an example:
>
>   circle.setAttribute("cx", "50");
>   SVGLength length = circle.getCx().getBaseVal(); //got a reference
>   length.getValue(); //returns 50
>
>   circle.setAttribute("cx", "100"); //set the 'cx' attribute.  Is the
>outstanding 'length' reference updated or detached from its parent element?
>   length.getValue(); //returns '50' or '100'?
>
>If the objects simply get detached, then the last call would return '50'.
>If outstanding references are updated then the last call would return
>'100'.

It should return '100'. The reference is not detached. It is pointing to 
the active part of the document tree. I'll add a clarification to the spec 
before Proposed Recommendation.

Jon Ferraiolo
SVG Editor
Adobe Systems Incorporated

>Thanks for the clarification.
>---
>Blaine

Received on Thursday, 26 October 2000 12:33:46 UTC