Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 /** | 27 /** |
| 28 * @constructor | 28 * @constructor |
| 29 * @extends {TreeOutlineInShadow} | 29 * @extends {TreeOutlineInShadow} |
| 30 * @param {!WebInspector.RemoteObject} object | 30 * @param {!WebInspector.RemoteObject} object |
| 31 * @param {?string|!Element=} title | 31 * @param {?string|!Element=} title |
| 32 * @param {?WebInspector.Linkifier=} linkifier | |
|
dgozman
2016/07/07 19:34:25
Let's make it !WebInspector.Linkifier= and pass un
kozy
2016/07/07 21:33:28
Done.
| |
| 32 * @param {?string=} emptyPlaceholder | 33 * @param {?string=} emptyPlaceholder |
| 33 * @param {boolean=} ignoreHasOwnProperty | 34 * @param {boolean=} ignoreHasOwnProperty |
| 34 * @param {!Array.<!WebInspector.RemoteObjectProperty>=} extraProperties | 35 * @param {!Array.<!WebInspector.RemoteObjectProperty>=} extraProperties |
| 35 */ | 36 */ |
| 36 WebInspector.ObjectPropertiesSection = function(object, title, emptyPlaceholder, ignoreHasOwnProperty, extraProperties) | 37 WebInspector.ObjectPropertiesSection = function(object, title, linkifier, emptyP laceholder, ignoreHasOwnProperty, extraProperties) |
|
dgozman
2016/07/07 19:34:25
Unfortunately I cannot check that you updated all
kozy
2016/07/07 21:33:28
I checked it with search over code base while addi
| |
| 37 { | 38 { |
| 38 this._object = object; | 39 this._object = object; |
| 39 this._editable = true; | 40 this._editable = true; |
| 40 TreeOutlineInShadow.call(this); | 41 TreeOutlineInShadow.call(this); |
| 41 this.hideOverflow(); | 42 this.hideOverflow(); |
| 42 this.setFocusable(false); | 43 this.setFocusable(false); |
| 43 this._objectTreeElement = new WebInspector.ObjectPropertiesSection.RootEleme nt(object, emptyPlaceholder, ignoreHasOwnProperty, extraProperties); | 44 this._objectTreeElement = new WebInspector.ObjectPropertiesSection.RootEleme nt(object, linkifier, emptyPlaceholder, ignoreHasOwnProperty, extraProperties); |
| 44 this.appendChild(this._objectTreeElement); | 45 this.appendChild(this._objectTreeElement); |
| 45 if (typeof title === "string" || !title) | 46 if (typeof title === "string" || !title) |
| 46 this.element.createChild("span").textContent = title || ""; | 47 this.element.createChild("span").textContent = title || ""; |
| 47 else | 48 else |
| 48 this.element.appendChild(title); | 49 this.element.appendChild(title); |
| 49 | 50 |
| 50 this.element._section = this; | 51 this.element._section = this; |
| 51 this.registerRequiredCSS("components/objectValue.css"); | 52 this.registerRequiredCSS("components/objectValue.css"); |
| 52 this.registerRequiredCSS("components/objectPropertiesSection.css"); | 53 this.registerRequiredCSS("components/objectPropertiesSection.css"); |
| 53 this.rootElement().childrenListElement.classList.add("source-code", "object- properties-section"); | 54 this.rootElement().childrenListElement.classList.add("source-code", "object- properties-section"); |
| 54 } | 55 } |
| 55 | 56 |
| 56 /** @const */ | 57 /** @const */ |
| 57 WebInspector.ObjectPropertiesSection._arrayLoadThreshold = 100; | 58 WebInspector.ObjectPropertiesSection._arrayLoadThreshold = 100; |
| 58 | 59 |
| 59 /** | 60 /** |
| 60 * @param {!WebInspector.RemoteObject} object | 61 * @param {!WebInspector.RemoteObject} object |
| 62 * @param {?WebInspector.Linkifier=} linkifier | |
| 61 * @param {boolean=} skipProto | 63 * @param {boolean=} skipProto |
| 62 * @return {!Element} | 64 * @return {!Element} |
| 63 */ | 65 */ |
| 64 WebInspector.ObjectPropertiesSection.defaultObjectPresentation = function(object , skipProto) | 66 WebInspector.ObjectPropertiesSection.defaultObjectPresentation = function(object , linkifier, skipProto) |
| 65 { | 67 { |
| 66 var componentRoot = createElementWithClass("span", "source-code"); | 68 var componentRoot = createElementWithClass("span", "source-code"); |
| 67 var shadowRoot = WebInspector.createShadowRootWithCoreStyles(componentRoot, "components/objectValue.css"); | 69 var shadowRoot = WebInspector.createShadowRootWithCoreStyles(componentRoot, "components/objectValue.css"); |
| 68 shadowRoot.appendChild(WebInspector.ObjectPropertiesSection.createValueEleme nt(object, false)); | 70 shadowRoot.appendChild(WebInspector.ObjectPropertiesSection.createValueEleme nt(object, false)); |
| 69 if (!object.hasChildren) | 71 if (!object.hasChildren) |
| 70 return componentRoot; | 72 return componentRoot; |
| 71 | 73 |
| 72 var objectPropertiesSection = new WebInspector.ObjectPropertiesSection(objec t, componentRoot); | 74 var objectPropertiesSection = new WebInspector.ObjectPropertiesSection(objec t, componentRoot, linkifier); |
| 73 objectPropertiesSection.editable = false; | 75 objectPropertiesSection.editable = false; |
| 74 if (skipProto) | 76 if (skipProto) |
| 75 objectPropertiesSection.skipProto(); | 77 objectPropertiesSection.skipProto(); |
| 76 | 78 |
| 77 return objectPropertiesSection.element; | 79 return objectPropertiesSection.element; |
| 78 } | 80 } |
| 79 | 81 |
| 80 WebInspector.ObjectPropertiesSection.prototype = { | 82 WebInspector.ObjectPropertiesSection.prototype = { |
| 81 skipProto: function() | 83 skipProto: function() |
| 82 { | 84 { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 return 1; | 145 return 1; |
| 144 if (propertyB.symbol && !propertyA.symbol) | 146 if (propertyB.symbol && !propertyA.symbol) |
| 145 return -1; | 147 return -1; |
| 146 return String.naturalOrderComparator(a, b); | 148 return String.naturalOrderComparator(a, b); |
| 147 } | 149 } |
| 148 | 150 |
| 149 /** | 151 /** |
| 150 * @constructor | 152 * @constructor |
| 151 * @extends {TreeElement} | 153 * @extends {TreeElement} |
| 152 * @param {!WebInspector.RemoteObject} object | 154 * @param {!WebInspector.RemoteObject} object |
| 155 * @param {?WebInspector.Linkifier=} linkifier | |
| 153 * @param {?string=} emptyPlaceholder | 156 * @param {?string=} emptyPlaceholder |
| 154 * @param {boolean=} ignoreHasOwnProperty | 157 * @param {boolean=} ignoreHasOwnProperty |
| 155 * @param {!Array.<!WebInspector.RemoteObjectProperty>=} extraProperties | 158 * @param {!Array.<!WebInspector.RemoteObjectProperty>=} extraProperties |
| 156 */ | 159 */ |
| 157 WebInspector.ObjectPropertiesSection.RootElement = function(object, emptyPlaceho lder, ignoreHasOwnProperty, extraProperties) | 160 WebInspector.ObjectPropertiesSection.RootElement = function(object, linkifier, e mptyPlaceholder, ignoreHasOwnProperty, extraProperties) |
| 158 { | 161 { |
| 159 this._object = object; | 162 this._object = object; |
| 160 this._extraProperties = extraProperties || []; | 163 this._extraProperties = extraProperties || []; |
| 161 this._ignoreHasOwnProperty = !!ignoreHasOwnProperty; | 164 this._ignoreHasOwnProperty = !!ignoreHasOwnProperty; |
| 162 this._emptyPlaceholder = emptyPlaceholder; | 165 this._emptyPlaceholder = emptyPlaceholder; |
| 163 var contentElement = createElement("content"); | 166 var contentElement = createElement("content"); |
| 164 TreeElement.call(this, contentElement); | 167 TreeElement.call(this, contentElement); |
| 165 this.setExpandable(true); | 168 this.setExpandable(true); |
| 166 this.selectable = false; | 169 this.selectable = false; |
| 167 this.toggleOnClick = true; | 170 this.toggleOnClick = true; |
| 168 this.listItemElement.classList.add("object-properties-section-root-element") ; | 171 this.listItemElement.classList.add("object-properties-section-root-element") ; |
| 172 this._linkifier = linkifier; | |
| 169 } | 173 } |
| 170 | 174 |
| 171 WebInspector.ObjectPropertiesSection.RootElement.prototype = { | 175 WebInspector.ObjectPropertiesSection.RootElement.prototype = { |
| 172 | 176 |
| 173 onexpand: function() | 177 onexpand: function() |
| 174 { | 178 { |
| 175 if (this.treeOutline) | 179 if (this.treeOutline) |
| 176 this.treeOutline.element.classList.add("expanded"); | 180 this.treeOutline.element.classList.add("expanded"); |
| 177 }, | 181 }, |
| 178 | 182 |
| 179 oncollapse: function() | 183 oncollapse: function() |
| 180 { | 184 { |
| 181 if (this.treeOutline) | 185 if (this.treeOutline) |
| 182 this.treeOutline.element.classList.remove("expanded"); | 186 this.treeOutline.element.classList.remove("expanded"); |
| 183 }, | 187 }, |
| 184 | 188 |
| 185 /** | 189 /** |
| 186 * @override | 190 * @override |
| 187 * @param {!Event} e | 191 * @param {!Event} e |
| 188 * @return {boolean} | 192 * @return {boolean} |
| 189 */ | 193 */ |
| 190 ondblclick: function(e) | 194 ondblclick: function(e) |
| 191 { | 195 { |
| 192 return true; | 196 return true; |
| 193 }, | 197 }, |
| 194 | 198 |
| 195 onpopulate: function() | 199 onpopulate: function() |
| 196 { | 200 { |
| 197 WebInspector.ObjectPropertyTreeElement._populate(this, this._object, !!t his.treeOutline._skipProto, this._emptyPlaceholder, this._ignoreHasOwnProperty, this._extraProperties); | 201 WebInspector.ObjectPropertyTreeElement._populate(this, this._object, !!t his.treeOutline._skipProto, this._linkifier, this._emptyPlaceholder, this._ignor eHasOwnProperty, this._extraProperties); |
| 198 }, | 202 }, |
| 199 | 203 |
| 200 __proto__: TreeElement.prototype | 204 __proto__: TreeElement.prototype |
| 201 } | 205 } |
| 202 | 206 |
| 203 /** | 207 /** |
| 204 * @constructor | 208 * @constructor |
| 205 * @extends {TreeElement} | 209 * @extends {TreeElement} |
| 206 * @param {!WebInspector.RemoteObjectProperty} property | 210 * @param {!WebInspector.RemoteObjectProperty} property |
| 211 * @param {?WebInspector.Linkifier=} linkifier | |
| 207 */ | 212 */ |
| 208 WebInspector.ObjectPropertyTreeElement = function(property) | 213 WebInspector.ObjectPropertyTreeElement = function(property, linkifier) |
| 209 { | 214 { |
| 210 this.property = property; | 215 this.property = property; |
| 211 | 216 |
| 212 // Pass an empty title, the title gets made later in onattach. | 217 // Pass an empty title, the title gets made later in onattach. |
| 213 TreeElement.call(this); | 218 TreeElement.call(this); |
| 214 this.toggleOnClick = true; | 219 this.toggleOnClick = true; |
| 215 this.selectable = false; | 220 this.selectable = false; |
| 216 /** @type {!Array.<!Object>} */ | 221 /** @type {!Array.<!Object>} */ |
| 217 this._highlightChanges = []; | 222 this._highlightChanges = []; |
| 223 this._linkifier = linkifier; | |
| 218 } | 224 } |
| 219 | 225 |
| 220 WebInspector.ObjectPropertyTreeElement.prototype = { | 226 WebInspector.ObjectPropertyTreeElement.prototype = { |
| 221 /** | 227 /** |
| 222 * @param {!RegExp} regex | 228 * @param {!RegExp} regex |
| 223 * @param {string=} additionalCssClassName | 229 * @param {string=} additionalCssClassName |
| 224 * @return {boolean} | 230 * @return {boolean} |
| 225 */ | 231 */ |
| 226 setSearchRegex: function(regex, additionalCssClassName) { | 232 setSearchRegex: function(regex, additionalCssClassName) { |
| 227 var cssClasses = WebInspector.highlightedSearchResultClassName; | 233 var cssClasses = WebInspector.highlightedSearchResultClassName; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 261 WebInspector.revertDomChanges(this._highlightChanges); | 267 WebInspector.revertDomChanges(this._highlightChanges); |
| 262 this._highlightChanges = []; | 268 this._highlightChanges = []; |
| 263 }, | 269 }, |
| 264 | 270 |
| 265 onpopulate: function() | 271 onpopulate: function() |
| 266 { | 272 { |
| 267 var propertyValue = /** @type {!WebInspector.RemoteObject} */ (this.prop erty.value); | 273 var propertyValue = /** @type {!WebInspector.RemoteObject} */ (this.prop erty.value); |
| 268 console.assert(propertyValue); | 274 console.assert(propertyValue); |
| 269 var skipProto = this.treeOutline ? this.treeOutline._skipProto : true; | 275 var skipProto = this.treeOutline ? this.treeOutline._skipProto : true; |
| 270 var targetValue = this.property.name !== "__proto__" ? propertyValue : t his.property.parentObject; | 276 var targetValue = this.property.name !== "__proto__" ? propertyValue : t his.property.parentObject; |
| 271 WebInspector.ObjectPropertyTreeElement._populate(this, propertyValue, sk ipProto, undefined, undefined, undefined, targetValue); | 277 WebInspector.ObjectPropertyTreeElement._populate(this, propertyValue, sk ipProto, this._linkifier, undefined, undefined, undefined, targetValue); |
| 272 }, | 278 }, |
| 273 | 279 |
| 274 /** | 280 /** |
| 275 * @override | 281 * @override |
| 276 * @return {boolean} | 282 * @return {boolean} |
| 277 */ | 283 */ |
| 278 ondblclick: function(event) | 284 ondblclick: function(event) |
| 279 { | 285 { |
| 280 var editableElement = this.valueElement; | 286 var editableElement = this.valueElement; |
| 281 if (!this.property.value.customPreview() && (this.property.writable || t his.property.setter) && event.target.isSelfOrDescendant(editableElement)) | 287 if (!this.property.value.customPreview() && (this.property.writable || t his.property.setter) && event.target.isSelfOrDescendant(editableElement)) |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 302 if (this.property.synthetic) | 308 if (this.property.synthetic) |
| 303 this.nameElement.classList.add("synthetic-property"); | 309 this.nameElement.classList.add("synthetic-property"); |
| 304 | 310 |
| 305 this._updatePropertyPath(); | 311 this._updatePropertyPath(); |
| 306 this.nameElement.addEventListener("contextmenu", this._contextMenuFired. bind(this, this.property), false); | 312 this.nameElement.addEventListener("contextmenu", this._contextMenuFired. bind(this, this.property), false); |
| 307 | 313 |
| 308 var separatorElement = createElementWithClass("span", "object-properties -section-separator"); | 314 var separatorElement = createElementWithClass("span", "object-properties -section-separator"); |
| 309 separatorElement.textContent = ": "; | 315 separatorElement.textContent = ": "; |
| 310 | 316 |
| 311 if (this.property.value) { | 317 if (this.property.value) { |
| 312 this.valueElement = WebInspector.ObjectPropertiesSection.createValue ElementWithCustomSupport(this.property.value, this.property.wasThrown, this.list ItemElement); | 318 this.valueElement = WebInspector.ObjectPropertiesSection.createValue ElementWithCustomSupport(this.property.value, this.property.wasThrown, this.list ItemElement, this._linkifier); |
| 313 this.valueElement.addEventListener("contextmenu", this._contextMenuF ired.bind(this, this.property), false); | 319 this.valueElement.addEventListener("contextmenu", this._contextMenuF ired.bind(this, this.property), false); |
| 314 } else if (this.property.getter) { | 320 } else if (this.property.getter) { |
| 315 this.valueElement = WebInspector.ObjectPropertyTreeElement.createRem oteObjectAccessorPropertySpan(this.property.parentObject, [this.property.name], this._onInvokeGetterClick.bind(this)); | 321 this.valueElement = WebInspector.ObjectPropertyTreeElement.createRem oteObjectAccessorPropertySpan(this.property.parentObject, [this.property.name], this._onInvokeGetterClick.bind(this)); |
| 316 } else { | 322 } else { |
| 317 this.valueElement = createElementWithClass("span", "object-value-und efined"); | 323 this.valueElement = createElementWithClass("span", "object-value-und efined"); |
| 318 this.valueElement.textContent = WebInspector.UIString("<unreadable>" ); | 324 this.valueElement.textContent = WebInspector.UIString("<unreadable>" ); |
| 319 this.valueElement.title = WebInspector.UIString("No property getter" ); | 325 this.valueElement.title = WebInspector.UIString("No property getter" ); |
| 320 } | 326 } |
| 321 | 327 |
| 322 this.listItemElement.removeChildren(); | 328 this.listItemElement.removeChildren(); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 491 this.setExpandable(false); | 497 this.setExpandable(false); |
| 492 }, | 498 }, |
| 493 | 499 |
| 494 __proto__: TreeElement.prototype | 500 __proto__: TreeElement.prototype |
| 495 } | 501 } |
| 496 | 502 |
| 497 /** | 503 /** |
| 498 * @param {!TreeElement} treeElement | 504 * @param {!TreeElement} treeElement |
| 499 * @param {!WebInspector.RemoteObject} value | 505 * @param {!WebInspector.RemoteObject} value |
| 500 * @param {boolean} skipProto | 506 * @param {boolean} skipProto |
| 507 * @param {?WebInspector.Linkifier=} linkifier | |
| 501 * @param {?string=} emptyPlaceholder | 508 * @param {?string=} emptyPlaceholder |
| 502 * @param {boolean=} flattenProtoChain | 509 * @param {boolean=} flattenProtoChain |
| 503 * @param {!Array.<!WebInspector.RemoteObjectProperty>=} extraProperties | 510 * @param {!Array.<!WebInspector.RemoteObjectProperty>=} extraProperties |
| 504 * @param {!WebInspector.RemoteObject=} targetValue | 511 * @param {!WebInspector.RemoteObject=} targetValue |
| 505 */ | 512 */ |
| 506 WebInspector.ObjectPropertyTreeElement._populate = function(treeElement, value, skipProto, emptyPlaceholder, flattenProtoChain, extraProperties, targetValue) | 513 WebInspector.ObjectPropertyTreeElement._populate = function(treeElement, value, skipProto, linkifier, emptyPlaceholder, flattenProtoChain, extraProperties, targ etValue) |
| 507 { | 514 { |
| 508 if (value.arrayLength() > WebInspector.ObjectPropertiesSection._arrayLoadThr eshold) { | 515 if (value.arrayLength() > WebInspector.ObjectPropertiesSection._arrayLoadThr eshold) { |
| 509 treeElement.removeChildren(); | 516 treeElement.removeChildren(); |
| 510 WebInspector.ArrayGroupingTreeElement._populateArray(treeElement, value, 0, value.arrayLength() - 1); | 517 WebInspector.ArrayGroupingTreeElement._populateArray(treeElement, value, 0, value.arrayLength() - 1, linkifier); |
| 511 return; | 518 return; |
| 512 } | 519 } |
| 513 | 520 |
| 514 /** | 521 /** |
| 515 * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties | 522 * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties |
| 516 * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties | 523 * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties |
| 517 */ | 524 */ |
| 518 function callback(properties, internalProperties) | 525 function callback(properties, internalProperties) |
| 519 { | 526 { |
| 520 treeElement.removeChildren(); | 527 treeElement.removeChildren(); |
| 521 if (!properties) | 528 if (!properties) |
| 522 return; | 529 return; |
| 523 | 530 |
| 524 extraProperties = extraProperties || []; | 531 extraProperties = extraProperties || []; |
| 525 for (var i = 0; i < extraProperties.length; ++i) | 532 for (var i = 0; i < extraProperties.length; ++i) |
| 526 properties.push(extraProperties[i]); | 533 properties.push(extraProperties[i]); |
| 527 | 534 |
| 528 WebInspector.ObjectPropertyTreeElement.populateWithProperties(treeElemen t, properties, internalProperties, | 535 WebInspector.ObjectPropertyTreeElement.populateWithProperties(treeElemen t, properties, internalProperties, |
| 529 skipProto, targetValue || value, emptyPlaceholder); | 536 skipProto, targetValue || value, linkifier, emptyPlaceholder); |
| 530 } | 537 } |
| 531 | 538 |
| 532 if (flattenProtoChain) | 539 if (flattenProtoChain) |
| 533 value.getAllProperties(false, callback); | 540 value.getAllProperties(false, callback); |
| 534 else | 541 else |
| 535 WebInspector.RemoteObject.loadFromObjectPerProto(value, callback); | 542 WebInspector.RemoteObject.loadFromObjectPerProto(value, callback); |
| 536 } | 543 } |
| 537 | 544 |
| 538 /** | 545 /** |
| 539 * @param {!TreeElement} treeNode | 546 * @param {!TreeElement} treeNode |
| 540 * @param {!Array.<!WebInspector.RemoteObjectProperty>} properties | 547 * @param {!Array.<!WebInspector.RemoteObjectProperty>} properties |
| 541 * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties | 548 * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties |
| 542 * @param {boolean} skipProto | 549 * @param {boolean} skipProto |
| 543 * @param {?WebInspector.RemoteObject} value | 550 * @param {?WebInspector.RemoteObject} value |
| 551 * @param {?WebInspector.Linkifier=} linkifier | |
| 544 * @param {?string=} emptyPlaceholder | 552 * @param {?string=} emptyPlaceholder |
| 545 */ | 553 */ |
| 546 WebInspector.ObjectPropertyTreeElement.populateWithProperties = function(treeNod e, properties, internalProperties, skipProto, value, emptyPlaceholder) { | 554 WebInspector.ObjectPropertyTreeElement.populateWithProperties = function(treeNod e, properties, internalProperties, skipProto, value, linkifier, emptyPlaceholder ) { |
| 547 properties.sort(WebInspector.ObjectPropertiesSection.CompareProperties); | 555 properties.sort(WebInspector.ObjectPropertiesSection.CompareProperties); |
| 548 | 556 |
| 549 for (var i = 0; i < properties.length; ++i) { | 557 for (var i = 0; i < properties.length; ++i) { |
| 550 var property = properties[i]; | 558 var property = properties[i]; |
| 551 if (skipProto && property.name === "__proto__") | 559 if (skipProto && property.name === "__proto__") |
| 552 continue; | 560 continue; |
| 553 if (property.isAccessorProperty()) { | 561 if (property.isAccessorProperty()) { |
| 554 if (property.name !== "__proto__" && property.getter) { | 562 if (property.name !== "__proto__" && property.getter) { |
| 555 property.parentObject = value; | 563 property.parentObject = value; |
| 556 treeNode.appendChild(new WebInspector.ObjectPropertyTreeElement( property)); | 564 treeNode.appendChild(new WebInspector.ObjectPropertyTreeElement( property, linkifier)); |
| 557 } | 565 } |
| 558 if (property.isOwn) { | 566 if (property.isOwn) { |
| 559 if (property.getter) { | 567 if (property.getter) { |
| 560 var getterProperty = new WebInspector.RemoteObjectProperty(" get " + property.name, property.getter); | 568 var getterProperty = new WebInspector.RemoteObjectProperty(" get " + property.name, property.getter); |
| 561 getterProperty.parentObject = value; | 569 getterProperty.parentObject = value; |
| 562 treeNode.appendChild(new WebInspector.ObjectPropertyTreeElem ent(getterProperty)); | 570 treeNode.appendChild(new WebInspector.ObjectPropertyTreeElem ent(getterProperty, linkifier)); |
| 563 } | 571 } |
| 564 if (property.setter) { | 572 if (property.setter) { |
| 565 var setterProperty = new WebInspector.RemoteObjectProperty(" set " + property.name, property.setter); | 573 var setterProperty = new WebInspector.RemoteObjectProperty(" set " + property.name, property.setter); |
| 566 setterProperty.parentObject = value; | 574 setterProperty.parentObject = value; |
| 567 treeNode.appendChild(new WebInspector.ObjectPropertyTreeElem ent(setterProperty)); | 575 treeNode.appendChild(new WebInspector.ObjectPropertyTreeElem ent(setterProperty, linkifier)); |
| 568 } | 576 } |
| 569 } | 577 } |
| 570 } else { | 578 } else { |
| 571 property.parentObject = value; | 579 property.parentObject = value; |
| 572 treeNode.appendChild(new WebInspector.ObjectPropertyTreeElement(prop erty)); | 580 treeNode.appendChild(new WebInspector.ObjectPropertyTreeElement(prop erty, linkifier)); |
| 573 } | 581 } |
| 574 } | 582 } |
| 575 if (internalProperties) { | 583 if (internalProperties) { |
| 576 for (var i = 0; i < internalProperties.length; i++) { | 584 for (var i = 0; i < internalProperties.length; i++) { |
| 577 internalProperties[i].parentObject = value; | 585 internalProperties[i].parentObject = value; |
| 578 var treeElement = new WebInspector.ObjectPropertyTreeElement(interna lProperties[i]); | 586 var treeElement = new WebInspector.ObjectPropertyTreeElement(interna lProperties[i], linkifier); |
| 579 if (internalProperties[i].name === "[[Entries]]") { | 587 if (internalProperties[i].name === "[[Entries]]") { |
| 580 treeElement.setExpandable(true); | 588 treeElement.setExpandable(true); |
| 581 treeElement.expand(); | 589 treeElement.expand(); |
| 582 } | 590 } |
| 583 treeNode.appendChild(treeElement); | 591 treeNode.appendChild(treeElement); |
| 584 } | 592 } |
| 585 } | 593 } |
| 586 if (value && value.type === "function") { | 594 if (value && value.type === "function") { |
| 587 // Whether function has TargetFunction internal property. | 595 // Whether function has TargetFunction internal property. |
| 588 // This is a simple way to tell that the function is actually a bound fu nction (we are not told). | 596 // This is a simple way to tell that the function is actually a bound fu nction (we are not told). |
| 589 // Bound function never has inner scope and doesn't need corresponding U I node. | 597 // Bound function never has inner scope and doesn't need corresponding U I node. |
| 590 var hasTargetFunction = false; | 598 var hasTargetFunction = false; |
| 591 | 599 |
| 592 if (internalProperties) { | 600 if (internalProperties) { |
| 593 for (var i = 0; i < internalProperties.length; i++) { | 601 for (var i = 0; i < internalProperties.length; i++) { |
| 594 if (internalProperties[i].name === "[[TargetFunction]]") { | 602 if (internalProperties[i].name === "[[TargetFunction]]") { |
| 595 hasTargetFunction = true; | 603 hasTargetFunction = true; |
| 596 break; | 604 break; |
| 597 } | 605 } |
| 598 } | 606 } |
| 599 } | 607 } |
| 600 if (!hasTargetFunction) | 608 if (!hasTargetFunction) |
| 601 treeNode.appendChild(new WebInspector.FunctionScopeMainTreeElement(v alue)); | 609 treeNode.appendChild(new WebInspector.FunctionScopeMainTreeElement(v alue, linkifier)); |
| 602 } | 610 } |
| 603 WebInspector.ObjectPropertyTreeElement._appendEmptyPlaceholderIfNeeded(treeN ode, emptyPlaceholder); | 611 WebInspector.ObjectPropertyTreeElement._appendEmptyPlaceholderIfNeeded(treeN ode, emptyPlaceholder); |
| 604 } | 612 } |
| 605 | 613 |
| 606 /** | 614 /** |
| 607 * @param {!TreeElement} treeNode | 615 * @param {!TreeElement} treeNode |
| 608 * @param {?string=} emptyPlaceholder | 616 * @param {?string=} emptyPlaceholder |
| 609 */ | 617 */ |
| 610 WebInspector.ObjectPropertyTreeElement._appendEmptyPlaceholderIfNeeded = functio n(treeNode, emptyPlaceholder) | 618 WebInspector.ObjectPropertyTreeElement._appendEmptyPlaceholderIfNeeded = functio n(treeNode, emptyPlaceholder) |
| 611 { | 619 { |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 640 object.getProperty(propertyPath, callback); | 648 object.getProperty(propertyPath, callback); |
| 641 } | 649 } |
| 642 | 650 |
| 643 return rootElement; | 651 return rootElement; |
| 644 } | 652 } |
| 645 | 653 |
| 646 /** | 654 /** |
| 647 * @constructor | 655 * @constructor |
| 648 * @extends {TreeElement} | 656 * @extends {TreeElement} |
| 649 * @param {!WebInspector.RemoteObject} remoteObject | 657 * @param {!WebInspector.RemoteObject} remoteObject |
| 658 * @param {?WebInspector.Linkifier=} linkifier | |
| 650 */ | 659 */ |
| 651 WebInspector.FunctionScopeMainTreeElement = function(remoteObject) | 660 WebInspector.FunctionScopeMainTreeElement = function(remoteObject, linkifier) |
| 652 { | 661 { |
| 653 TreeElement.call(this, "<function scope>", true); | 662 TreeElement.call(this, "<function scope>", true); |
| 654 this.toggleOnClick = true; | 663 this.toggleOnClick = true; |
| 655 this.selectable = false; | 664 this.selectable = false; |
| 656 this._remoteObject = remoteObject; | 665 this._remoteObject = remoteObject; |
| 666 this._linkifier = linkifier; | |
| 657 } | 667 } |
| 658 | 668 |
| 659 WebInspector.FunctionScopeMainTreeElement.prototype = { | 669 WebInspector.FunctionScopeMainTreeElement.prototype = { |
| 660 onpopulate: function() | 670 onpopulate: function() |
| 661 { | 671 { |
| 662 /** | 672 /** |
| 663 * @param {?WebInspector.DebuggerModel.FunctionDetails} response | 673 * @param {?WebInspector.DebuggerModel.FunctionDetails} response |
| 664 * @this {WebInspector.FunctionScopeMainTreeElement} | 674 * @this {WebInspector.FunctionScopeMainTreeElement} |
| 665 */ | 675 */ |
| 666 function didGetDetails(response) | 676 function didGetDetails(response) |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 704 console.error("Unknown scope type: " + scope.type); | 714 console.error("Unknown scope type: " + scope.type); |
| 705 continue; | 715 continue; |
| 706 } | 716 } |
| 707 | 717 |
| 708 var runtimeModel = this._remoteObject.target().runtimeModel; | 718 var runtimeModel = this._remoteObject.target().runtimeModel; |
| 709 if (isTrueObject) { | 719 if (isTrueObject) { |
| 710 var remoteObject = runtimeModel.createRemoteObject(scope.obj ect); | 720 var remoteObject = runtimeModel.createRemoteObject(scope.obj ect); |
| 711 var property = new WebInspector.RemoteObjectProperty(title, remoteObject); | 721 var property = new WebInspector.RemoteObjectProperty(title, remoteObject); |
| 712 property.writable = false; | 722 property.writable = false; |
| 713 property.parentObject = null; | 723 property.parentObject = null; |
| 714 this.appendChild(new WebInspector.ObjectPropertyTreeElement( property)); | 724 this.appendChild(new WebInspector.ObjectPropertyTreeElement( property, this._linkifier)); |
| 715 } else { | 725 } else { |
| 716 var scopeRef = new WebInspector.ScopeRef(i, undefined); | 726 var scopeRef = new WebInspector.ScopeRef(i, undefined); |
| 717 var remoteObject = runtimeModel.createScopeRemoteObject(scop e.object, scopeRef); | 727 var remoteObject = runtimeModel.createScopeRemoteObject(scop e.object, scopeRef); |
| 718 var scopeTreeElement = new WebInspector.ScopeTreeElement(tit le, remoteObject); | 728 var scopeTreeElement = new WebInspector.ScopeTreeElement(tit le, remoteObject); |
| 719 this.appendChild(scopeTreeElement); | 729 this.appendChild(scopeTreeElement); |
| 720 } | 730 } |
| 721 } | 731 } |
| 722 | 732 |
| 723 WebInspector.ObjectPropertyTreeElement._appendEmptyPlaceholderIfNeed ed(this, WebInspector.UIString("No Scopes")); | 733 WebInspector.ObjectPropertyTreeElement._appendEmptyPlaceholderIfNeed ed(this, WebInspector.UIString("No Scopes")); |
| 724 } | 734 } |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 739 { | 749 { |
| 740 TreeElement.call(this, title, true); | 750 TreeElement.call(this, title, true); |
| 741 this.toggleOnClick = true; | 751 this.toggleOnClick = true; |
| 742 this.selectable = false; | 752 this.selectable = false; |
| 743 this._remoteObject = remoteObject; | 753 this._remoteObject = remoteObject; |
| 744 } | 754 } |
| 745 | 755 |
| 746 WebInspector.ScopeTreeElement.prototype = { | 756 WebInspector.ScopeTreeElement.prototype = { |
| 747 onpopulate: function() | 757 onpopulate: function() |
| 748 { | 758 { |
| 749 WebInspector.ObjectPropertyTreeElement._populate(this, this._remoteObjec t, false); | 759 WebInspector.ObjectPropertyTreeElement._populate(this, this._remoteObjec t, false, null); |
| 750 }, | 760 }, |
| 751 | 761 |
| 752 __proto__: TreeElement.prototype | 762 __proto__: TreeElement.prototype |
| 753 } | 763 } |
| 754 | 764 |
| 755 /** | 765 /** |
| 756 * @constructor | 766 * @constructor |
| 757 * @extends {TreeElement} | 767 * @extends {TreeElement} |
| 758 * @param {!WebInspector.RemoteObject} object | 768 * @param {!WebInspector.RemoteObject} object |
| 759 * @param {number} fromIndex | 769 * @param {number} fromIndex |
| 760 * @param {number} toIndex | 770 * @param {number} toIndex |
| 761 * @param {number} propertyCount | 771 * @param {number} propertyCount |
| 772 * @param {?WebInspector.Linkifier=} linkifier | |
| 762 */ | 773 */ |
| 763 WebInspector.ArrayGroupingTreeElement = function(object, fromIndex, toIndex, pro pertyCount) | 774 WebInspector.ArrayGroupingTreeElement = function(object, fromIndex, toIndex, pro pertyCount, linkifier) |
| 764 { | 775 { |
| 765 TreeElement.call(this, String.sprintf("[%d \u2026 %d]", fromIndex, toIndex), true); | 776 TreeElement.call(this, String.sprintf("[%d \u2026 %d]", fromIndex, toIndex), true); |
| 766 this.toggleOnClick = true; | 777 this.toggleOnClick = true; |
| 767 this.selectable = false; | 778 this.selectable = false; |
| 768 this._fromIndex = fromIndex; | 779 this._fromIndex = fromIndex; |
| 769 this._toIndex = toIndex; | 780 this._toIndex = toIndex; |
| 770 this._object = object; | 781 this._object = object; |
| 771 this._readOnly = true; | 782 this._readOnly = true; |
| 772 this._propertyCount = propertyCount; | 783 this._propertyCount = propertyCount; |
| 784 this._linkifier = linkifier; | |
| 773 } | 785 } |
| 774 | 786 |
| 775 WebInspector.ArrayGroupingTreeElement._bucketThreshold = 100; | 787 WebInspector.ArrayGroupingTreeElement._bucketThreshold = 100; |
| 776 WebInspector.ArrayGroupingTreeElement._sparseIterationThreshold = 250000; | 788 WebInspector.ArrayGroupingTreeElement._sparseIterationThreshold = 250000; |
| 777 WebInspector.ArrayGroupingTreeElement._getOwnPropertyNamesThreshold = 500000; | 789 WebInspector.ArrayGroupingTreeElement._getOwnPropertyNamesThreshold = 500000; |
| 778 | 790 |
| 779 /** | 791 /** |
| 780 * @param {!TreeElement} treeNode | 792 * @param {!TreeElement} treeNode |
| 781 * @param {!WebInspector.RemoteObject} object | 793 * @param {!WebInspector.RemoteObject} object |
| 782 * @param {number} fromIndex | 794 * @param {number} fromIndex |
| 783 * @param {number} toIndex | 795 * @param {number} toIndex |
| 796 * @param {?WebInspector.Linkifier=} linkifier | |
| 784 */ | 797 */ |
| 785 WebInspector.ArrayGroupingTreeElement._populateArray = function(treeNode, object , fromIndex, toIndex) | 798 WebInspector.ArrayGroupingTreeElement._populateArray = function(treeNode, object , fromIndex, toIndex, linkifier) |
| 786 { | 799 { |
| 787 WebInspector.ArrayGroupingTreeElement._populateRanges(treeNode, object, from Index, toIndex, true); | 800 WebInspector.ArrayGroupingTreeElement._populateRanges(treeNode, object, from Index, toIndex, true, linkifier); |
| 788 } | 801 } |
| 789 | 802 |
| 790 /** | 803 /** |
| 791 * @param {!TreeElement} treeNode | 804 * @param {!TreeElement} treeNode |
| 792 * @param {!WebInspector.RemoteObject} object | 805 * @param {!WebInspector.RemoteObject} object |
| 793 * @param {number} fromIndex | 806 * @param {number} fromIndex |
| 794 * @param {number} toIndex | 807 * @param {number} toIndex |
| 795 * @param {boolean} topLevel | 808 * @param {boolean} topLevel |
| 809 * @param {?WebInspector.Linkifier=} linkifier | |
| 796 * @this {WebInspector.ArrayGroupingTreeElement} | 810 * @this {WebInspector.ArrayGroupingTreeElement} |
| 797 */ | 811 */ |
| 798 WebInspector.ArrayGroupingTreeElement._populateRanges = function(treeNode, objec t, fromIndex, toIndex, topLevel) | 812 WebInspector.ArrayGroupingTreeElement._populateRanges = function(treeNode, objec t, fromIndex, toIndex, topLevel, linkifier) |
| 799 { | 813 { |
| 800 object.callFunctionJSON(packRanges, [ | 814 object.callFunctionJSON(packRanges, [ |
| 801 { value: fromIndex }, | 815 { value: fromIndex }, |
| 802 { value: toIndex }, | 816 { value: toIndex }, |
| 803 { value: WebInspector.ArrayGroupingTreeElement._bucketThreshold }, | 817 { value: WebInspector.ArrayGroupingTreeElement._bucketThreshold }, |
| 804 { value: WebInspector.ArrayGroupingTreeElement._sparseIterationThreshold }, | 818 { value: WebInspector.ArrayGroupingTreeElement._sparseIterationThreshold }, |
| 805 { value: WebInspector.ArrayGroupingTreeElement._getOwnPropertyNamesThres hold } | 819 { value: WebInspector.ArrayGroupingTreeElement._getOwnPropertyNamesThres hold } |
| 806 ], callback); | 820 ], callback); |
| 807 | 821 |
| 808 /** | 822 /** |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 882 | 896 |
| 883 return { ranges: ranges, skipGetOwnPropertyNames: skipGetOwnPropertyName s }; | 897 return { ranges: ranges, skipGetOwnPropertyNames: skipGetOwnPropertyName s }; |
| 884 } | 898 } |
| 885 | 899 |
| 886 function callback(result) | 900 function callback(result) |
| 887 { | 901 { |
| 888 if (!result) | 902 if (!result) |
| 889 return; | 903 return; |
| 890 var ranges = /** @type {!Array.<!Array.<number>>} */ (result.ranges); | 904 var ranges = /** @type {!Array.<!Array.<number>>} */ (result.ranges); |
| 891 if (ranges.length === 1) { | 905 if (ranges.length === 1) { |
| 892 WebInspector.ArrayGroupingTreeElement._populateAsFragment(treeNode, object, ranges[0][0], ranges[0][1]); | 906 WebInspector.ArrayGroupingTreeElement._populateAsFragment(treeNode, object, ranges[0][0], ranges[0][1], linkifier); |
| 893 } else { | 907 } else { |
| 894 for (var i = 0; i < ranges.length; ++i) { | 908 for (var i = 0; i < ranges.length; ++i) { |
| 895 var fromIndex = ranges[i][0]; | 909 var fromIndex = ranges[i][0]; |
| 896 var toIndex = ranges[i][1]; | 910 var toIndex = ranges[i][1]; |
| 897 var count = ranges[i][2]; | 911 var count = ranges[i][2]; |
| 898 if (fromIndex === toIndex) | 912 if (fromIndex === toIndex) |
| 899 WebInspector.ArrayGroupingTreeElement._populateAsFragment(tr eeNode, object, fromIndex, toIndex); | 913 WebInspector.ArrayGroupingTreeElement._populateAsFragment(tr eeNode, object, fromIndex, toIndex, linkifier); |
| 900 else | 914 else |
| 901 treeNode.appendChild(new WebInspector.ArrayGroupingTreeEleme nt(object, fromIndex, toIndex, count)); | 915 treeNode.appendChild(new WebInspector.ArrayGroupingTreeEleme nt(object, fromIndex, toIndex, count, linkifier)); |
| 902 } | 916 } |
| 903 } | 917 } |
| 904 if (topLevel) | 918 if (topLevel) |
| 905 WebInspector.ArrayGroupingTreeElement._populateNonIndexProperties(tr eeNode, object, result.skipGetOwnPropertyNames); | 919 WebInspector.ArrayGroupingTreeElement._populateNonIndexProperties(tr eeNode, object, result.skipGetOwnPropertyNames, linkifier); |
| 906 } | 920 } |
| 907 } | 921 } |
| 908 | 922 |
| 909 /** | 923 /** |
| 910 * @param {!TreeElement} treeNode | 924 * @param {!TreeElement} treeNode |
| 911 * @param {!WebInspector.RemoteObject} object | 925 * @param {!WebInspector.RemoteObject} object |
| 912 * @param {number} fromIndex | 926 * @param {number} fromIndex |
| 913 * @param {number} toIndex | 927 * @param {number} toIndex |
| 928 * @param {?WebInspector.Linkifier=} linkifier | |
| 914 * @this {WebInspector.ArrayGroupingTreeElement} | 929 * @this {WebInspector.ArrayGroupingTreeElement} |
| 915 */ | 930 */ |
| 916 WebInspector.ArrayGroupingTreeElement._populateAsFragment = function(treeNode, o bject, fromIndex, toIndex) | 931 WebInspector.ArrayGroupingTreeElement._populateAsFragment = function(treeNode, o bject, fromIndex, toIndex, linkifier) |
| 917 { | 932 { |
| 918 object.callFunction(buildArrayFragment, [{value: fromIndex}, {value: toIndex }, {value: WebInspector.ArrayGroupingTreeElement._sparseIterationThreshold}], pr ocessArrayFragment.bind(this)); | 933 object.callFunction(buildArrayFragment, [{value: fromIndex}, {value: toIndex }, {value: WebInspector.ArrayGroupingTreeElement._sparseIterationThreshold}], pr ocessArrayFragment.bind(this)); |
| 919 | 934 |
| 920 /** | 935 /** |
| 921 * @suppressReceiverCheck | 936 * @suppressReceiverCheck |
| 922 * @this {Object} | 937 * @this {Object} |
| 923 * @param {number=} fromIndex // must declare optional | 938 * @param {number=} fromIndex // must declare optional |
| 924 * @param {number=} toIndex // must declare optional | 939 * @param {number=} toIndex // must declare optional |
| 925 * @param {number=} sparseIterationThreshold // must declare optional | 940 * @param {number=} sparseIterationThreshold // must declare optional |
| 926 */ | 941 */ |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 958 | 973 |
| 959 /** @this {WebInspector.ArrayGroupingTreeElement} */ | 974 /** @this {WebInspector.ArrayGroupingTreeElement} */ |
| 960 function processProperties(properties, internalProperties) | 975 function processProperties(properties, internalProperties) |
| 961 { | 976 { |
| 962 if (!properties) | 977 if (!properties) |
| 963 return; | 978 return; |
| 964 | 979 |
| 965 properties.sort(WebInspector.ObjectPropertiesSection.CompareProperties); | 980 properties.sort(WebInspector.ObjectPropertiesSection.CompareProperties); |
| 966 for (var i = 0; i < properties.length; ++i) { | 981 for (var i = 0; i < properties.length; ++i) { |
| 967 properties[i].parentObject = this._object; | 982 properties[i].parentObject = this._object; |
| 968 var childTreeElement = new WebInspector.ObjectPropertyTreeElement(pr operties[i]); | 983 var childTreeElement = new WebInspector.ObjectPropertyTreeElement(pr operties[i], linkifier); |
| 969 childTreeElement._readOnly = true; | 984 childTreeElement._readOnly = true; |
| 970 treeNode.appendChild(childTreeElement); | 985 treeNode.appendChild(childTreeElement); |
| 971 } | 986 } |
| 972 } | 987 } |
| 973 } | 988 } |
| 974 | 989 |
| 975 /** | 990 /** |
| 976 * @param {!TreeElement} treeNode | 991 * @param {!TreeElement} treeNode |
| 977 * @param {!WebInspector.RemoteObject} object | 992 * @param {!WebInspector.RemoteObject} object |
| 978 * @param {boolean} skipGetOwnPropertyNames | 993 * @param {boolean} skipGetOwnPropertyNames |
| 994 * @param {?WebInspector.Linkifier=} linkifier | |
| 979 * @this {WebInspector.ArrayGroupingTreeElement} | 995 * @this {WebInspector.ArrayGroupingTreeElement} |
| 980 */ | 996 */ |
| 981 WebInspector.ArrayGroupingTreeElement._populateNonIndexProperties = function(tre eNode, object, skipGetOwnPropertyNames) | 997 WebInspector.ArrayGroupingTreeElement._populateNonIndexProperties = function(tre eNode, object, skipGetOwnPropertyNames, linkifier) |
| 982 { | 998 { |
| 983 object.callFunction(buildObjectFragment, [{value: skipGetOwnPropertyNames}], processObjectFragment.bind(this)); | 999 object.callFunction(buildObjectFragment, [{value: skipGetOwnPropertyNames}], processObjectFragment.bind(this)); |
| 984 | 1000 |
| 985 /** | 1001 /** |
| 986 * @param {boolean=} skipGetOwnPropertyNames | 1002 * @param {boolean=} skipGetOwnPropertyNames |
| 987 * @suppressReceiverCheck | 1003 * @suppressReceiverCheck |
| 988 * @this {Object} | 1004 * @this {Object} |
| 989 */ | 1005 */ |
| 990 function buildObjectFragment(skipGetOwnPropertyNames) | 1006 function buildObjectFragment(skipGetOwnPropertyNames) |
| 991 { | 1007 { |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 1022 * @param {?Array.<!WebInspector.RemoteObjectProperty>=} internalProperties | 1038 * @param {?Array.<!WebInspector.RemoteObjectProperty>=} internalProperties |
| 1023 * @this {WebInspector.ArrayGroupingTreeElement} | 1039 * @this {WebInspector.ArrayGroupingTreeElement} |
| 1024 */ | 1040 */ |
| 1025 function processProperties(properties, internalProperties) | 1041 function processProperties(properties, internalProperties) |
| 1026 { | 1042 { |
| 1027 if (!properties) | 1043 if (!properties) |
| 1028 return; | 1044 return; |
| 1029 properties.sort(WebInspector.ObjectPropertiesSection.CompareProperties); | 1045 properties.sort(WebInspector.ObjectPropertiesSection.CompareProperties); |
| 1030 for (var i = 0; i < properties.length; ++i) { | 1046 for (var i = 0; i < properties.length; ++i) { |
| 1031 properties[i].parentObject = this._object; | 1047 properties[i].parentObject = this._object; |
| 1032 var childTreeElement = new WebInspector.ObjectPropertyTreeElement(pr operties[i]); | 1048 var childTreeElement = new WebInspector.ObjectPropertyTreeElement(pr operties[i], linkifier); |
| 1033 childTreeElement._readOnly = true; | 1049 childTreeElement._readOnly = true; |
| 1034 treeNode.appendChild(childTreeElement); | 1050 treeNode.appendChild(childTreeElement); |
| 1035 } | 1051 } |
| 1036 } | 1052 } |
| 1037 } | 1053 } |
| 1038 | 1054 |
| 1039 WebInspector.ArrayGroupingTreeElement.prototype = { | 1055 WebInspector.ArrayGroupingTreeElement.prototype = { |
| 1040 onpopulate: function() | 1056 onpopulate: function() |
| 1041 { | 1057 { |
| 1042 if (this._propertyCount >= WebInspector.ArrayGroupingTreeElement._bucket Threshold) { | 1058 if (this._propertyCount >= WebInspector.ArrayGroupingTreeElement._bucket Threshold) { |
| 1043 WebInspector.ArrayGroupingTreeElement._populateRanges(this, this._ob ject, this._fromIndex, this._toIndex, false); | 1059 WebInspector.ArrayGroupingTreeElement._populateRanges(this, this._ob ject, this._fromIndex, this._toIndex, false, this._linkifier); |
| 1044 return; | 1060 return; |
| 1045 } | 1061 } |
| 1046 WebInspector.ArrayGroupingTreeElement._populateAsFragment(this, this._ob ject, this._fromIndex, this._toIndex); | 1062 WebInspector.ArrayGroupingTreeElement._populateAsFragment(this, this._ob ject, this._fromIndex, this._toIndex, this._linkifier); |
| 1047 }, | 1063 }, |
| 1048 | 1064 |
| 1049 onattach: function() | 1065 onattach: function() |
| 1050 { | 1066 { |
| 1051 this.listItemElement.classList.add("object-properties-section-name"); | 1067 this.listItemElement.classList.add("object-properties-section-name"); |
| 1052 }, | 1068 }, |
| 1053 | 1069 |
| 1054 __proto__: TreeElement.prototype | 1070 __proto__: TreeElement.prototype |
| 1055 } | 1071 } |
| 1056 | 1072 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1095 matches = /[^(]*(\([^)]*)/.exec(text); | 1111 matches = /[^(]*(\([^)]*)/.exec(text); |
| 1096 } | 1112 } |
| 1097 var match = matches ? matches[1] : null; | 1113 var match = matches ? matches[1] : null; |
| 1098 return match ? match.replace(/\n/g, " ") + ")" : (text || ""); | 1114 return match ? match.replace(/\n/g, " ") + ")" : (text || ""); |
| 1099 } | 1115 } |
| 1100 | 1116 |
| 1101 /** | 1117 /** |
| 1102 * @param {!WebInspector.RemoteObject} value | 1118 * @param {!WebInspector.RemoteObject} value |
| 1103 * @param {boolean} wasThrown | 1119 * @param {boolean} wasThrown |
| 1104 * @param {!Element=} parentElement | 1120 * @param {!Element=} parentElement |
| 1121 * @param {?WebInspector.Linkifier=} linkifier | |
| 1105 * @return {!Element} | 1122 * @return {!Element} |
| 1106 */ | 1123 */ |
| 1107 WebInspector.ObjectPropertiesSection.createValueElementWithCustomSupport = funct ion(value, wasThrown, parentElement) | 1124 WebInspector.ObjectPropertiesSection.createValueElementWithCustomSupport = funct ion(value, wasThrown, parentElement, linkifier) |
| 1108 { | 1125 { |
| 1109 if (value.customPreview()) { | 1126 if (value.customPreview()) { |
| 1110 var result = (new WebInspector.CustomPreviewComponent(value)).element; | 1127 var result = (new WebInspector.CustomPreviewComponent(value)).element; |
| 1111 result.classList.add("object-properties-section-custom-section"); | 1128 result.classList.add("object-properties-section-custom-section"); |
| 1112 return result | 1129 return result |
| 1113 } | 1130 } |
| 1114 return WebInspector.ObjectPropertiesSection.createValueElement(value, wasThr own, parentElement); | 1131 return WebInspector.ObjectPropertiesSection.createValueElement(value, wasThr own, parentElement, linkifier); |
| 1115 } | 1132 } |
| 1116 | 1133 |
| 1117 /** | 1134 /** |
| 1118 * @param {!WebInspector.RemoteObject} value | 1135 * @param {!WebInspector.RemoteObject} value |
| 1119 * @param {boolean} wasThrown | 1136 * @param {boolean} wasThrown |
| 1120 * @param {!Element=} parentElement | 1137 * @param {!Element=} parentElement |
| 1138 * @param {?WebInspector.Linkifier=} linkifier | |
| 1121 * @return {!Element} | 1139 * @return {!Element} |
| 1122 */ | 1140 */ |
| 1123 WebInspector.ObjectPropertiesSection.createValueElement = function(value, wasThr own, parentElement) | 1141 WebInspector.ObjectPropertiesSection.createValueElement = function(value, wasThr own, parentElement, linkifier) |
| 1124 { | 1142 { |
| 1125 var valueElement = createElementWithClass("span", "value"); | 1143 var valueElement = createElementWithClass("span", "value"); |
| 1126 var type = value.type; | 1144 var type = value.type; |
| 1127 var subtype = value.subtype; | 1145 var subtype = value.subtype; |
| 1128 var description = value.description; | 1146 var description = value.description; |
| 1129 var prefix; | 1147 var prefix; |
| 1130 var valueText; | 1148 var valueText; |
| 1131 var suffix; | 1149 var suffix; |
| 1132 if (wasThrown) { | 1150 if (wasThrown) { |
| 1133 prefix = "[Exception: "; | 1151 prefix = "[Exception: "; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1167 | 1185 |
| 1168 if (type === "object" && subtype === "node" && description) { | 1186 if (type === "object" && subtype === "node" && description) { |
| 1169 WebInspector.DOMPresentationUtils.createSpansForNodeTitle(valueElement, description); | 1187 WebInspector.DOMPresentationUtils.createSpansForNodeTitle(valueElement, description); |
| 1170 valueElement.addEventListener("click", mouseClick, false); | 1188 valueElement.addEventListener("click", mouseClick, false); |
| 1171 valueElement.addEventListener("mousemove", mouseMove, false); | 1189 valueElement.addEventListener("mousemove", mouseMove, false); |
| 1172 valueElement.addEventListener("mouseleave", mouseLeave, false); | 1190 valueElement.addEventListener("mouseleave", mouseLeave, false); |
| 1173 } else { | 1191 } else { |
| 1174 valueElement.title = description || ""; | 1192 valueElement.title = description || ""; |
| 1175 } | 1193 } |
| 1176 | 1194 |
| 1195 if (type === "object" && subtype === "internal#location" && linkifier) { | |
| 1196 var loc = value.value; | |
|
dgozman
2016/07/07 19:34:26
location
kozy
2016/07/07 21:33:28
Done.
| |
| 1197 return linkifier.linkifyScriptLocation(value.target(), loc.scriptId, "", loc.lineNumber, loc.columnNumber); | |
| 1198 } | |
| 1199 | |
| 1177 function mouseMove() | 1200 function mouseMove() |
| 1178 { | 1201 { |
| 1179 WebInspector.DOMModel.highlightObjectAsDOMNode(value); | 1202 WebInspector.DOMModel.highlightObjectAsDOMNode(value); |
| 1180 } | 1203 } |
| 1181 | 1204 |
| 1182 function mouseLeave() | 1205 function mouseLeave() |
| 1183 { | 1206 { |
| 1184 WebInspector.DOMModel.hideDOMNodeHighlight(); | 1207 WebInspector.DOMModel.hideDOMNodeHighlight(); |
| 1185 } | 1208 } |
| 1186 | 1209 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1363 | 1386 |
| 1364 result = currentName + (result ? "." + result : ""); | 1387 result = currentName + (result ? "." + result : ""); |
| 1365 current = current.parent; | 1388 current = current.parent; |
| 1366 } | 1389 } |
| 1367 var treeOutlineId = treeElement.treeOutline[WebInspector.ObjectPropertie sSectionExpandController._treeOutlineId]; | 1390 var treeOutlineId = treeElement.treeOutline[WebInspector.ObjectPropertie sSectionExpandController._treeOutlineId]; |
| 1368 result = treeOutlineId + (result ? ":" + result : ""); | 1391 result = treeOutlineId + (result ? ":" + result : ""); |
| 1369 treeElement[WebInspector.ObjectPropertiesSectionExpandController._cached PathSymbol] = result; | 1392 treeElement[WebInspector.ObjectPropertiesSectionExpandController._cached PathSymbol] = result; |
| 1370 return result; | 1393 return result; |
| 1371 } | 1394 } |
| 1372 } | 1395 } |
| OLD | NEW |