W3C home > Mailing lists > Public > www-svg@w3.org > September 2009

Re: Adding a length attribute into a length list

From: Cameron McCormack <cam@mcc.id.au>
Date: Sun, 20 Sep 2009 11:33:24 +1000
To: Craig Topper <craig.topper@gmail.com>
Cc: www-svg@w3.org
Message-ID: <20090920013322.GB18710@wok.mcc.id.au>
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 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:43 GMT