mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1072477 - [e10s] Make EventTarget shim work when removeEventListener called from listener (r=mconley)
This commit is contained in:
parent
39c4b562c9
commit
51c7dd31c8
@ -464,17 +464,24 @@ let EventTargetParent = {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let forType = setDefault(listeners, type, []);
|
let forType = setDefault(listeners, type, []);
|
||||||
|
|
||||||
|
// Make a copy in case they call removeEventListener in the listener.
|
||||||
|
let handlers = [];
|
||||||
for (let {listener, wantsUntrusted, useCapture} of forType) {
|
for (let {listener, wantsUntrusted, useCapture} of forType) {
|
||||||
if ((wantsUntrusted || isTrusted) && useCapture == capturing) {
|
if ((wantsUntrusted || isTrusted) && useCapture == capturing) {
|
||||||
try {
|
handlers.push(listener);
|
||||||
if ("handleEvent" in listener) {
|
}
|
||||||
listener.handleEvent(event);
|
}
|
||||||
} else {
|
|
||||||
listener.call(event.target, event);
|
for (let handler of handlers) {
|
||||||
}
|
try {
|
||||||
} catch (e) {
|
if ("handleEvent" in handler) {
|
||||||
Cu.reportError(e);
|
handler.handleEvent(event);
|
||||||
|
} else {
|
||||||
|
handler.call(event.target, event);
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
Cu.reportError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user