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

Side by Side Diff: Source/devtools/front_end/components/FlameChart.js

Issue 367093003: DevTools: More code reduce via using document.createElementWithClass and document.createChild. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 return Math.min(this._canvas.width, Math.max(0, value)); 822 return Math.min(this._canvas.width, Math.max(0, value));
823 }, 823 },
824 824
825 _levelToHeight: function(level) 825 _levelToHeight: function(level)
826 { 826 {
827 return this._baseHeight - level * this._barHeightDelta; 827 return this._baseHeight - level * this._barHeightDelta;
828 }, 828 },
829 829
830 _buildEntryInfo: function(entryInfo) 830 _buildEntryInfo: function(entryInfo)
831 { 831 {
832 var infoTable = document.createElement("table"); 832 var infoTable = document.createElementWithClass("table", "info-table");
833 infoTable.className = "info-table";
834 for (var i = 0; i < entryInfo.length; ++i) { 833 for (var i = 0; i < entryInfo.length; ++i) {
835 var row = infoTable.createChild("tr"); 834 var row = infoTable.createChild("tr");
836 var titleCell = row.createChild("td"); 835 row.createChild("td", "title").textContent = entryInfo[i].title;
837 titleCell.textContent = entryInfo[i].title; 836 row.createChild("td").textContent = entryInfo[i].text;
838 titleCell.className = "title";
839 var textCell = row.createChild("td");
840 textCell.textContent = entryInfo[i].text;
841 } 837 }
842 return infoTable; 838 return infoTable;
843 }, 839 },
844 840
845 /** 841 /**
846 * @param {!CanvasRenderingContext2D} context 842 * @param {!CanvasRenderingContext2D} context
847 * @param {string} title 843 * @param {string} title
848 * @param {number} maxSize 844 * @param {number} maxSize
849 * @return {string} 845 * @return {string}
850 */ 846 */
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 reset: function() 954 reset: function()
959 { 955 {
960 this._highlightedEntryIndex = -1; 956 this._highlightedEntryIndex = -1;
961 this._selectedEntryIndex = -1; 957 this._selectedEntryIndex = -1;
962 this._textWidth = {}; 958 this._textWidth = {};
963 this.update(); 959 this.update();
964 }, 960 },
965 961
966 __proto__: WebInspector.HBox.prototype 962 __proto__: WebInspector.HBox.prototype
967 } 963 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/common/DOMExtension.js ('k') | Source/devtools/front_end/console/ConsoleView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698