Bug 41336 - SVGRadialGradientElement getR().getBaseVal() throw exception
Summary: SVGRadialGradientElement getR().getBaseVal() throw exception
Status: RESOLVED FIXED
Alias: None
Product: Batik - Now in Jira
Classification: Unclassified
Component: SVG DOM (show other bugs)
Version: 1.6
Hardware: All All
: P2 major
Target Milestone: ---
Assignee: Batik Developer's Mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-10 00:30 UTC by Tonny
Modified: 2007-01-11 15:40 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tonny 2007-01-10 00:30:58 UTC
Calling elt.getR().getBaseVal() (elt is SVGRadial GradientElement) throw the
following exception,

org.apache.batik.dom.svg.LiveAttributeException
        at org.apache.batik.dom.svg.AbstractSVGAnimatedLength
$BaseSVGLength.revalidate(Unknown Source)
        at
org.apache.batik.dom.svg.AbstractSVGLength.getValueAsString(Unknown
Source)

Look at the Batik source code, it because the null value passed on private void
initializeLiveAttributes() at SVGOMRadialGradientElement especially the line   
     
r = createLiveAnimatedLength(null, SVG_R_ATTRIBUTE,
null,SVGOMAnimatedLength.OTHER_LENGTH,false);

Where as according to the SVG Spec the r value: If the attribute is not
specified, the effect is as if a value of "50%" were specified.

The fix is simple, it should be 
r = createLiveAnimatedLength(null, SVG_R_ATTRIBUTE,
SVG_RADIAL_GRADIENT_R_DEFAULT_VALUE,SVGOMAnimatedLength.OTHER_LENGTH,false);
Comment 1 Cameron McCormack 2007-01-11 15:40:27 UTC
Hi Tonny.

You are right, this should have a default value of "50%".

Fixed in SVN.