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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js

Issue 1845493004: Modify devtools to show passive event listeners. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix remove 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 1386
1387 /** 1387 /**
1388 * @param {!Node} node 1388 * @param {!Node} node
1389 * @return {!Object|undefined} 1389 * @return {!Object|undefined}
1390 */ 1390 */
1391 getEventListeners: function(node) 1391 getEventListeners: function(node)
1392 { 1392 {
1393 var result = nullifyObjectProto(InjectedScriptHost.getEventListeners(nod e)); 1393 var result = nullifyObjectProto(InjectedScriptHost.getEventListeners(nod e));
1394 if (!result) 1394 if (!result)
1395 return; 1395 return;
1396 /** @this {{type: string, listener: function(), useCapture: boolean}} */ 1396 /** @this {{type: string, listener: function(), useCapture: boolean, pas sive: boolean}} */
1397 var removeFunc = function() 1397 var removeFunc = function()
1398 { 1398 {
1399 node.removeEventListener(this.type, this.listener, this.useCapture); 1399 function eventListenerOptions(capture, passive) {
pfeldman 2016/03/30 17:43:05 ditto
dtapuska 2016/03/30 20:59:48 Likewise; if I JSDoc this it will fail.
1400 if (passive) {
1401 return {"capture": capture, "passive": passive};
1402 } else {
1403 return capture;
1404 }
1405 }
1406 node.removeEventListener(this.type, this.listener, eventListenerOpti ons(this.useCapture, this.passive));
1400 } 1407 }
1401 for (var type in result) { 1408 for (var type in result) {
1402 var listeners = result[type]; 1409 var listeners = result[type];
1403 for (var i = 0, listener; listener = listeners[i]; ++i) { 1410 for (var i = 0, listener; listener = listeners[i]; ++i) {
1404 listener["type"] = type; 1411 listener["type"] = type;
1405 listener["remove"] = removeFunc; 1412 listener["remove"] = removeFunc;
1406 } 1413 }
1407 } 1414 }
1408 return result; 1415 return result;
1409 }, 1416 },
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1475 */ 1482 */
1476 _logEvent: function(event) 1483 _logEvent: function(event)
1477 { 1484 {
1478 inspectedGlobalObject.console.log(event.type, event); 1485 inspectedGlobalObject.console.log(event.type, event);
1479 } 1486 }
1480 } 1487 }
1481 1488
1482 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); 1489 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl();
1483 return injectedScript; 1490 return injectedScript;
1484 }) 1491 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698