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

Clarification of readonly attributes

From: Tim Rowley <tor@cs.brown.edu>
Date: Thu, 18 Nov 2004 18:27:06 -0500
To: www-svg@w3.org
Message-ID: <20041118232706.GA4154@cs.brown.edu>

For the purpose of example I'll use SVGAnimatedLength in this
mail, but other SVG types have the same general pattern.

Cut&paste selected bits of the IDL:

  interface SVGFooElement {
    readonly attribute SVGAnimatedLength x;

  interface SVGAnimatedLength { 
    readonly attribute SVGLength baseVal;
    readonly attribute SVGLength animVal;

  interface SVGLength { 
    attribute float value;   // raises DOMException on setting

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?  As in, should "fooInstance.x.baseVal.value = 42"
throw an exception?
Received on Friday, 19 November 2004 05:26:13 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:01 UTC