ISSUE-2216 (valueAsString-affecting-unitType): Not clear whether assigning to SVGLength.valueAsString can change the unitType [SVG Full 1.1]

ISSUE-2216 (valueAsString-affecting-unitType): Not clear whether assigning to SVGLength.valueAsString can change the unitType [SVG Full 1.1]

http://www.w3.org/Graphics/SVG/WG/track/issues/2216

Raised by: Cameron McCormack
On product: SVG Full 1.1

When assigning to SVGLength.valueAsString (or SVGAngle.valueAsString), the unitType should be changed to whatever was parsed from the given string.  For example:

  var l = /* an SVGLength object */;
  l.valueAsString = '1em';
  assert(l.unitType == SVGLength.SVG_LENGTHTYPE_EMS);
  assert(l.valueInSpecifiedUnits == 1);

But the current text describing valueAsString says:

  The value as a string value, in the units expressed by unitType. Setting this
  attribute will cause value and valueInSpecifiedUnits to be updated
  automatically to reflect this setting.

which doesn't make this clear.

There's also no indication of what exception would be thrown if the given SVGLength string couldn't be parsed, or what exactly is the acceptable syntax.

Received on Thursday, 5 February 2009 23:55:34 UTC