Re: Adding a length attribute into a length list

Hi Craig.

Craig Topper:
> What is something like the following supposed to do?
> 
> textElement.x.baseVal.appendItem(rectElement.x.animVal)

>From a strict reading of SVGLengthList::appendItem(), it would seem that
the SVGLength object would be shared between textElement.x.baseVal and
rectElement.x.animVal.

> Seems this would allow animation to change the base value which is
> just weird.

Yes, I don’t think we should allow this.

> What is the intended behavior for putting length attributes into a
> length list?

I think the original designers of the SVG DOM intended that SVGLength
objects are never shared between different parent SVG DOM objects.  So
we could choose to either create a clone of the SVGLength to insert into
the SVGLengthList or throw an exception.  I think the former is more
reasonable.  I don’t think it makes sense to try to “remove” the
SVGLength from its parent SVGAnimatedLength, since SVGAnimated* objects
are always read only.

-- 
Cameron McCormack ≝ http://mcc.id.au/

Received on Sunday, 20 September 2009 01:34:05 UTC