Bug 1264383 - makeFilteringListener breaks eventremoval with shims. r=mconley a=ritu

MozReview-Commit-ID: BaxTDqXmjfG
This commit is contained in:
Gabor Krizsanits 2016-04-18 10:40:26 +02:00
parent e69e2357aa
commit eb34b49322

View File

@ -582,10 +582,6 @@ EventTargetParent.init();
var filteringListeners = new WeakMap();
function makeFilteringListener(eventType, listener)
{
if (filteringListeners.has(listener)) {
return filteringListeners.get(listener);
}
// Some events are actually targeted at the <browser> element
// itself, so we only handle the ones where know that won't happen.
let eventTypes = ["mousedown", "mouseup", "click"];
@ -593,6 +589,10 @@ function makeFilteringListener(eventType, listener)
return listener;
}
if (filteringListeners.has(listener)) {
return filteringListeners.get(listener);
}
function filter(event) {
let target = event.originalTarget;
if (target instanceof Ci.nsIDOMXULElement &&