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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js

Issue 1963753003: DevTools: default all console object previews to lossy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added missing return Created 4 years, 7 months 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 /* 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 /** 404 /**
405 * @param {!WebInspector.RemoteObject} obj 405 * @param {!WebInspector.RemoteObject} obj
406 * @param {!Element} elem 406 * @param {!Element} elem
407 * @param {boolean=} includePreview 407 * @param {boolean=} includePreview
408 */ 408 */
409 _formatParameterAsArrayOrObject: function(obj, elem, includePreview) 409 _formatParameterAsArrayOrObject: function(obj, elem, includePreview)
410 { 410 {
411 var titleElement = createElement("span"); 411 var titleElement = createElement("span");
412 if (includePreview && obj.preview) { 412 if (includePreview && obj.preview) {
413 titleElement.classList.add("console-object-preview"); 413 titleElement.classList.add("console-object-preview");
414 var lossless = this._previewFormatter.appendObjectPreview(titleEleme nt, obj.preview); 414 this._previewFormatter.appendObjectPreview(titleElement, obj.preview );
415 if (lossless) {
416 elem.appendChild(titleElement);
417 titleElement.addEventListener("contextmenu", this._contextMenuEv entFired.bind(this, obj), false);
418 return;
419 }
420 } else { 415 } else {
421 if (obj.type === "function") { 416 if (obj.type === "function") {
422 WebInspector.ObjectPropertiesSection.formatObjectAsFunction(obj, titleElement, false); 417 WebInspector.ObjectPropertiesSection.formatObjectAsFunction(obj, titleElement, false);
423 titleElement.classList.add("object-value-function"); 418 titleElement.classList.add("object-value-function");
424 } else { 419 } else {
425 titleElement.createTextChild(obj.description || ""); 420 titleElement.createTextChild(obj.description || "");
426 } 421 }
427 } 422 }
428 var note = titleElement.createChild("span", "object-state-note"); 423 var note = titleElement.createChild("span", "object-state-note");
429 note.classList.add("info-note"); 424 note.classList.add("info-note");
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 var flatValues = []; 575 var flatValues = [];
581 for (var i = 0; i < rows.length; ++i) { 576 for (var i = 0; i < rows.length; ++i) {
582 var rowName = rows[i][0]; 577 var rowName = rows[i][0];
583 var rowValue = rows[i][1]; 578 var rowValue = rows[i][1];
584 flatValues.push(rowName); 579 flatValues.push(rowName);
585 for (var j = 0; j < columnNames.length; ++j) 580 for (var j = 0; j < columnNames.length; ++j)
586 flatValues.push(rowValue[columnNames[j]]); 581 flatValues.push(rowValue[columnNames[j]]);
587 } 582 }
588 583
589 var dataGridContainer = element.createChild("span"); 584 var dataGridContainer = element.createChild("span");
590 if (!preview.lossless || !flatValues.length) { 585 element.appendChild(this._formatParameter(table, true, false));
591 element.appendChild(this._formatParameter(table, true, false)); 586 if (!flatValues.length)
592 if (!flatValues.length) 587 return element;
593 return element;
594 }
595 588
596 columnNames.unshift(WebInspector.UIString("(index)")); 589 columnNames.unshift(WebInspector.UIString("(index)"));
597 var dataGrid = WebInspector.SortableDataGrid.create(columnNames, flatVal ues); 590 var dataGrid = WebInspector.SortableDataGrid.create(columnNames, flatVal ues);
598 dataGrid.renderInline(); 591 dataGrid.renderInline();
599 dataGridContainer.appendChild(dataGrid.element); 592 dataGridContainer.appendChild(dataGrid.element);
600 this._dataGrids.push(dataGrid); 593 this._dataGrids.push(dataGrid);
601 return element; 594 return element;
602 }, 595 },
603 596
604 /** 597 /**
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 { 1332 {
1340 if (!this._wrapperElement) { 1333 if (!this._wrapperElement) {
1341 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this ); 1334 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this );
1342 this._wrapperElement.classList.toggle("collapsed", this._collapsed); 1335 this._wrapperElement.classList.toggle("collapsed", this._collapsed);
1343 } 1336 }
1344 return this._wrapperElement; 1337 return this._wrapperElement;
1345 }, 1338 },
1346 1339
1347 __proto__: WebInspector.ConsoleViewMessage.prototype 1340 __proto__: WebInspector.ConsoleViewMessage.prototype
1348 } 1341 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698