Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1245 { | 1245 { |
| 1246 if (!object || !object.addEventListener || !object.removeEventListener) | 1246 if (!object || !object.addEventListener || !object.removeEventListener) |
| 1247 return; | 1247 return; |
| 1248 var types = CommandLineAPIImpl._normalizeEventTypes(opt_types); | 1248 var types = CommandLineAPIImpl._normalizeEventTypes(opt_types); |
| 1249 for (var i = 0; i < types.length; ++i) | 1249 for (var i = 0; i < types.length; ++i) |
| 1250 object.removeEventListener(types[i], CommandLineAPIImpl._logEvent, false ); | 1250 object.removeEventListener(types[i], CommandLineAPIImpl._logEvent, false ); |
| 1251 } | 1251 } |
| 1252 | 1252 |
| 1253 /** | 1253 /** |
| 1254 * @param {!Node} node | 1254 * @param {!Node} node |
| 1255 * @param {?Object} options | |
| 1255 * @return {!Object|undefined} | 1256 * @return {!Object|undefined} |
| 1256 */ | 1257 */ |
| 1257 CommandLineAPIImpl.getEventListeners = function(node) | 1258 CommandLineAPIImpl.getEventListeners = function(node, options) |
| 1258 { | 1259 { |
| 1259 var result = nullifyObjectProto(InjectedScriptHost.getEventListeners(node)); | 1260 options = options || {}; |
| 1261 var showPassive = true; | |
| 1262 var showBlocking = true; | |
| 1263 if (typeof options['passive'] != "undefined") { | |
|
caseq
2016/05/20 00:47:24
here and below, double quotes please!
Also, use !=
dtapuska
2016/05/26 20:37:44
removed after rebase
| |
| 1264 showPassive = options['passive']; | |
| 1265 showBlocking = !showPassive; | |
| 1266 } | |
| 1267 | |
| 1268 var result = nullifyObjectProto(InjectedScriptHost.getEventListeners(node, | |
| 1269 options ['descendants'], | |
|
caseq
2016/05/20 00:47:24
Put all params on either one or two lines, or use
dtapuska
2016/05/26 20:37:44
removed after rebase
| |
| 1270 showPas sive, | |
| 1271 showBlo cking)); | |
| 1260 if (!result) | 1272 if (!result) |
| 1261 return; | 1273 return; |
| 1262 | 1274 |
| 1263 // TODO(dtapuska): Remove this one closure compiler is updated | 1275 // TODO(dtapuska): Remove this one closure compiler is updated |
| 1264 // to handle EventListenerOptions and passive event listeners | 1276 // to handle EventListenerOptions and passive event listeners |
| 1265 // has shipped. Don't JSDoc these otherwise it will fail. | 1277 // has shipped. Don't JSDoc these otherwise it will fail. |
| 1266 // @param {boolean} capture | 1278 // @param {boolean} capture |
| 1267 // @param {boolean} passive | 1279 // @param {boolean} passive |
| 1268 // @return {boolean|undefined|{capture: (boolean|undefined), passive: boolea n}} | 1280 // @return {boolean|undefined|{capture: (boolean|undefined), passive: boolea n}} |
| 1269 function eventListenerOptions(capture, passive) | 1281 function eventListenerOptions(capture, passive) |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1330 /** | 1342 /** |
| 1331 * @param {!Event} event | 1343 * @param {!Event} event |
| 1332 */ | 1344 */ |
| 1333 CommandLineAPIImpl._logEvent = function(event) | 1345 CommandLineAPIImpl._logEvent = function(event) |
| 1334 { | 1346 { |
| 1335 inspectedGlobalObject.console.log(event.type, event); | 1347 inspectedGlobalObject.console.log(event.type, event); |
| 1336 } | 1348 } |
| 1337 | 1349 |
| 1338 return injectedScript; | 1350 return injectedScript; |
| 1339 }) | 1351 }) |
| OLD | NEW |