OLD | NEW |
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 24 matching lines...) Expand all Loading... |
35 */ | 35 */ |
36 WebInspector.PlatformFontsWidget = function(sharedModel) | 36 WebInspector.PlatformFontsWidget = function(sharedModel) |
37 { | 37 { |
38 WebInspector.ThrottledView.call(this, WebInspector.UIString("Fonts"), true); | 38 WebInspector.ThrottledView.call(this, WebInspector.UIString("Fonts"), true); |
39 this.registerRequiredCSS("elements/platformFontsWidget.css"); | 39 this.registerRequiredCSS("elements/platformFontsWidget.css"); |
40 | 40 |
41 this._sharedModel = sharedModel; | 41 this._sharedModel = sharedModel; |
42 this._sharedModel.addEventListener(WebInspector.ComputedStyleModel.Events.Co
mputedStyleChanged, this.update, this); | 42 this._sharedModel.addEventListener(WebInspector.ComputedStyleModel.Events.Co
mputedStyleChanged, this.update, this); |
43 | 43 |
44 this._sectionTitle = createElementWithClass("div", "title"); | 44 this._sectionTitle = createElementWithClass("div", "title"); |
| 45 this.contentElement.classList.add("platform-fonts"); |
45 this.contentElement.appendChild(this._sectionTitle); | 46 this.contentElement.appendChild(this._sectionTitle); |
46 this._sectionTitle.textContent = WebInspector.UIString("Rendered Fonts"); | 47 this._sectionTitle.textContent = WebInspector.UIString("Rendered Fonts"); |
47 this._fontStatsSection = this.contentElement.createChild("div", "stats-secti
on"); | 48 this._fontStatsSection = this.contentElement.createChild("div", "stats-secti
on"); |
48 } | 49 } |
49 | 50 |
50 WebInspector.PlatformFontsWidget.prototype = { | 51 WebInspector.PlatformFontsWidget.prototype = { |
51 /** | 52 /** |
52 * @override | 53 * @override |
53 * @protected | 54 * @protected |
54 * @return {!Promise.<?>} | 55 * @return {!Promise.<?>} |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 fontOrigin.textContent = platformFonts[i].isCustomFont ? WebInspecto
r.UIString("Network resource") : WebInspector.UIString("Local file"); | 97 fontOrigin.textContent = platformFonts[i].isCustomFont ? WebInspecto
r.UIString("Network resource") : WebInspector.UIString("Local file"); |
97 | 98 |
98 var fontUsageElement = fontStatElement.createChild("span", "font-usa
ge"); | 99 var fontUsageElement = fontStatElement.createChild("span", "font-usa
ge"); |
99 var usage = platformFonts[i].glyphCount; | 100 var usage = platformFonts[i].glyphCount; |
100 fontUsageElement.textContent = usage === 1 ? WebInspector.UIString("
(%d glyph)", usage) : WebInspector.UIString("(%d glyphs)", usage); | 101 fontUsageElement.textContent = usage === 1 ? WebInspector.UIString("
(%d glyph)", usage) : WebInspector.UIString("(%d glyphs)", usage); |
101 } | 102 } |
102 }, | 103 }, |
103 | 104 |
104 __proto__: WebInspector.ThrottledView.prototype | 105 __proto__: WebInspector.ThrottledView.prototype |
105 } | 106 } |
OLD | NEW |