DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42014>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42014

           Summary: baseVal cannot be initialized via DOM
           Product: Batik
           Version: 1.7
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: SVG DOM
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


Setting baseVal.value of an element that has been created with DOM methods
gives SVG Error "null":

org.apache.batik.dom.svg.LiveAttributeException
        at
org.apache.batik.dom.svg.AbstractSVGAnimatedLength$BaseSVGLength.revalidate(Unknown
Source)
        at org.apache.batik.dom.svg.AbstractSVGLength.setValue(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.mozilla.javascript.MemberBox.invoke(Unknown Source)
        at org.mozilla.javascript.JavaMembers.put(Unknown Source)
        at org.mozilla.javascript.NativeJavaObject.put(Unknown Source)
        at org.mozilla.javascript.ScriptableObject.putProperty(Unknown Source)
        at org.mozilla.javascript.ScriptRuntime.setObjectProp(Unknown Source)
        at org.mozilla.javascript.ScriptRuntime.setObjectProp(Unknown Source)
        at org.mozilla.javascript.gen.c2782._c0(Event attribute
file:/home/batik/tests/baseval.svg:8 onload:1)
        at org.mozilla.javascript.gen.c2782.call(Event attribute
file:/home/batik/tests/baseval.svg:8 onload)
        at org.mozilla.javascript.ContextFactory.doTopCall(Unknown Source)
        at org.mozilla.javascript.ScriptRuntime.doTopCall(Unknown Source)
        at org.mozilla.javascript.gen.c2782.call(Event attribute
file:/home/batik/tests/baseval.svg:8 onload)
        at org.mozilla.javascript.gen.c2782.exec(Event attribute
file:/home/batik/tests/baseval.svg:8 onload)
        at org.mozilla.javascript.Context.evaluateReader(Unknown Source)
        at org.apache.batik.script.rhino.RhinoInterpreter$2.run(Unknown Source)
        at org.mozilla.javascript.Context.call(Unknown Source)
        at org.mozilla.javascript.ContextFactory.call(Unknown Source)
        at org.apache.batik.script.rhino.RhinoInterpreter.evaluate(Unknown 
Source)
        at 
org.apache.batik.bridge.BaseScriptingEnvironment$1.handleEvent(Unknown Source)
        at org.apache.batik.dom.events.EventSupport.fireEventListeners(Unknown 
Source)
        at org.apache.batik.dom.events.EventSupport.fireEventListeners(Unknown 
Source)
        at org.apache.batik.dom.events.EventSupport.dispatchEvent(Unknown 
Source)
        at org.apache.batik.dom.AbstractNode.dispatchEvent(Unknown Source)
        at 
org.apache.batik.bridge.BaseScriptingEnvironment.dispatchSVGLoad(Unknown Source)
        at
org.apache.batik.bridge.BaseScriptingEnvironment.dispatchSVGLoadEvent(Unknown
Source)
        at org.apache.batik.bridge.UpdateManager.dispatchSVGLoadEvent(Unknown 
Source)
        at org.apache.batik.bridge.UpdateManager.dispatchSVGLoadEvent(Unknown 
Source)
        at org.apache.batik.swing.svg.SVGLoadEventDispatcher.run(Unknown Source)

for this document:

<?xml version="1.0" encoding="iso-8859-1"?>
<svg xmlns="http://www.w3.org/2000/svg"; viewBox="-1 -1 3 3"
 onload='
  var root= document.rootElement;
  var elt= document.createElementNS( root.namespaceURI, "rect" );
  elt.width.baseVal.value= 1;
  elt.height.baseVal.value= 1;
  root.appendChild( elt );
 '/>

Note that it isn't possible to use createSVGLength() first because baseVal
is readonly (however, the actual error in Batik is
'Java class "org.apache.batik.dom.svg.SVGOMAnimatedLength" has no public
instance field or method named "baseVal"'), nor is it possible to attach
the element to the document first (gives an exception on missing required
width/height for a <rect/>).

Setting the value with setAttribute() works as expected.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to