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

Side by Side Diff: Source/devtools/front_end/PlatformFontsSidebarPane.js

Issue 182113004: DevTools: Get rid of Element.prototype.enableStyleClass (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined Created 6 years, 9 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 * @param {?Array.<!CSSAgent.PlatformFontUsage>} platformFonts 84 * @param {?Array.<!CSSAgent.PlatformFontUsage>} platformFonts
85 */ 85 */
86 _refreshUI: function(node, cssFamilyName, platformFonts) 86 _refreshUI: function(node, cssFamilyName, platformFonts)
87 { 87 {
88 if (this._node !== node) 88 if (this._node !== node)
89 return; 89 return;
90 90
91 this._fontStatsSection.removeChildren(); 91 this._fontStatsSection.removeChildren();
92 92
93 var isEmptySection = !platformFonts || !platformFonts.length; 93 var isEmptySection = !platformFonts || !platformFonts.length;
94 this._sectionTitle.enableStyleClass("hidden", isEmptySection); 94 this._sectionTitle.classList.toggle("hidden", isEmptySection);
95 if (isEmptySection) 95 if (isEmptySection)
96 return; 96 return;
97 platformFonts.sort(function (a, b) { 97 platformFonts.sort(function (a, b) {
98 return b.glyphCount - a.glyphCount; 98 return b.glyphCount - a.glyphCount;
99 }); 99 });
100 for (var i = 0; i < platformFonts.length; ++i) { 100 for (var i = 0; i < platformFonts.length; ++i) {
101 var fontStatElement = this._fontStatsSection.createChild("div", "fon t-stats-item"); 101 var fontStatElement = this._fontStatsSection.createChild("div", "fon t-stats-item");
102 102
103 var fontNameElement = fontStatElement.createChild("span", "font-name "); 103 var fontNameElement = fontStatElement.createChild("span", "font-name ");
104 fontNameElement.textContent = platformFonts[i].familyName; 104 fontNameElement.textContent = platformFonts[i].familyName;
105 105
106 var fontDelimeterElement = fontStatElement.createChild("span", "deli meter"); 106 var fontDelimeterElement = fontStatElement.createChild("span", "deli meter");
107 fontDelimeterElement.textContent = "\u2014"; 107 fontDelimeterElement.textContent = "\u2014";
108 108
109 var fontUsageElement = fontStatElement.createChild("span", "font-usa ge"); 109 var fontUsageElement = fontStatElement.createChild("span", "font-usa ge");
110 var usage = platformFonts[i].glyphCount; 110 var usage = platformFonts[i].glyphCount;
111 fontUsageElement.textContent = usage === 1 ? WebInspector.UIString(" %d glyph", usage) : WebInspector.UIString("%d glyphs", usage); 111 fontUsageElement.textContent = usage === 1 ? WebInspector.UIString(" %d glyph", usage) : WebInspector.UIString("%d glyphs", usage);
112 } 112 }
113 }, 113 },
114 114
115 __proto__: WebInspector.SidebarPane.prototype 115 __proto__: WebInspector.SidebarPane.prototype
116 } 116 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/OverridesView.js ('k') | Source/devtools/front_end/ScriptFormatterEditorAction.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698