From 2c26efd81bbdef8631cce3d64334e12be0b79bcc Mon Sep 17 00:00:00 2001 From: piro Date: Mon, 10 Mar 2008 07:21:32 +0000 Subject: [PATCH] =?UTF-8?q?Firefox=203=E3=81=A7=E3=81=AE=E3=82=BF=E3=83=96?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=81=AE=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@2053 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletab.css | 6 ++---- content/treestyletab/treestyletabbrowser.js | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/content/treestyletab/treestyletab.css b/content/treestyletab/treestyletab.css index 90dcda4f..3c34fe9b 100644 --- a/content/treestyletab/treestyletab.css +++ b/content/treestyletab/treestyletab.css @@ -105,11 +105,9 @@ tabbrowser[treestyletab-mode="multirow"] .tabbrowser-tab { } */ -tabbrowser[treestyletab-tabbar-autohide]:not([treestyletab-tabbar-transparent]) .tabs-stack > *:first-child > :not(html|canvas) { - display: none !important; -} +tabbrowser[treestyletab-tabbar-autohide]:not([treestyletab-tabbar-transparent]) .tabs-stack > *:first-child > :not(html|canvas), tabbrowser[treestyletab-tabbar-resizing] .tabs-stack > *:first-child > html|canvas { - visibility: hidden !important; + display: none !important; } diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 5960a0ab..eac12189 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -400,7 +400,7 @@ TreeStyleTabBrowser.prototype = { var stack = document.getAnonymousElementByAttribute(b.mTabContainer, 'class', 'tabs-stack'); if (stack) { var canvas = document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas'); - canvas.setAttribute('style', 'visibility:collapse;width:0;height:0;'); + canvas.setAttribute('style', 'display:none;width:1;height:1;'); stack.firstChild.appendChild(canvas); this.tabbarCanvas = canvas; this.clearTabbarCanvas(); @@ -2807,13 +2807,14 @@ TreeStyleTabBrowser.prototype = { var yOffset = (pos == 'left' || pos == 'right') ? contentBox.screenY + frame.scrollY - browserBox.screenY : 0 ; - var w = tabContainerBox.width - xOffset; - var h = tabContainerBox.height - yOffset; + // zero width (heigh) canvas becomes wrongly size!! + var w = Math.max(1, (tabContainerBox.width - xOffset)); + var h = Math.max(1, (tabContainerBox.height - yOffset)); + this.tabbarCanvas.style.display = 'inline'; this.tabbarCanvas.style.margin = (yOffset || 0)+'px 0 0 '+(xOffset || 0)+'px'; this.tabbarCanvas.style.width = (this.tabbarCanvas.width = w)+'px'; this.tabbarCanvas.style.height = (this.tabbarCanvas.height = h)+'px'; - this.tabbarCanvas.style.visibility = 'visible'; var ctx = this.tabbarCanvas.getContext('2d'); ctx.clearRect(0, 0, w, h); ctx.save(); @@ -2825,12 +2826,11 @@ TreeStyleTabBrowser.prototype = { { if (!this.tabbarCanvas) return; - this.tabbarCanvas.style.margin = - this.tabbarCanvas.style.width = - this.tabbarCanvas.style.height = - this.tabbarCanvas.width = - this.tabbarCanvas.height = 0; - this.tabbarCanvas.style.visibility = 'collapse'; + this.tabbarCanvas.style.display = 'none'; + this.tabbarCanvas.style.margin = 0; + // zero width (heigh) canvas becomes wrongly size!! + this.tabbarCanvas.style.width = this.tabbarCanvas.style.height = '1px'; + this.tabbarCanvas.width = this.tabbarCanvas.height = 1; }, updateTabbarTransparency : function()