Here is a test case.  We are attaching dom eventlisteners to objects to handle popup menus.  there seems to be some wierdness when dom events and xlink:href's are combined.  To recreate the error, right click on the black box, the click the little box in the lower right hand corner.  The first time you click it, it will fire one openLink() call.  The second, it will ifre two and so on.

Am I doing something stupid?

Thanks!

Birch

On 1/20/06, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote:
Hi Birch,

        Can you provide a small reproducible test case?

J B <[EMAIL PROTECTED]> wrote on 01/19/2006 09:18:58 PM:

> That's the confusing thing.  I am not calling addListener at all.  I
simply
> extended SVGUserAgentAdapter and overrode the openLink method.  I am
assuming
> the adding of event handlers is done underneath somewhere.
>
> Birch

> On 1/19/06, Andrew Plotkin < [EMAIL PROTECTED]> wrote:
> On Thu, 19 Jan 2006, J B wrote:
>
> > I am seeing that openLink() is being called more than once when a link
is
> > clicked.  The first time it is clicked, the method is called once. THe
> > second time it is called twice.  The third time it is called three
times and
> > so on.
> >
> > Anyone else see this?  I am simply extending SVGUserAgentAdapter and
> > overriding openLink().
>
> It sounds like you're calling an addListener routine once per link
click,
> when you should be calling it just once overall.
>
> --Z
>
> --
> "And Aholibamah bare Jeush, and Jaalam, and Korah: these were the
borogoves..."
> *
> 9/11 did change everything. Since 9/12, the biggest threat to American
> society has been the American president. I'd call that a change.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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


<?xml version="1.0" encoding="UTF-8"?>
<svg contentScriptType="text/ecmascript" 
	xmlns:xlink="http://www.w3.org/1999/xlink"; zoomAndPan="magnify"
	contentStyleType="text/css" width="300" height="300" viewBox="0 0 300 300"
	preserveAspectRatio="xMidYMid meet"
	xmlns="http://www.w3.org/2000/svg"; version="1.0">

	<g id="box1">
		<rect x="100" y="100" width="100" height="100" />
	</g>
	<g id="box2" display="none" onclick="alert('Gotcha')">
		<a xlink:href="http://www.example.com/"; xlink:actuate="onRequest">
			<rect x="200" y="200" width="10" height="10" />
		</a>
	</g>
	
	<script type="text/ecmascript">
		<![CDATA[
			document.getElementById("box1").addEventListener("click", function (e) {
				if (e.button == 2) {
					var elem = document.getElementById("box2");
					elem.setAttribute("display", "inline");
					e.stopPropagation();
				}
			}, false);
			document.addEventListener("click", function () {
				var elem = document.getElementById("box2");
				elem.setAttribute("display", "none");
			}, true);
		]]>
	</script>
	
</svg>


Attachment: TestEvents.java
Description: Binary data

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

Reply via email to