diff options
Diffstat (limited to 'WebCore/inspector/front-end/FontView.js')
-rw-r--r-- | WebCore/inspector/front-end/FontView.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/WebCore/inspector/front-end/FontView.js b/WebCore/inspector/front-end/FontView.js index 78a7e70..82559ef 100644 --- a/WebCore/inspector/front-end/FontView.js +++ b/WebCore/inspector/front-end/FontView.js @@ -34,12 +34,12 @@ WebInspector.FontView = function(resource) } WebInspector.FontView.prototype = { - hasContentTab: function() + hasContent: function() { return true; }, - contentTabSelected: function() + _createContentIfNeeded: function() { if (this.fontPreviewElement) return; @@ -51,7 +51,7 @@ WebInspector.FontView.prototype = { document.head.appendChild(this.fontStyleElement); this.fontPreviewElement = document.createElement("div"); - this.contentElement.appendChild(this.fontPreviewElement); + this.element.appendChild(this.fontPreviewElement); this.fontPreviewElement.style.setProperty("font-family", uniqueFontName, null); this.fontPreviewElement.innerHTML = "ABCDEFGHIJKLM<br>NOPQRSTUVWXYZ<br>abcdefghijklm<br>nopqrstuvwxyz<br>1234567890"; @@ -63,6 +63,7 @@ WebInspector.FontView.prototype = { show: function(parentElement) { WebInspector.ResourceView.prototype.show.call(this, parentElement); + this._createContentIfNeeded(); this.updateFontPreviewSize(); }, @@ -86,7 +87,7 @@ WebInspector.FontView.prototype = { const width = this.fontPreviewElement.offsetWidth; // Subtract some padding. This should match the padding in the CSS plus room for the scrollbar. - const containerWidth = this.contentElement.offsetWidth - 50; + const containerWidth = this.element.offsetWidth - 50; if (!height || !width || !containerWidth) { this.fontPreviewElement.style.removeProperty("font-size"); |