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) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 } | 184 } |
185 | 185 |
186 WebInspector.EventListenerBar.prototype = { | 186 WebInspector.EventListenerBar.prototype = { |
187 update: function() | 187 update: function() |
188 { | 188 { |
189 var properties = []; | 189 var properties = []; |
190 for (var propertyName in this.eventListener) { | 190 for (var propertyName in this.eventListener) { |
191 // Just build properties in place - no need to reach out for injecte
d script. | 191 // Just build properties in place - no need to reach out for injecte
d script. |
192 var value = this.eventListener[propertyName]; | 192 var value = this.eventListener[propertyName]; |
193 if (value instanceof WebInspector.DOMNode) | 193 if (value instanceof WebInspector.DOMNode) |
194 value = new WebInspector.ObjectProxy(value.id, [], 0, appropriat
eSelectorForNode(value), true); | 194 value = new WebInspector.ObjectProxy(value.injectedScriptId, val
ue.id, [], 0, appropriateSelectorForNode(value), true); |
195 else | 195 else |
196 value = WebInspector.ObjectProxy.wrapPrimitiveValue(value); | 196 value = WebInspector.ObjectProxy.wrapPrimitiveValue(value); |
197 properties.push(new WebInspector.ObjectPropertyProxy(propertyName, v
alue)); | 197 properties.push(new WebInspector.ObjectPropertyProxy(propertyName, v
alue)); |
198 } | 198 } |
199 this.updateProperties(properties); | 199 this.updateProperties(properties); |
200 }, | 200 }, |
201 | 201 |
202 _getNodeDisplayName: function() | 202 _getNodeDisplayName: function() |
203 { | 203 { |
204 var node = this.eventListener.node; | 204 var node = this.eventListener.node; |
205 if (!node) | 205 if (!node) |
206 return ""; | 206 return ""; |
207 | 207 |
208 if (node.nodeType === Node.DOCUMENT_NODE) | 208 if (node.nodeType === Node.DOCUMENT_NODE) |
209 return "document"; | 209 return "document"; |
210 | 210 |
211 return appropriateSelectorForNode(node); | 211 return appropriateSelectorForNode(node); |
212 }, | 212 }, |
213 | 213 |
214 _getFunctionDisplayName: function() | 214 _getFunctionDisplayName: function() |
215 { | 215 { |
216 // Requires that Function.toString() return at least the function's sign
ature. | 216 // Requires that Function.toString() return at least the function's sign
ature. |
217 var match = this.eventListener.listener.toString().match(/function ([^\(
]+?)\(/); | 217 var match = this.eventListener.listener.toString().match(/function ([^\(
]+?)\(/); |
218 return (match ? match[1] : WebInspector.UIString("(anonymous function)")
); | 218 return (match ? match[1] : WebInspector.UIString("(anonymous function)")
); |
219 } | 219 } |
220 } | 220 } |
221 | 221 |
222 WebInspector.EventListenerBar.prototype.__proto__ = WebInspector.ObjectPropertie
sSection.prototype; | 222 WebInspector.EventListenerBar.prototype.__proto__ = WebInspector.ObjectPropertie
sSection.prototype; |
OLD | NEW |