Closed Bug 66320 Opened 25 years ago Closed 25 years ago

Listeners registered for the same IID twice doesn't release correctly

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

defect
Not set
major

Tracking

()

RESOLVED INVALID

People

(Reporter: mikepinkerton, Assigned: joki)

Details

If you register a listener twice for the same IID (say your object has code for tooltips and/or context menus, both need to listen for mouse events, either or both could be installed), the first time you unregister the listener for that IID, the ELM releases the object. This could be bad ;)
suggesting for moz0.8, but not holding my breath.
Keywords: mozilla0.8
Reassigning QA Contact for all open and unverified bugs previously under Lorca's care to Gerardo as per phone conversation this morning.
QA Contact: lorca → gerardok
Well I'm willing to listen to arguments about changing our internal registration methods but they work as they do now so as to be in accordance with the external public registration methods, written to spec, which says: "If multiple identical EventListeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener method." I would suggest writing the code to work with the spec as written. Given that I'm going to start with closing this invalid. Reopen if necessary if you can give me a good argument for why we should write around this on the ELM side as opposed to the registration side.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → INVALID
ugh, well then that's just broken. since there is now no way to tell if it's already registered, how do i know to take any precautions? say I register mouseListener once for tooltips and again for context menus. then tooltips get turned off dynamically, so I unregister the mouseListener. Now it's unregistered for both!? That's just plain wrong. I guess i have to make separate objects, and that just sucks sucks sucks.
Keywords: mozilla0.8
QA contact updated
QA Contact: gerardok → madhur
QA Contact: madhur → rakeshmishra
QA Contact: rakeshmishra → trix
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.