You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by "Fennell, Philip" <ph...@hp.com> on 2006/08/03 08:39:56 UTC

JavaScript DOM Events test case for multiple listeners and modifier keys problems.

Hello,

Further to my previous e-mails reguarding script problems with Batik 1.6
and Rhino 1.6 I have a test case which exhibits two of my main problems.

1) The embedded scripts attempt to attach multiple event listeners to
the same DOM node but only the first listener gets registered. In
addition the starck trace (listed below) is generated.

2) Also the MouseEvent modifier key attributes {shift, ctrl and alt] are
not working correctly (see end of this e-mail).


I have attached the example SVG file (example.svg)


Regards


Philip Fennell



     [java] java.lang.NoSuchFieldError: instance
     [java]     at
org.apache.batik.script.rhino.EventTargetWrapper$FunctionAddProxy.call(U
nknown Source)
     [java]     at
org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:84)
     [java]     at org.mozilla.javascript.gen.c4._c1(Inline <svg:script>
null:-1:7)
     [java]     at org.mozilla.javascript.gen.c4.call(Inline
<svg:script> null:-1)
     [java]     at
org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:95)
     [java]     at org.mozilla.javascript.gen.c5._c1(Inline <svg:script>
null:-1:10)
     [java]     at org.mozilla.javascript.gen.c5.call(Inline
<svg:script> null:-1)
     [java]     at
org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:95)
     [java]     at org.mozilla.javascript.gen.c6._c0(Event attribute
null:-1 onload:1)
     [java]     at org.mozilla.javascript.gen.c6.call(Event attribute
null:-1 onload)
     [java]     at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:337)
     [java]     at
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2755)
     [java]     at org.mozilla.javascript.gen.c6.call(Event attribute
null:-1 onload)
     [java]     at org.mozilla.javascript.gen.c6.exec(Event attribute
null:-1 onload)
     [java]     at
org.mozilla.javascript.Context.evaluateReader(Context.java:1163)
     [java]     at
org.apache.batik.script.rhino.RhinoInterpreter.evaluate(Unknown Source)
     [java]     at
org.apache.batik.bridge.BaseScriptingEnvironment$1.handleEvent(Unknown
Source)
     [java]     at
org.apache.batik.dom.events.EventSupport.fireEventListeners(Unknown
Source)
     [java]     at
org.apache.batik.dom.events.EventSupport.fireEventListeners(Unknown
Source)
     [java]     at
org.apache.batik.dom.events.EventSupport.dispatchEvent(Unknown Source)
     [java]     at
org.apache.batik.dom.AbstractNode.dispatchEvent(Unknown Source)
     [java]     at
org.apache.batik.bridge.BaseScriptingEnvironment.dispatchSVGLoad(Unknown
Source)
     [java]     at
org.apache.batik.bridge.BaseScriptingEnvironment.dispatchSVGLoadEvent(Un
known Source)
     [java]     at
org.apache.batik.bridge.UpdateManager.dispatchSVGLoadEvent(Unknown
Source)
     [java]     at
org.apache.batik.bridge.UpdateManager.dispatchSVGLoadEvent(Unknown
Source)
     [java]     at
org.apache.batik.swing.svg.SVGLoadEventDispatcher.run(Unknown Source)




-----Original Message-----
From: Fennell, Philip
Sent: 28 July 2006 11:48
To: batik-users@xmlgraphics.apache.org
Subject: JavaScript and MouseEvent modifier keys problem

Hello,

When listening to DOM MouseEvent events the modifier keys attributes
(shiftKey, ctrlKey and altKey) should indicate 'true' when those keys
are pressed when a mouse event (click, move, etc...) occurs.

It turns out that, for listeners attached to the SVGDOM using
JavaScript, the following behaviour is exhibited when a mouse event
occurs:

1) None of the modifier key attributes indicate 'true' when they are
individually pressed.
2) If [Ctrl] + [Shift] are pressed together the shiftKey == true.
3) If  [Alt] + [Shift] are pressed together the shiftKey == true.
4) If  [Alt] + [Ctrl]  are pressed together the  ctrlKey == true.

This is not the correct behaviour.

I have run the same example in ASV3, Opera 9 and FireFox 1.5.5 and they
all behave correctly.

As this is a DOM Events problem I will combine it with the multiple
event listener problem I reported last week and create a test example
that covers both.




Regards

Philip Fennell 

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


RE: JavaScript DOM Events test case for multiple listeners and modifier keys problems.

Posted by "Fennell, Philip" <ph...@hp.com>.
Thomas,

I can confirm that Rhino 1.6RC2 is responsible for my inability to
attach multiple event listeners.

However, the problem with MouseEvent modifier keys is present in the
current release of Batik 1.6.


Regards

Philip Fennell


 

-----Original Message-----
From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com] 
Sent: 04 August 2006 11:10
To: batik-users@xmlgraphics.apache.org
Cc: batik-users@xmlgraphics.apache.org
Subject: RE: JavaScript DOM Events test case for multiple listeners and
modifier keys problems.

Hi Philip,

"Fennell, Philip" <ph...@hp.com> wrote on 08/03/2006 03:14:46
AM:

> I have already found the cause of the 'java.lang.NoSuchFieldError:
> instance' problem, I have been using Batik 1.6 with Rhino 1.6RC2.

   Ahh, the Rhino version is likely the problem.

> If I use the js.jar that comes with Batik the problem goes away. I 
> wonder if the other DOM Event related problems will disappear too?

   This is definitely one area where we needed to get pretty deep into
the engine to make the DOM callbacks work right.

> I will go and find out ASAP.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


RE: JavaScript DOM Events test case for multiple listeners and modifier keys problems.

Posted by th...@kodak.com.
Hi Philip,

"Fennell, Philip" <ph...@hp.com> wrote on 08/03/2006 03:14:46 AM:

> I have already found the cause of the 'java.lang.NoSuchFieldError:
> instance' problem, I have been using Batik 1.6 with Rhino 1.6RC2.

   Ahh, the Rhino version is likely the problem.

> If I use the js.jar that comes with Batik the problem goes away. I
> wonder if the other DOM Event related problems will disappear too?

   This is definitely one area where we needed to get pretty
deep into the engine to make the DOM callbacks work right.

> I will go and find out ASAP.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


RE: JavaScript DOM Events test case for multiple listeners and modifier keys problems.

Posted by "Fennell, Philip" <ph...@hp.com>.
Hello,

I have already found the cause of the 'java.lang.NoSuchFieldError:
instance' problem, I have been using Batik 1.6 with Rhino 1.6RC2.

If I use the js.jar that comes with Batik the problem goes away. I
wonder if the other DOM Event related problems will disappear too?

I will go and find out ASAP.



Regards

Philip Fennell

-----Original Message-----
From: Fennell, Philip 
Sent: 03 August 2006 07:40
To: batik-users@xmlgraphics.apache.org
Subject: JavaScript DOM Events test case for multiple listeners and
modifier keys problems.

Hello,

Further to my previous e-mails reguarding script problems with Batik 1.6
and Rhino 1.6 I have a test case which exhibits two of my main problems.

1) The embedded scripts attempt to attach multiple event listeners to
the same DOM node but only the first listener gets registered. In
addition the starck trace (listed below) is generated.

2) Also the MouseEvent modifier key attributes {shift, ctrl and alt] are
not working correctly (see end of this e-mail).


I have attached the example SVG file (example.svg)


Regards


Philip Fennell



     [java] java.lang.NoSuchFieldError: instance
     [java]     at
org.apache.batik.script.rhino.EventTargetWrapper$FunctionAddProxy.call(U
nknown Source)
     [java]     at
org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:84)
     [java]     at org.mozilla.javascript.gen.c4._c1(Inline <svg:script>
null:-1:7)
     [java]     at org.mozilla.javascript.gen.c4.call(Inline
<svg:script> null:-1)
     [java]     at
org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:95)
     [java]     at org.mozilla.javascript.gen.c5._c1(Inline <svg:script>
null:-1:10)
     [java]     at org.mozilla.javascript.gen.c5.call(Inline
<svg:script> null:-1)
     [java]     at
org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:95)
     [java]     at org.mozilla.javascript.gen.c6._c0(Event attribute
null:-1 onload:1)
     [java]     at org.mozilla.javascript.gen.c6.call(Event attribute
null:-1 onload)
     [java]     at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:337)
     [java]     at
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2755)
     [java]     at org.mozilla.javascript.gen.c6.call(Event attribute
null:-1 onload)
     [java]     at org.mozilla.javascript.gen.c6.exec(Event attribute
null:-1 onload)
     [java]     at
org.mozilla.javascript.Context.evaluateReader(Context.java:1163)
     [java]     at
org.apache.batik.script.rhino.RhinoInterpreter.evaluate(Unknown Source)
     [java]     at
org.apache.batik.bridge.BaseScriptingEnvironment$1.handleEvent(Unknown
Source)
     [java]     at
org.apache.batik.dom.events.EventSupport.fireEventListeners(Unknown
Source)
     [java]     at
org.apache.batik.dom.events.EventSupport.fireEventListeners(Unknown
Source)
     [java]     at
org.apache.batik.dom.events.EventSupport.dispatchEvent(Unknown Source)
     [java]     at
org.apache.batik.dom.AbstractNode.dispatchEvent(Unknown Source)
     [java]     at
org.apache.batik.bridge.BaseScriptingEnvironment.dispatchSVGLoad(Unknown
Source)
     [java]     at
org.apache.batik.bridge.BaseScriptingEnvironment.dispatchSVGLoadEvent(Un
known Source)
     [java]     at
org.apache.batik.bridge.UpdateManager.dispatchSVGLoadEvent(Unknown
Source)
     [java]     at
org.apache.batik.bridge.UpdateManager.dispatchSVGLoadEvent(Unknown
Source)
     [java]     at
org.apache.batik.swing.svg.SVGLoadEventDispatcher.run(Unknown Source)




-----Original Message-----
From: Fennell, Philip
Sent: 28 July 2006 11:48
To: batik-users@xmlgraphics.apache.org
Subject: JavaScript and MouseEvent modifier keys problem

Hello,

When listening to DOM MouseEvent events the modifier keys attributes
(shiftKey, ctrlKey and altKey) should indicate 'true' when those keys
are pressed when a mouse event (click, move, etc...) occurs.

It turns out that, for listeners attached to the SVGDOM using
JavaScript, the following behaviour is exhibited when a mouse event
occurs:

1) None of the modifier key attributes indicate 'true' when they are
individually pressed.
2) If [Ctrl] + [Shift] are pressed together the shiftKey == true.
3) If  [Alt] + [Shift] are pressed together the shiftKey == true.
4) If  [Alt] + [Ctrl]  are pressed together the  ctrlKey == true.

This is not the correct behaviour.

I have run the same example in ASV3, Opera 9 and FireFox 1.5.5 and they
all behave correctly.

As this is a DOM Events problem I will combine it with the multiple
event listener problem I reported last week and create a test example
that covers both.




Regards

Philip Fennell 

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org