Bug 1072607 - [e10s] Handle removeEventListener correctly in EventTarget shim (r=mconley)

This commit is contained in:
Bill McCloskey 2014-09-29 13:05:23 -07:00
parent 995a3add7e
commit e127657aa3

View File

@ -361,6 +361,8 @@ let ObserverChild = {
function EventTargetChild(childGlobal)
{
this._childGlobal = childGlobal;
this.capturingHandler = (event) => this.handleEvent(true, event);
this.nonCapturingHandler = (event) => this.handleEvent(false, event);
NotificationTracker.watch("event", this);
}
@ -372,7 +374,7 @@ EventTargetChild.prototype = {
track: function(path, register) {
let eventType = path[1];
let useCapture = path[2];
let listener = (event) => this.handleEvent(useCapture, event);
let listener = useCapture ? this.capturingHandler : this.nonCapturingHandler;
if (register) {
this._childGlobal.addEventListener(eventType, listener, useCapture, true);
} else {