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

Unified Diff: Source/devtools/front_end/PlatformFontsSidebarPane.js

Issue 59993003: DevTools: add title to computed fonts section (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix borders glitch Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/PlatformFontsSidebarPane.js
diff --git a/Source/devtools/front_end/PlatformFontsSidebarPane.js b/Source/devtools/front_end/PlatformFontsSidebarPane.js
index 6ec7a5c35beae4cdfb8e33939381333c85279af8..214b76baf03e8322ceabc246e306a021f0407fd6 100644
--- a/Source/devtools/front_end/PlatformFontsSidebarPane.js
+++ b/Source/devtools/front_end/PlatformFontsSidebarPane.js
@@ -40,13 +40,11 @@ WebInspector.PlatformFontsSidebarPane = function()
WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrRemoved, this._onNodeChange.bind(this));
WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.CharacterDataModified, this._onNodeChange.bind(this));
- var cssFontSection = this.element.createChild("div", "stats-section monospace");
- var cssFontPrefix = cssFontSection.createChild("span", "webkit-css-property");
- cssFontPrefix.textContent = "font-family";
- cssFontSection.createTextChild(":");
- this._cssFontValue = cssFontSection.createChild("span", "css-font-value");
-
- this._fontStatsSection = this.element.createChild("div", "stats-section");
+ this._sectionTitle = document.createElement("div");
vsevik 2013/11/05 17:30:18 consider document.createElementwithClass
+ this._sectionTitle.className = "sidebar-separator";
+ this.element.insertBefore(this._sectionTitle, this.bodyElement);
+ this._sectionTitle.textContent = WebInspector.UIString("Rendered Fonts");
+ this._fontStatsSection = this.bodyElement.createChild("div", "stats-section");
}
WebInspector.PlatformFontsSidebarPane.prototype = {
@@ -89,10 +87,12 @@ WebInspector.PlatformFontsSidebarPane.prototype = {
{
if (this._node !== node)
return;
- this._cssFontValue.textContent = cssFamilyName + ";";
+
this._fontStatsSection.removeChildren();
- if (!platformFonts || !platformFonts.length)
+ var isEmptySection = !platformFonts || !platformFonts.length;
+ this._sectionTitle.enableStyleClass("hidden", isEmptySection);
+ if (isEmptySection)
return;
platformFonts.sort(function (a, b) {
return b.glyphCount - a.glyphCount;
« no previous file with comments | « no previous file | Source/devtools/front_end/elementsPanel.css » ('j') | Source/devtools/front_end/elementsPanel.css » ('J')

Powered by Google App Engine
This is Rietveld 408576698