xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: <a xlink:href .../> not working properly
Date Sun, 22 Jan 2006 15:28:23 GMT
Hi Birch,

J B <moatas@gmail.com> wrote on 01/20/2006 01:22:59 PM:

> 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. 

   Actually the problem is the toggling of 'display' on the 'a' element.

> 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. 

   So I have a fix for this part of this, however it 'breaks' your 
example.
Because you 'undisplay' the 'a' element in the 'capture' phase before the
click get's to the 'a' element.  The fix unregisters the click listener 
when
the element becomes undisplayed.  I may look at other ways to manage this 
in
the future as this 'feels' a little odd, but I doubt there is anything to 
say
that this is truly wrong - doing things during capture is likely to lead 
to
'strangeness'.

   There are two main work around for this:
        1) move your undisplay code to the 'bubble' phase.
        2) switch to toggling visibility rather than display.

> Am I doing something stupid?
> 
> Thanks!
> 
> Birch

> On 1/20/06, thomas.deweese@kodak.com < thomas.deweese@kodak.com> wrote:
> Hi Birch, 
> 
>         Can you provide a small reproducible test case?
> 
> J B <moatas@gmail.com> 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 < erkyrath@eblong.com> 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: 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

> [attachment "eventTest.xml" deleted by Thomas E. DeWeese/449433/EKC] 
> [attachment "TestEvents.java" deleted by Thomas E. DeWeese/449433/EKC] 
> ---------------------------------------------------------------------
> 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


Mime
View raw message