Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js

Issue 1845493004: Modify devtools to show passive event listeners. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor change Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..bba2c6e5f6d1dfe3da730ee0fc25a806ba2bb48f 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,27 @@ 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
+ // 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 if (useCapture)
+ return {"capture": useCapture};
+ else
+ return {};
+ }
+ this.removeEventListener(type, handler, eventListenerOptions());
if (this["on" + type])
this["on" + type] = null;
}
@@ -619,6 +635,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),

Powered by Google App Engine
This is Rietveld 408576698