Loading ...
Sorry, an error occurred while loading the content.

Re: Re: Re: Re: Can I put animation elements in 'defs' element?

Expand Messages
  • Niklas Gustavsson
    ... And cx.baseVal is read-only so you can t assing a SVGLength to it. This is how I first interpreted it as well. ... But, the following text in the spec for
    Message 1 of 20 , Oct 10, 2002
    • 0 Attachment
      > I actually beg to differ. "cx" is indeed read-only, but to me that only
      > means that you can't assign another SVGAnimatedLength instance to "cx".

      And cx.baseVal is read-only so you can't assing a SVGLength to it.

      This is how I first interpreted it as well.

      > However, "cx.baseVal.value" is *not* read-only and I should be able to
      > set it accordingly, I think... if only we had a viewer to test against.

      But, the following text in the spec for SVGLength.value made me change my
      mind:
      " DOMException NO_MODIFICATION_ALLOWED_ERR: Raised on an attempt to change
      the value of a readonly attribute."

      My way of reading this is that if the SVGLength is read-only, setting the
      .value directly will cause an exception. However, if SVGLength had been
      read-write, setting the .value would be okey. And that's why they didn't
      simply make .value read-only, because sometimes it might be okey to write to
      it.

      > Whatever happens, this is interesting discussion!

      It certainly is!

      /niklas
    • Antoine Quint
      Hey Niklas, ... Right! I think you proved your case there. You re the DOM interface reading master! DOM interfaces specifications are like credit card
      Message 2 of 20 , Oct 10, 2002
      • 0 Attachment
        Hey Niklas,

        > But, the following text in the spec for SVGLength.value made me change
        > my
        > mind:
        > " DOMException NO_MODIFICATION_ALLOWED_ERR: Raised on an attempt to
        > change
        > the value of a readonly attribute."

        Right! I think you proved your case there. You're the DOM interface
        reading master! DOM interfaces specifications are like credit card
        contracts, you should always read the fine prints.

        It does look like setAttributeNS() is the only way to change the base
        value of an attribute.

        Antoine
      • Niklas Gustavsson
        ... oh, horray... I ll put that on my CV :-D ... And I think that s good. Only one way of doing a thing keeps it simple (at least when writing an viewer :-)
        Message 3 of 20 , Oct 10, 2002
        • 0 Attachment
          > Right! I think you proved your case there. You're the DOM interface
          > reading master!

          oh, horray... I'll put that on my CV :-D

          > It does look like setAttributeNS() is the only way to change the base
          > value of an attribute.

          And I think that's good. Only one way of doing a thing keeps it simple (at
          least when writing an viewer :-)

          /niklas
        • Kevin Lindsey
          Antoine and Niklas, ... Sorry guys, but I have to differ with this interpretation for a few reasons. Here s the full description for the value attribute from
          Message 4 of 20 , Oct 10, 2002
          • 0 Attachment
            Antoine and Niklas,

            >> But, the following text in the spec for SVGLength.value made me change my
            mind:
            >> "DOMException NO_MODIFICATION_ALLOWED_ERR: Raised on an attempt to
            >> change the value of a readonly attribute."
            >
            > Right! I think you proved your case there. You're the DOM interface
            > reading master! DOM interfaces specifications are like credit card
            > contracts, you should always read the fine prints.

            Sorry guys, but I have to differ with this interpretation for a few reasons.
            Here's the full description for the value attribute from the SVG 1.0 spec:

            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.

            Firstly, there is text describing specifically what happens *when you set
            this attribute*. Secondly, I compare this to the currentTranslate attribute
            of the SVGSVGElement interface. The IDL shows that currentTranslate is
            readonly; however, as Michel pointed out a while back, the attributes of
            currentTranslate, which is an SVGPoint, are not readonly. And indeed, if
            you change the x or y attributes of currentTranslate, it does pan the SVG
            document.

            Take it easy,
            Kevin
            KevLinDev - http://www.kevlindev.com
          • Niklas Gustavsson
            ... reasons. That s allright. I m just guessing here:-) ... Yes, because there might be cases where the SVGLength attribute is read-write. ... Yes, this indeed
            Message 5 of 20 , Oct 10, 2002
            • 0 Attachment
              > Sorry guys, but I have to differ with this interpretation for a few
              reasons.

              That's allright. I'm just guessing here:-)

              > Firstly, there is text describing specifically what happens *when you set
              > this attribute*.

              Yes, because there might be cases where the SVGLength attribute is
              read-write.

              > Secondly, I compare this to the currentTranslate attribute
              > of the SVGSVGElement interface. The IDL shows that currentTranslate is
              > readonly; however, as Michel pointed out a while back, the attributes of
              > currentTranslate, which is an SVGPoint, are not readonly. And indeed, if
              > you change the x or y attributes of currentTranslate, it does pan the SVG
              > document.

              Yes, this indeed troubeling for my argument :-) I do note that there is a
              difference between these two cases: currentTranslate is not directly
              represented by an attribute on the SVG element. But I agree, if I were to be
              correct, this should not be allowed. So it's either an error in my argument
              or in the implementation :-)

              If it's allowed to set the baseVal directly, it would be interesting to know
              how the regular DOM should be updated. For example, if I do:
              circle.cx.baseVal.value = 1/3;

              what should:
              circle.getAttributeNS(null, "cx")
              return?

              It would be nice if someone (Dean, Jon, Chris?) who knows this better then
              we do could set us straight on this issue.

              /niklas
            Your message has been successfully submitted and would be delivered to recipients shortly.