Opened 14 years ago

Closed 2 years ago

#808 closed defect (inactive)

Fix usage of addEventlistener

Reported by: guest Owned by: mokhet
Priority: lowest Milestone: 2.0
Component: Xinha Core Version: trunk
Severity: major Keywords:


The DOM 2 Events Specification clearly states that capturing event listeners aren't fired on the target. Unfortunatly a bug in Gecko, existent since ever, makes capturing event listeners fire on the target. Currenlty Safari has fixed this behaviour, and Opera always had it well.
A event listener is set as capturing passing true as the third parameter to addEventlistener. See this
So all calls to addEventlistener need to have false as third parameter instead.

Attachments (1)

htmlarea.patch (523 bytes) - added by guest 14 years ago.
patch containing the fix

Download all attachments as: .zip

Change History (6)

Changed 14 years ago by guest

patch containing the fix

comment:1 Changed 14 years ago by mokhet

I did not noticed we were using capturing phase. Sounds weird to use bubble for IE and capture for others since we can not use capture with IE. Anyway, in the branch i'm working on :, the bubble phase is used. Can you (guest) please have a review over this branch and make any comment about it in ticket #658 since your patch is kinda related to the actual work. Thanks.

comment:2 Changed 13 years ago by gogo

  • Owner changed from gogo to mokhet

mokhet: how far did you get with this?

In theory the change should be as simple as changing a handful of "true" to "false" (1 in XinhaCore?, several in some plugins, mainly ExtendedFileManager? and ImageManager?), but I'm worried that this is going to mess other stuff up if the listeners suddenly start hearing about bubbling events.

So perhaps in _addEvent (for gecko) we should wrap the listener in something to stop the bubbling by default?

comment:3 Changed 13 years ago by gogo

  • Milestone set to 2.0

comment:4 Changed 13 years ago by mokhet

  • Priority changed from high to lowest

How far ? Quite ok for me, i'm using my own version from this branch (with the events bubbling and not capturing) and i have not noticed any issue so far. It's 1+ year old now and i didnt take the time to merge my branch with the huge modification Ray has done to the structure. I promiss, i will commit my last version to the branch as soon i have enough time to do it correctly.

However, i'm not using any "heavy" plugins like ImageManager? and i agree with you, it can potentially break a lot of plugins.

I agree with your suggestion of waiting for a stable 1.0 before thinking about the event refactor :D

comment:5 Changed 2 years ago by gogo

  • Resolution set to inactive
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.