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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js

Issue 2557573002: DevTools: show name descriptions before formatted TypedArrays (Closed)
Patch Set: fix test Created 4 years 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 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 /** 4 /**
5 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 Components.RemoteObjectPreviewFormatter = class { 7 Components.RemoteObjectPreviewFormatter = class {
8 /** 8 /**
9 * @param {!Element} parentElement 9 * @param {!Element} parentElement
10 * @param {!Protocol.Runtime.ObjectPreview} preview 10 * @param {!Protocol.Runtime.ObjectPreview} preview
11 */ 11 */
12 appendObjectPreview(parentElement, preview) { 12 appendObjectPreview(parentElement, preview) {
13 var description = preview.description; 13 var description = preview.description;
14 if (preview.type !== 'object' || preview.subtype === 'null') { 14 if (preview.type !== 'object' || preview.subtype === 'null') {
15 parentElement.appendChild(this.renderPropertyPreview(preview.type, preview .subtype, description)); 15 parentElement.appendChild(this.renderPropertyPreview(preview.type, preview .subtype, description));
16 return; 16 return;
17 } 17 }
18 var isArray = preview.subtype === 'array' || preview.subtype === 'typedarray '; 18 if (description && preview.subtype !== 'array') {
19 if (description && !isArray) {
20 var text = preview.subtype ? description : this._abbreviateFullQualifiedCl assName(description); 19 var text = preview.subtype ? description : this._abbreviateFullQualifiedCl assName(description);
21 parentElement.createTextChildren(text, ' '); 20 parentElement.createTextChildren(text, ' ');
22 } 21 }
23 22
23 var isArray = preview.subtype === 'array' || preview.subtype === 'typedarray ';
24 parentElement.createTextChild(isArray ? '[' : '{'); 24 parentElement.createTextChild(isArray ? '[' : '{');
25 if (preview.entries) 25 if (preview.entries)
26 this._appendEntriesPreview(parentElement, preview); 26 this._appendEntriesPreview(parentElement, preview);
27 else if (isArray) 27 else if (isArray)
28 this._appendArrayPropertiesPreview(parentElement, preview); 28 this._appendArrayPropertiesPreview(parentElement, preview);
29 else 29 else
30 this._appendObjectPropertiesPreview(parentElement, preview); 30 this._appendObjectPropertiesPreview(parentElement, preview);
31 if (preview.overflow) 31 if (preview.overflow)
32 parentElement.createChild('span').textContent = '\u2026'; 32 parentElement.createChild('span').textContent = '\u2026';
33 parentElement.createTextChild(isArray ? ']' : '}'); 33 parentElement.createTextChild(isArray ? ']' : '}');
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 if (type === 'object' && !subtype) { 185 if (type === 'object' && !subtype) {
186 span.textContent = this._abbreviateFullQualifiedClassName(description); 186 span.textContent = this._abbreviateFullQualifiedClassName(description);
187 return span; 187 return span;
188 } 188 }
189 189
190 span.textContent = description; 190 span.textContent = description;
191 return span; 191 return span;
192 } 192 }
193 }; 193 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698