W3C home > Mailing lists > Public > www-svg@w3.org > November 2004

Re: Clarification of readonly attributes

From: Cameron McCormack <cam-www-svg@aka.mcc.id.au>
Date: Fri, 19 Nov 2004 18:49:35 +1100
To: www-svg@w3.org
Message-ID: <20041119074935.GA22759@mcc.id.au>

Hi Tim.

Tim Rowley:
> The IDL prose for SVGLength states:
> 
>    float value
> 
>        The value as an floating point value, in user
>        units. Setting this attribute will cause
>        valueInSpecifiedUnits and valueAsString to be updated
>        automatically to reflect this setting.
> 
>      Exceptions on setting
> 
>         DOMException NO_MODIFICATION_ALLOWED_ERR: Raised on an
>         attempt to change the value of a readonly attribute.
> 
> Since the attributes are readonly down to the scalar level, does
> that mean that the value of x can't be modified by anything other
> than setAttribute?

No, the value on the SVGLength interface isn't readonly.

> As in, should "fooInstance.x.baseVal.value = 42" throw an exception?

No, but this would through an exception:

  fooInstance.x.baseVal =
    fooInstance.ownerDocument.rootElement.createSVGLength();

You can't change which SVGLength object fooInstance.x.baseVal refers to,
but you can change properties of the existing SVGlength object (assuming
they aren't themselves readonly).

Cameron

-- 
Cameron McCormack
|  Web: http://mcc.id.au/
|  ICQ: 26955922
Received on Friday, 19 November 2004 07:49:47 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:14:52 UTC