Opened 11 years ago

Last modified 10 years ago

#808 new defect

Fix usage of addEventlistener

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

Description

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
https://bugzilla.mozilla.org/show_bug.cgi?id=235441
So all calls to addEventlistener need to have false as third parameter instead.

Attachments (1)

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

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by guest

patch containing the fix

comment:1 Changed 11 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 : http://svn.xinha.python-hosting.com/branches/mokhet, 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 10 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 10 years ago by gogo

  • Milestone set to 2.0

comment:4 Changed 10 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

Note: See TracTickets for help on using tickets.