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

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: Fix Layout Tests Created 4 years, 9 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..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),

Powered by Google App Engine
This is Rietveld 408576698