Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js b/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js |
| index ee63ffe5098f3d38bc11c4c324cce5675df8611c..0521196c34ff55cb24fefdca49fd6c6d25fc53e7 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js |
| @@ -591,7 +591,7 @@ WebInspector.RemoteObjectImpl.prototype = { |
| /** |
| * @suppressReceiverCheck |
| * @this {Node} |
| - * @return {function(this:Node, string, function(), boolean=): undefined} |
| + * @return {function(this:Node, string, function(), boolean=, boolean=): undefined} |
| */ |
| function nodeRemoveEventListener() |
| { |
| @@ -600,11 +600,25 @@ WebInspector.RemoteObjectImpl.prototype = { |
| * @param {string} type |
| * @param {function()} handler |
| * @param {boolean=} useCapture |
| + * @param {boolean=} passive |
| * @this {Node} |
| */ |
| - function removeEventListenerWrapper(type, handler, useCapture) |
| + function removeEventListenerWrapper(type, handler, useCapture, passive) |
| { |
| - this.removeEventListener(type, handler, useCapture); |
| + // TODO(dtapuska): Remove this one closure compiler is updated |
|
pfeldman
2016/03/30 21:20:06
We'd have to patch the externs once the spec final
dtapuska
2016/04/08 13:42:37
The spec is finalized; we are shipping in 51.
I'm
|
| + // to handle EventListenerOptions and passive event listeners |
| + // has shipped. Don't JSDoc these otherwise it will fail. |
| + // @return {boolean|undefined|{capture: (boolean|undefined), passive: boolean}} |
| + function eventListenerOptions() |
| + { |
| + if (passive && useCapture) |
| + return {"capture": useCapture, "passive": passive}; |
| + else if (passive) |
| + return {"passive": passive}; |
| + else |
| + return useCapture; |
| + } |
| + this.removeEventListener(type, handler, eventListenerOptions()); |
| if (this["on" + type]) |
| this["on" + type] = null; |
| } |
| @@ -619,6 +633,7 @@ WebInspector.RemoteObjectImpl.prototype = { |
| return new WebInspector.EventListener(this._target, |
| payload.type, |
| payload.useCapture, |
| + payload.passive, |
| payload.handler ? this.target().runtimeModel.createRemoteObject(payload.handler) : null, |
| payload.originalHandler ? this.target().runtimeModel.createRemoteObject(payload.originalHandler) : null, |
| WebInspector.DebuggerModel.Location.fromPayload(this._debuggerModel, payload.location), |