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

Side by Side Diff: Source/devtools/front_end/profiler/HeapSnapshotGridNodes.js

Issue 662793002: [DevTools] Replace usages of document with custom functions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 } 236 }
237 return null; 237 return null;
238 }, 238 },
239 239
240 /** 240 /**
241 * @param {string} columnIdentifier 241 * @param {string} columnIdentifier
242 * @return {!Element} 242 * @return {!Element}
243 */ 243 */
244 _createValueCell: function(columnIdentifier) 244 _createValueCell: function(columnIdentifier)
245 { 245 {
246 var cell = document.createElement("td"); 246 var cell = createElement("td");
247 cell.className = "numeric-column"; 247 cell.className = "numeric-column";
248 if (this.dataGrid.snapshot.totalSize !== 0) { 248 if (this.dataGrid.snapshot.totalSize !== 0) {
249 var div = document.createElement("div"); 249 var div = createElement("div");
250 var valueSpan = document.createElement("span"); 250 var valueSpan = createElement("span");
251 valueSpan.textContent = this.data[columnIdentifier]; 251 valueSpan.textContent = this.data[columnIdentifier];
252 div.appendChild(valueSpan); 252 div.appendChild(valueSpan);
253 var percentColumn = columnIdentifier + "-percent"; 253 var percentColumn = columnIdentifier + "-percent";
254 if (percentColumn in this.data) { 254 if (percentColumn in this.data) {
255 var percentSpan = document.createElement("span"); 255 var percentSpan = createElement("span");
256 percentSpan.className = "percent-column"; 256 percentSpan.className = "percent-column";
257 percentSpan.textContent = this.data[percentColumn]; 257 percentSpan.textContent = this.data[percentColumn];
258 div.appendChild(percentSpan); 258 div.appendChild(percentSpan);
259 div.classList.add("profile-multiple-values"); 259 div.classList.add("profile-multiple-values");
260 } 260 }
261 cell.appendChild(div); 261 cell.appendChild(div);
262 } 262 }
263 return cell; 263 return cell;
264 }, 264 },
265 265
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 valueStyle += " highlight"; 589 valueStyle += " highlight";
590 if (value === "Object") 590 if (value === "Object")
591 value = ""; 591 value = "";
592 if (this.detachedDOMTreeNode) 592 if (this.detachedDOMTreeNode)
593 valueStyle += " detached-dom-tree-node"; 593 valueStyle += " detached-dom-tree-node";
594 return this._createObjectCellWithValue(valueStyle, value); 594 return this._createObjectCellWithValue(valueStyle, value);
595 }, 595 },
596 596
597 _createObjectCellWithValue: function(valueStyle, value) 597 _createObjectCellWithValue: function(valueStyle, value)
598 { 598 {
599 var cell = document.createElement("td"); 599 var cell = createElement("td");
600 cell.className = "object-column"; 600 cell.className = "object-column";
601 var div = document.createElement("div"); 601 var div = createElement("div");
602 div.className = "source-code event-properties"; 602 div.className = "source-code event-properties";
603 div.style.overflow = "visible"; 603 div.style.overflow = "visible";
604 604
605 this._prefixObjectCell(div); 605 this._prefixObjectCell(div);
606 606
607 var valueSpan = document.createElement("span"); 607 var valueSpan = createElement("span");
608 valueSpan.className = "value console-formatted-" + valueStyle; 608 valueSpan.className = "value console-formatted-" + valueStyle;
609 valueSpan.textContent = value; 609 valueSpan.textContent = value;
610 div.appendChild(valueSpan); 610 div.appendChild(valueSpan);
611 611
612 var idSpan = document.createElement("span"); 612 var idSpan = createElement("span");
613 idSpan.className = "console-formatted-id"; 613 idSpan.className = "console-formatted-id";
614 idSpan.textContent = " @" + this.snapshotNodeId; 614 idSpan.textContent = " @" + this.snapshotNodeId;
615 div.appendChild(idSpan); 615 div.appendChild(idSpan);
616 616
617 cell.appendChild(div); 617 cell.appendChild(div);
618 cell.classList.add("disclosure"); 618 cell.classList.add("disclosure");
619 if (this.depth) 619 if (this.depth)
620 cell.style.setProperty("padding-left", (this.depth * this.dataGrid.i ndentWidth) + "px"); 620 cell.style.setProperty("padding-left", (this.depth * this.dataGrid.i ndentWidth) + "px");
621 cell.heapSnapshotNode = this; 621 cell.heapSnapshotNode = this;
622 return cell; 622 return cell;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 nameClass = "console-formatted-null"; 803 nameClass = "console-formatted-null";
804 break; 804 break;
805 case "element": 805 case "element":
806 name = "[" + name + "]"; 806 name = "[" + name + "]";
807 break; 807 break;
808 } 808 }
809 809
810 if (this._cycledWithAncestorGridNode) 810 if (this._cycledWithAncestorGridNode)
811 div.className += " cycled-ancessor-node"; 811 div.className += " cycled-ancessor-node";
812 812
813 var nameSpan = document.createElement("span"); 813 var nameSpan = createElement("span");
814 nameSpan.className = nameClass; 814 nameSpan.className = nameClass;
815 nameSpan.textContent = name; 815 nameSpan.textContent = name;
816 div.appendChild(nameSpan); 816 div.appendChild(nameSpan);
817 817
818 var separatorSpan = document.createElement("span"); 818 var separatorSpan = createElement("span");
819 separatorSpan.className = "grayed"; 819 separatorSpan.className = "grayed";
820 separatorSpan.textContent = this._edgeNodeSeparator(); 820 separatorSpan.textContent = this._edgeNodeSeparator();
821 div.appendChild(separatorSpan); 821 div.appendChild(separatorSpan);
822 }, 822 },
823 823
824 /** 824 /**
825 * @return {string} 825 * @return {string}
826 */ 826 */
827 _edgeNodeSeparator: function() 827 _edgeNodeSeparator: function()
828 { 828 {
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
1501 /** 1501 /**
1502 * @return {number} 1502 * @return {number}
1503 */ 1503 */
1504 allocationNodeId: function() 1504 allocationNodeId: function()
1505 { 1505 {
1506 return this._allocationNode.id; 1506 return this._allocationNode.id;
1507 }, 1507 },
1508 1508
1509 __proto__: WebInspector.HeapSnapshotGridNode.prototype 1509 __proto__: WebInspector.HeapSnapshotGridNode.prototype
1510 } 1510 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/profiler/CanvasReplayStateView.js ('k') | Source/devtools/front_end/profiler/HeapSnapshotView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698