Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 429 * @param {!WebInspector.RemoteObject} obj | 429 * @param {!WebInspector.RemoteObject} obj |
| 430 * @param {!Element} titleElement | 430 * @param {!Element} titleElement |
| 431 * @return {!WebInspector.ObjectPropertiesSection} | 431 * @return {!WebInspector.ObjectPropertiesSection} |
| 432 */ | 432 */ |
| 433 _buildExpandableObjectSection: function(obj, titleElement) | 433 _buildExpandableObjectSection: function(obj, titleElement) |
| 434 { | 434 { |
| 435 var note = titleElement.createChild("span", "object-state-note"); | 435 var note = titleElement.createChild("span", "object-state-note"); |
| 436 note.classList.add("info-note"); | 436 note.classList.add("info-note"); |
| 437 note.title = WebInspector.UIString("Object value at left was snapshotted when logged, value below was evaluated just now."); | 437 note.title = WebInspector.UIString("Object value at left was snapshotted when logged, value below was evaluated just now."); |
| 438 | 438 |
| 439 var section = new WebInspector.ObjectPropertiesSection(obj, titleElement , this._linkifier); | 439 var titleText = titleElement.deepTextContent(); |
| 440 var expandedTitleElement = null; | |
| 441 if (obj.description !== titleText && WebInspector.ObjectPropertiesSectio n.needsAlternateTitle(obj)) { | |
| 442 expandedTitleElement = createElement("span"); | |
| 443 expandedTitleElement.createTextChild(obj.description || ""); | |
|
lushnikov
2016/07/12 02:51:55
let's just create a TextNode with obj.description
luoe
2016/07/13 18:06:28
One reason to keep expandedTitleElement an HTMLEle
| |
| 444 } | |
| 445 | |
| 446 var section = new WebInspector.ObjectPropertiesSection(obj, titleElement , expandedTitleElement, this._linkifier); | |
| 440 section.element.classList.add("console-view-object-properties-section"); | 447 section.element.classList.add("console-view-object-properties-section"); |
| 441 section.enableContextMenu(); | 448 section.enableContextMenu(); |
| 442 return section; | 449 return section; |
| 443 }, | 450 }, |
| 444 | 451 |
| 445 /** | 452 /** |
| 446 * @param {!WebInspector.RemoteObject} func | 453 * @param {!WebInspector.RemoteObject} func |
| 447 * @param {!Element} element | 454 * @param {!Element} element |
| 448 * @param {boolean=} includePreview | 455 * @param {boolean=} includePreview |
| 449 */ | 456 */ |
| (...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1351 { | 1358 { |
| 1352 if (!this._wrapperElement) { | 1359 if (!this._wrapperElement) { |
| 1353 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this ); | 1360 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this ); |
| 1354 this._wrapperElement.classList.toggle("collapsed", this._collapsed); | 1361 this._wrapperElement.classList.toggle("collapsed", this._collapsed); |
| 1355 } | 1362 } |
| 1356 return this._wrapperElement; | 1363 return this._wrapperElement; |
| 1357 }, | 1364 }, |
| 1358 | 1365 |
| 1359 __proto__: WebInspector.ConsoleViewMessage.prototype | 1366 __proto__: WebInspector.ConsoleViewMessage.prototype |
| 1360 } | 1367 } |
| OLD | NEW |