diff --git a/mozilla/themes/classic/global/mac/browser.css b/mozilla/themes/classic/global/mac/browser.css index b0cba41f737..940c10c2686 100644 --- a/mozilla/themes/classic/global/mac/browser.css +++ b/mozilla/themes/classic/global/mac/browser.css @@ -54,3 +54,7 @@ tab[busy] { margin: 0px; list-style-image: url("chrome://global/skin/icons/tab-new.gif"); } + +tooltip[tabpreview="true"] { + max-width: none; +} diff --git a/mozilla/themes/classic/global/win/browser.css b/mozilla/themes/classic/global/win/browser.css index 43a93afbd77..77c2ea29046 100644 --- a/mozilla/themes/classic/global/win/browser.css +++ b/mozilla/themes/classic/global/win/browser.css @@ -65,3 +65,7 @@ tab[busy] { position: relative; list-style-image: url('chrome://global/skin/icons/tab-drag-indicator.gif'); } + +tooltip[tabpreview="true"] { + max-width: none; +} diff --git a/mozilla/xpfe/global/resources/content/bindings/tabbrowser.xml b/mozilla/xpfe/global/resources/content/bindings/tabbrowser.xml index dd74dd57d4d..d1677a4881c 100644 --- a/mozilla/xpfe/global/resources/content/bindings/tabbrowser.xml +++ b/mozilla/xpfe/global/resources/content/bindings/tabbrowser.xml @@ -214,6 +214,7 @@ if (!this.mPrefs.getBoolPref("browser.tabs.tooltippreview.enable")) { label.removeAttribute("width"); + aPopup.removeAttribute("tabpreview"); return true; } @@ -225,6 +226,7 @@ } label.width = 0; + aPopup.setAttribute("tabpreview", "true"); var win = b.contentWindow; var w = win.innerWidth; var h = win.innerHeight; @@ -243,7 +245,10 @@ ctx.fillRect(0, 0, canvasW, canvasH); var img = b.contentDocument.body.firstChild; var ratio = img.naturalHeight / img.naturalWidth; - if (ratio * canvasW > canvasH) { + if (img.naturalHeight <= canvasH && img.naturalWidth <= canvasW) { + ctx.drawImage(img, 0, 0, img.naturalWidth, img.naturalHeight); + } + else if (ratio * canvasW > canvasH) { ctx.drawImage(img, 0, 0, canvasH / ratio, canvasH); } else {