[Pkg-mozext-commits] [SCM] Show tabs like a tree branch, master, updated. debian/0.12.2011061701-1-22-g03181ea

Ximin Luo infinity0 at gmx.com
Tue Jun 5 19:21:03 UTC 2012


The following commit has been merged in the master branch:
commit 2f10c4b1cd442663a36aa635546c0a3f7d87adee
Author: Ximin Luo <infinity0 at gmx.com>
Date:   Sun Jun 3 00:09:18 2012 +0100

    Imported Upstream version 0.14.2012050301

diff --git a/chrome.manifest b/chrome.manifest
index f5bf343..b80e36d 100644
--- a/chrome.manifest
+++ b/chrome.manifest
@@ -48,7 +48,7 @@ override chrome://treestyletab/skin/metal/platform.css	chrome://treestyletab/ski
 override chrome://treestyletab/skin/metal/platform.css	chrome://treestyletab/skin/dummy.css	os=WINNT
 override chrome://treestyletab/skin/metal/platform.css	chrome://treestyletab/skin/dummy.css	os=Linux
 override chrome://treestyletab/skin/metal/tab.css	chrome://treestyletab/skin/metal/tab-legacy.css
-override chrome://treestyletab/skin/metal/tab.css	chrome://treestyletab/skin/metal/tab-base.css	appversion>=12.0a1
+override chrome://treestyletab/skin/metal/tab.css	chrome://treestyletab/skin/metal/tab-base.css	appversion>=13.0a1
 
 override chrome://treestyletab/skin/sidebar/sidebar.css	chrome://treestyletab/skin/sidebar/sidebar-legacy.css
 override chrome://treestyletab/skin/sidebar/sidebar.css	chrome://treestyletab/skin/sidebar/sidebar-base.css	appversion>=12.0a1
diff --git a/chrome/treestyletab.jar!/content/treestyletab/treestyletab-tmp.css b/chrome/treestyletab.jar!/content/treestyletab/treestyletab-tmp.css
index 34ab501..a03f503 100755
--- a/chrome/treestyletab.jar!/content/treestyletab/treestyletab-tmp.css
+++ b/chrome/treestyletab.jar!/content/treestyletab/treestyletab-tmp.css
@@ -21,6 +21,7 @@
 
 :root[treestyletab-enable-compatibility-tmp="true"]
   tabbrowser[treestyletab-mode="vertical"] tabs[flowing] > * .tabs-frame {
+	box-flex: 1 !important;
 	-moz-box-flex: 1 !important;
 }
 
diff --git a/chrome/treestyletab.jar!/content/treestyletab/treestyletab.css b/chrome/treestyletab.jar!/content/treestyletab/treestyletab.css
index a0d3351..65fbbcb 100755
--- a/chrome/treestyletab.jar!/content/treestyletab/treestyletab.css
+++ b/chrome/treestyletab.jar!/content/treestyletab/treestyletab.css
@@ -60,6 +60,7 @@
 	max-width: 20px;
 	min-width: 20px;
 	width: 20px;
+	box-flex: 0;
 	-moz-box-flex: 0;
 	mask: url("res/tabEffects.svg#fadein-mask");
 }
@@ -136,6 +137,8 @@ tabbrowser[treestyletab-tabbar-autohide-mode="1"][treestyletab-tabbar-autohide="
 
 
 #treestyletab-autohide-content-area-screen {
+	appearance: none;
+	-moz-appearance: none;
 	/**
 	 * Don't make this panel completely transparent, because
 	 * mousemove event never fire on 100% transparent panel.
@@ -144,7 +147,6 @@ tabbrowser[treestyletab-tabbar-autohide-mode="1"][treestyletab-tabbar-autohide="
 	line-height: 0;
 	margin: 0;
 	padding: 0;
-	-moz-appearance: none;
 	-moz-border-bottom-colors: none;
 	-moz-border-left-colors: none;
 	-moz-border-right-colors: none;
@@ -163,7 +165,9 @@ tabbrowser[treestyletab-tabbar-autohide-mode="1"][treestyletab-tabbar-autohide="
 .tabbrowser-tabs[treestyletab-mode="vertical"]
   .tabbrowser-arrowscrollbox
   .scrollbox-innerbox {
+	box-flex: 1 !important;
 	-moz-box-flex: 1 !important;
+	box-pack: start !important;
 	-moz-box-pack: start !important;
 }
 
@@ -177,6 +181,7 @@ toolbar.treestyletab-tabbar-toolbar[treestyletab-mode="vertical"]
   > toolbaritem,
 toolbar.treestyletab-tabbar-toolbar[treestyletab-mode="vertical"]
   > .treestyletab-toolbar-inner-box > toolbaritem {
+	box-flex: 0 !important;
 	-moz-box-flex: 0 !important;
 }
 
@@ -187,6 +192,7 @@ toolbar.treestyletab-tabbar-toolbar[treestyletab-mode="vertical"]
 
 /* workaround for https://github.com/piroor/treestyletab/issues/100 */
 .treestyletab-tabbar-toolbar[treestyletab-mode="vertical"] .textbox-input-box {
+	box-align: stretch;
 	-moz-box-align: stretch;
 }
 
@@ -344,9 +350,10 @@ toolbar.treestyletab-tabbar-toolbar-ready:not([nowindowdrag="true"]),
 
 .treestyletab-tabbar-toolbar:not([treestyletab-tabbar-position="top"]),
 .treestyletab-tabbar-toolbar[treestyletab-tabbar-position="top"]:not([treestyletab-tabbar-fixed="true"]) {
+	appearance: none !important;
+	-moz-appearance: none !important;
 	line-height: 0 !important; /* to avoid an useless space above the tab bar */
 	position: fixed !important;
-	-moz-appearance: none !important;
 }
 .treestyletab-tabbar-toolbar:not([treestyletab-tabbar-position="top"])
   .tabbrowser-tabs,
@@ -549,3 +556,7 @@ image.tab-icon {
 	display: none;
 }
 
+/* Hide Caption Titlebar Plus */
+:root[treestyletab-tabbar-position="top"] #menubar-items[dz_home_mainmenu_floating="true"] {
+	z-index: 650000;
+}
diff --git a/chrome/treestyletab.jar!/content/treestyletab/windowHelper.js b/chrome/treestyletab.jar!/content/treestyletab/windowHelper.js
index a19f8ac..c180d23 100755
--- a/chrome/treestyletab.jar!/content/treestyletab/windowHelper.js
+++ b/chrome/treestyletab.jar!/content/treestyletab/windowHelper.js
@@ -36,8 +36,10 @@ var TreeStyleTabWindowHelper = {
 		if ('BrowserOpenTab' in window) {
 			eval('window.BrowserOpenTab = '+
 				window.BrowserOpenTab.toSource().replace(
-					'gBrowser.loadOneTab(',
-					'gBrowser.treeStyleTab.onBeforeNewTabCommand(); $&'
+					// loadOneTab => Firefox 10 or olders
+					// openUILinkIn => Firefox 11 or later
+					/(gBrowser\.loadOneTab\(|openUILinkIn\(.+\,\s*"tab"\))/,
+					'gBrowser.treeStyleTab.onBeforeNewTabCommand(); $1'
 				)
 			);
 		}
diff --git a/chrome/treestyletab.jar!/locale/ru/treestyletab/treestyletab.dtd b/chrome/treestyletab.jar!/locale/ru/treestyletab/treestyletab.dtd
index 2c2c523..88876a9 100755
--- a/chrome/treestyletab.jar!/locale/ru/treestyletab/treestyletab.dtd
+++ b/chrome/treestyletab.jar!/locale/ru/treestyletab/treestyletab.dtd
@@ -113,7 +113,7 @@
 <!ENTITY config.autoHide.area.after "пикселов от края окна или панели вкладок">
 <!ENTITY config.autoHide.delay.before "Задержка:">
 <!ENTITY config.autoHide.delay.after "мсек.">
-<!ENTITY config.autoShow.accelKeyDown "Нажатии и удержания кнопки Ctrl">
+<!ENTITY config.autoShow.accelKeyDown "При удерживании клавиши Ctrl">
 <!ENTITY config.autoShow.accelKeyDown.delay.before "Показывать после">
 <!ENTITY config.autoShow.accelKeyDown.delay.after  "мсек.">
 <!ENTITY config.autoShow.tabSwitch   "Переключении вкладок через Ctrl+Tab">
diff --git a/chrome/treestyletab.jar!/skin/classic/treestyletab/Linux-base.css b/chrome/treestyletab.jar!/skin/classic/treestyletab/Linux-base.css
index 9ba7b10..108e075 100755
--- a/chrome/treestyletab.jar!/skin/classic/treestyletab/Linux-base.css
+++ b/chrome/treestyletab.jar!/skin/classic/treestyletab/Linux-base.css
@@ -2,8 +2,9 @@
 
 /* splitter for floating & autohide tab bar */
 .treestyletab-tabbar-toolbar .treestyletab-splitter {
-	width: 6px;
+	appearance: none;
 	-moz-appearance: none;
+	width: 6px;
 }
 
 #treestyletab-autohide-content-area-screen {
diff --git a/chrome/treestyletab.jar!/skin/classic/treestyletab/Linux-styled.css b/chrome/treestyletab.jar!/skin/classic/treestyletab/Linux-styled.css
index c4b89f8..57eb5b9 100755
--- a/chrome/treestyletab.jar!/skin/classic/treestyletab/Linux-styled.css
+++ b/chrome/treestyletab.jar!/skin/classic/treestyletab/Linux-styled.css
@@ -7,9 +7,10 @@
   .tabbrowser-tab:not([selected="true"]),
 .tabbrowser-tabs[treestyletab-tabbar-position="top"][treestyletab-tabs-indented="true"]
   .tabbrowser-tab[selected="true"] {
-	padding-top: 0;
-	padding-bottom: 0;
-	margin-bottom: 0;
-	height: 1.5em;
+	border-radius: 0 0 0 0;
 	-moz-border-radius: 0 0 0 0;
+	height: 1.5em;
+	margin-bottom: 0;
+	padding-bottom: 0;
+	padding-top: 0;
 }
diff --git a/chrome/treestyletab.jar!/skin/classic/treestyletab/WINNT-styled.css b/chrome/treestyletab.jar!/skin/classic/treestyletab/WINNT-styled.css
index 690fed2..9328c47 100755
--- a/chrome/treestyletab.jar!/skin/classic/treestyletab/WINNT-styled.css
+++ b/chrome/treestyletab.jar!/skin/classic/treestyletab/WINNT-styled.css
@@ -8,11 +8,12 @@
   .tabbrowser-tab:hover:not([selected="true"]),
 .tabbrowser-tabs[treestyletab-tabbar-position="top"][treestyletab-tabs-indented="true"]
   .tabbrowser-tab:hover[selected="true"] {
-	padding-top: 0;
-	padding-bottom: 0;
-	margin-bottom: 3px;
-	height: auto;
+	border-radius: 0 0 0 0;
 	-moz-border-radius: 0 0 0 0;
 	border-top-width: 1px;
+	height: auto;
+	margin-bottom: 3px;
+	padding-bottom: 0;
+	padding-top: 0;
 }
 
diff --git a/chrome/treestyletab.jar!/skin/classic/treestyletab/base.css b/chrome/treestyletab.jar!/skin/classic/treestyletab/base.css
index 1cc2568..4b2648a 100755
--- a/chrome/treestyletab.jar!/skin/classic/treestyletab/base.css
+++ b/chrome/treestyletab.jar!/skin/classic/treestyletab/base.css
@@ -6,15 +6,17 @@
 .tabbrowser-tabs[treestyletab-mode="vertical"] .tabs-newtab-button,
 .treestyletab-tabbar-toolbar[treestyletab-mode="vertical"] > toolbarbutton,
 .treestyletab-tabbar-toolbar[treestyletab-mode="vertical"] > toolbarpaletteitem > toolbarbutton {
+	appearance: none !important;
 	-moz-appearance: none !important;
 	border: 0 none !important;
 	-moz-border-top-colors: none !important;
 	-moz-border-right-colors: none !important;
 	-moz-border-bottom-colors: none !important;
 	-moz-border-left-colors: none !important;
+	border-radius: 0;
 	-moz-border-radius: 0;
 	border-top: 1px solid ThreeDShadow !important;
-	background: ThreeDFace !important;
+	background: -moz-dialog !important;
 }
 .tabbrowser-tabs[treestyletab-mode="vertical"] .tabs-newtab-button:hover,
 .treestyletab-tabbar-toolbar[treestyletab-mode="vertical"] > toolbarbutton:hover {
@@ -37,6 +39,7 @@
 
 /* Support customizable tab bar */
 .treestyletab-tabbar-toolbar[treestyletab-mode="vertical"] > toolbarpaletteitem > toolbarbutton {
+	box-flex: 1;
 	-moz-box-flex: 1;
 }
 .treestyletab-tabbar-toolbar[treestyletab-mode="vertical"] > *:not(toolbarpaletteitem) {
@@ -69,6 +72,7 @@
   .tabbrowser-arrowscrollbox .tabs-newtab-button {
 	border: 0 none !important;
 	border-bottom: 1px solid ThreeDShadow !important;
+	border-radius: 0 0 3px 3px;
 	-moz-border-radius: 0 0 3px 3px;
 }
 .tabbrowser-tabs[treestyletab-style~="vertigo"][treestyletab-mode="vertical"]
diff --git a/chrome/treestyletab.jar!/skin/classic/treestyletab/config.css b/chrome/treestyletab.jar!/skin/classic/treestyletab/config.css
index 859d7ac..b954604 100755
--- a/chrome/treestyletab.jar!/skin/classic/treestyletab/config.css
+++ b/chrome/treestyletab.jar!/skin/classic/treestyletab/config.css
@@ -2,6 +2,7 @@
 
 radio.image .radio-label-box,
 radio.image label.radio-label {
+	box-align: center;
 	-moz-box-align: center;
 }
 
diff --git a/chrome/treestyletab.jar!/skin/classic/treestyletab/group/group.css b/chrome/treestyletab.jar!/skin/classic/treestyletab/group/group.css
index 332d3df..3da25f6 100755
--- a/chrome/treestyletab.jar!/skin/classic/treestyletab/group/group.css
+++ b/chrome/treestyletab.jar!/skin/classic/treestyletab/group/group.css
@@ -1,6 +1,7 @@
 :root {
-	background: -moz-dialog;
+	appearance: window;
 	-moz-appearance: window;
+	background: -moz-dialog;
 	margin: 0;
 	padding: 0;
 }
@@ -64,6 +65,7 @@
 	margin-top: 1em;
 	max-height: 80%;
 	overflow: auto;
+	box-flex: 1;
 	-moz-box-flex: 1;
 }
 
diff --git a/chrome/treestyletab.jar!/skin/classic/treestyletab/metal/aero.css b/chrome/treestyletab.jar!/skin/classic/treestyletab/metal/aero.css
index 6ec1a8c..b364a48 100755
--- a/chrome/treestyletab.jar!/skin/classic/treestyletab/metal/aero.css
+++ b/chrome/treestyletab.jar!/skin/classic/treestyletab/metal/aero.css
@@ -5,6 +5,7 @@
 tabbrowser[treestyletab-style~="aero"]:not([treestyletab-tabbar-position="top"]),
 :root[treestyletab-style~="aero"]:not([treestyletab-tabbar-position="top"]) #appcontent,
 :root[treestyletab-style~="aero"]:not([treestyletab-tabbar-position="top"]) #browser {
-	background: transparent !important;
+	appearance: none !important;
 	-moz-appearance: none !important;
+	background: transparent !important;
 }
diff --git a/chrome/treestyletab.jar!/skin/classic/treestyletab/metal/base.css b/chrome/treestyletab.jar!/skin/classic/treestyletab/metal/base.css
index b9dc83f..ae062b7 100755
--- a/chrome/treestyletab.jar!/skin/classic/treestyletab/metal/base.css
+++ b/chrome/treestyletab.jar!/skin/classic/treestyletab/metal/base.css
@@ -4,13 +4,14 @@
 
 .treestyletab-tabbar-toolbar:not([treestyletab-tabbar-position="top"]),
 .treestyletab-tabbar-toolbar[treestyletab-tabbar-position="top"]:not([treestyletab-tabbar-fixed="true"]) {
+	appearance: none !important;
+	-moz-appearance: none !important;
 	background: transparent !important;
 	border: 0 none !important;
+	box-shadow: none !important;
+	-moz-box-shadow: none !important;
 	margin: 0 !important;
 	padding: 0 !important;
-	-moz-appearance: none !important;
-	-moz-box-shadow: none !important;
-	box-shadow: none !important;
 }
 
 .tabbrowser-tabs:not([treestyletab-tabbar-position="top"])
@@ -41,9 +42,10 @@
 }
 
 .tabbrowser-tabs[treestyletab-mode="vertical"] {
+	appearance: none !important;
+	-moz-appearance: none !important;
 	background: transparent !important;
 	margin: 0;
-	-moz-appearance: none !important;
 }
 
 .tabbrowser-tabs[treestyletab-mode="vertical"]:not([overflow="true"])
@@ -70,10 +72,11 @@ tabbrowser[treestyletab-mode="vertical"]
   .treestyletab-splitter,
 .treestyletab-tabbar-toolbar[treestyletab-mode="vertical"]
   .treestyletab-splitter {
+	appearance: none !important;
+	-moz-appearance: none !important;
 	background: #b3b2b3 !important;
 	border: 0 solid #666666 !important;
 	min-width: 5px;
-	-moz-appearance: none !important;
 }
 tabbrowser[treestyletab-tabbar-position="left"]
   .treestyletab-splitter,
@@ -268,6 +271,7 @@ tabbrowser[treestyletab-tabbar-position="right"]
   .tabs-newtab-button {
 	background: #9a9a9a url("shadow-active-l.png") repeat-y top right !important;
 	margin-left: 6px !important;
+	border-radius: 6px 0 0 6px;
 	-moz-border-radius: 6px 0 0 6px;
 }
 .tabbrowser-tabs[treestyletab-mode="vertical"][treestyletab-tab-inverted="true"]
diff --git a/chrome/treestyletab.jar!/skin/classic/treestyletab/metal/tab-base.css b/chrome/treestyletab.jar!/skin/classic/treestyletab/metal/tab-base.css
index 7e8f14c..34e95a0 100755
--- a/chrome/treestyletab.jar!/skin/classic/treestyletab/metal/tab-base.css
+++ b/chrome/treestyletab.jar!/skin/classic/treestyletab/metal/tab-base.css
@@ -8,7 +8,11 @@
   .tabbrowser-tab[selected="true"],
 .tabbrowser-tabs[treestyletab-mode="vertical"]
   .tabbrowser-tab[selected="true"]:hover {
+	appearance: none !important;
+	-moz-appearance: none !important;
 	border: 2px solid transparent !important;
+	border-radius: 0 !important;
+	-moz-border-radius: 0 !important;
 	color: black !important;
 	height: auto !important;
 	max-height: none !important;
@@ -18,12 +22,10 @@
 	margin-bottom: -2px !important;
 	margin-left: 0;
 	padding: 0 !important;
-	-moz-appearance: none !important;
 	-moz-border-top-colors: transparent transparent !important;
 	-moz-border-right-colors: transparent transparent !important;
 	-moz-border-bottom-colors: transparent transparent !important;
 	-moz-border-left-colors: transparent transparent !important;
-	-moz-border-radius: 0 !important;
 }
 .tabbrowser-tabs[treestyletab-mode="vertical"]
   :-moz-any(.tabbrowser-tab:not([pinned]),
@@ -74,10 +76,11 @@
 }
 .tabbrowser-tabs[treestyletab-mode="vertical"]
   .tab-content {
+	appearance: none !important;
+	-moz-appearance: none !important;
 	border: 10px solid transparent;
 	margin: 0 !important;
 	padding: 2px 5px 2px 10px;
-	-moz-appearance: none !important;
 }
 .tabbrowser-tabs[treestyletab-mode="vertical"][treestyletab-tab-inverted="true"]
   .tab-content {
@@ -100,6 +103,7 @@
 
 /* background, left */
 .tabbrowser-tabs[treestyletab-mode="vertical"]
+  .tabbrowser-tab:not([pinned])
   .tab-stack {
 	-moz-border-image: url("tab-active-l.png") 10 5 10 10 / 10px 5px 10px 10px !important;
 	/**
@@ -113,6 +117,7 @@
 
 /* background, right */
 .tabbrowser-tabs[treestyletab-mode="vertical"][treestyletab-tab-inverted="true"]
+  .tabbrowser-tab:not([pinned])
   .tab-stack {
 	-moz-border-image: url("tab-active-r.png") 10 10 10 5 / 10px 10px 10px 5px !important;
 	-moz-border-image-slice: 10 10 10 5 fill !important;
@@ -120,14 +125,16 @@
 
 /* foreground, left */
 .tabbrowser-tabs[treestyletab-mode="vertical"]
-  .tabbrowser-tab[selected="true"] .tab-stack {
+  .tabbrowser-tab[selected="true"]:not([pinned])
+  .tab-stack {
 	-moz-border-image: url("tab-active-selected-l.png") 10 5 10 10 / 10px 5px 10px 10px !important;
 	-moz-border-image-slice: 10 5 10 10 fill !important;
 }
 
 /* foreground, right */
 .tabbrowser-tabs[treestyletab-mode="vertical"][treestyletab-tab-inverted="true"]
-  .tabbrowser-tab[selected="true"] .tab-stack {
+  .tabbrowser-tab[selected="true"]:not([pinned])
+  .tab-stack {
 	-moz-border-image: url("tab-active-selected-r.png") 10 10 10 5 / 10px 10px 10px 5px !important;
 	-moz-border-image-slice: 10 10 10 5 fill !important;
 }
@@ -175,8 +182,9 @@
 .tabbrowser-tabs[treestyletab-mode="vertical"]
   .tabbrowser-tab[pinned][selected="true"]:hover {
 	border: none !important;
-	padding: 0 !important;
+	border-radius: 0 !important;
 	-moz-border-radius: 0 !important;
+	padding: 0 !important;
 }
 .tabbrowser-tabs[treestyletab-mode="vertical"]
   .tabbrowser-tab[pinned]:not([titlechanged]):not(:hover),
@@ -211,9 +219,10 @@
   .tab-content[pinned][selected="true"] {
 	line-height: 1 !important;
 	border: 1px solid #666666 !important;
+	border-radius: 4px !important;
+	-moz-border-radius: 4px !important;
 	margin: 1px 0 0 1px !important;
 	padding: 2px 4px 2px 3px !important;
-	-moz-border-radius: 4px !important;
 }
 .tabbrowser-tabs[treestyletab-mode="vertical"]
   .tabbrowser-tab:not(:hover)
@@ -247,6 +256,7 @@
 /* background, left */
 :root:-moz-window-inactive
   .tabbrowser-tabs[treestyletab-mode="vertical"]
+  .tabbrowser-tab:not([pinned])
   .tab-stack {
 	-moz-border-image: url("tab-inactive-l.png") 10 5 10 10 / 10px 5px 10px 10px !important;
 	-moz-border-image-slice: 10 5 10 10 fill !important;
@@ -255,6 +265,7 @@
 /* background, right */
 :root:-moz-window-inactive
   .tabbrowser-tabs[treestyletab-mode="vertical"][treestyletab-tab-inverted="true"]
+  .tabbrowser-tab:not([pinned])
   .tab-stack {
 	-moz-border-image: url("tab-inactive-r.png") 10 10 10 5 / 10px 10px 10px 5px !important;
 	-moz-border-image-slice: 10 10 10 5 fill !important;
@@ -263,7 +274,8 @@
 /* foreground, left */
 :root:-moz-window-inactive
   .tabbrowser-tabs[treestyletab-mode="vertical"]
-  .tabbrowser-tab[selected="true"] .tab-stack{
+  .tabbrowser-tab[selected="true"]:not([pinned])
+  .tab-stack{
 	-moz-border-image: url("tab-inactive-selected-l.png") 10 5 10 10 / 10px 5px 10px 10px !important;
 	-moz-border-image-slice: 10 5 10 10 fill !important;
 }
@@ -271,7 +283,8 @@
 /* foreground, right */
 :root:-moz-window-inactive
   .tabbrowser-tabs[treestyletab-mode="vertical"][treestyletab-tab-inverted="true"]
-  .tabbrowser-tab[selected="true"] .tab-stack{
+  .tabbrowser-tab[selected="true"]:not([pinned])
+  .tab-stack{
 	-moz-border-image: url("tab-inactive-selected-r.png") 10 10 10 5 / 10px 10px 10px 5px !important;
 	-moz-border-image-slice: 10 10 10 5 fill !important;
 }
diff --git a/chrome/treestyletab.jar!/skin/classic/treestyletab/pseudo-tree.css b/chrome/treestyletab.jar!/skin/classic/treestyletab/pseudo-tree.css
index 2e3e2b5..311bf76 100755
--- a/chrome/treestyletab.jar!/skin/classic/treestyletab/pseudo-tree.css
+++ b/chrome/treestyletab.jar!/skin/classic/treestyletab/pseudo-tree.css
@@ -8,15 +8,18 @@
 }
 
 .treestyletab-pseudo-tree-row {
+	box-align: center;
 	-moz-box-align: center;
 }
 
 .treestyletab-pseudo-tree-row label.text-link {
+	box-crop: end;
 	-moz-box-crop: end;
 }
 
 .treestyletab-pseudo-tree-children {
 	margin-left: 1.5em;
+	box-align: stretch;
 	-moz-box-align: stretch;
 }
 
diff --git a/chrome/treestyletab.jar!/skin/classic/treestyletab/sidebar/aero.css b/chrome/treestyletab.jar!/skin/classic/treestyletab/sidebar/aero.css
index 19ef3ee..3cb6e06 100755
--- a/chrome/treestyletab.jar!/skin/classic/treestyletab/sidebar/aero.css
+++ b/chrome/treestyletab.jar!/skin/classic/treestyletab/sidebar/aero.css
@@ -5,8 +5,9 @@
 tabbrowser[treestyletab-style~="aero"]:not([treestyletab-tabbar-position="top"]),
 :root[treestyletab-style~="aero"]:not([treestyletab-tabbar-position="top"]) #appcontent,
 :root[treestyletab-style~="aero"]:not([treestyletab-tabbar-position="top"]) #browser {
-	background: transparent !important;
+	appearance: none !important;
 	-moz-appearance: none !important;
+	background: transparent !important;
 }
 .tabbrowser-strip[treestyletab-style~="aero"][treestyletab-mode="vertical"],
 .treestyletab-tabbar-toolbar[treestyletab-style~="aero"][treestyletab-mode="vertical"] {
diff --git a/chrome/treestyletab.jar!/skin/classic/treestyletab/sidebar/sidebar-base.css b/chrome/treestyletab.jar!/skin/classic/treestyletab/sidebar/sidebar-base.css
index 2633228..f8637e3 100755
--- a/chrome/treestyletab.jar!/skin/classic/treestyletab/sidebar/sidebar-base.css
+++ b/chrome/treestyletab.jar!/skin/classic/treestyletab/sidebar/sidebar-base.css
@@ -86,27 +86,27 @@ tabbrowser[treestyletab-mode="vertical"]
 /* Style tabs themselves.  Get rid of most of the initial XUL styling */
 .tabbrowser-tabs[treestyletab-mode="vertical"]
   .tabbrowser-tab {
+	appearance: none !important;
 	-moz-appearance: none !important;
-	-moz-border-top-colors: none !important;
-	-moz-border-bottom-colors: none !important;
-	-moz-border-right-colors: none !important;
-	-moz-border-left-colors: none !important;
-	-moz-border-radius-topleft : 0 !important;
-	-moz-border-radius-topright : 0 !important;
-	-moz-border-radius-bottomleft : 0 !important;
-	-moz-border-radius-bottomright : 0 !important;
+	border: none;
+	border-radius: 0 !important;
+	-moz-border-radius: 0 !important;
+	border-top: 1px solid transparent !important;
+	box-align: stretch !important;
 	-moz-box-align: stretch !important;
+	height: 21px !important;     /* height including border! */
 	margin: 0 !important;
 	padding: 1px 3px 2px 10px !important;
-	height: 21px !important;     /* height including border! */
 	text-align: left !important;
-	border: none;
-	border-top: 1px solid transparent !important;
+	-moz-border-top-colors: none !important;
+	-moz-border-bottom-colors: none !important;
+	-moz-border-right-colors: none !important;
+	-moz-border-left-colors: none !important;
 }
 .tabbrowser-tabs[treestyletab-mode="vertical"]
-  .tabbrowser-tab:not([pinned]),
+  .tabbrowser-tab:not([pinned]):not([selected="true"]),
 .tabbrowser-tabs[treestyletab-mode="vertical"]
-  .tabbrowser-tab[pinned]:not([titlechanged]) {
+  .tabbrowser-tab[pinned]:not([titlechanged]):not([selected="true"]) {
 	background: transparent !important;
 }
 .tabbrowser-tabs[treestyletab-mode="vertical"]
@@ -116,6 +116,11 @@ tabbrowser[treestyletab-mode="vertical"]
 	line-height: 1 !important;
 }
 .tabbrowser-tabs[treestyletab-mode="vertical"]
+  :-moz-any(.tab-throbber[pinned],
+            .tab-icon-image[pinned]) {
+	margin: 0 !important;
+}
+.tabbrowser-tabs[treestyletab-mode="vertical"]
   .tabbrowser-tab[pinned]
   .tab-stack {
 	max-height: 24px !important;
@@ -203,9 +208,10 @@ tabbrowser[treestyletab-mode="vertical"]
 /* Make the tab counter look like the bubbles in Mail.app et.al. */
 .tabbrowser-tabs[treestyletab-mode="vertical"]
   .treestyletab-counter-container {
-	padding: 0 6px !important;
 	background-color: #91a0c0 !important;
+	border-radius: 8px !important;
 	-moz-border-radius: 8px !important;
+	padding: 0 6px !important;
 }
 .tabbrowser-tabs[treestyletab-mode="vertical"]
   .treestyletab-counter {
@@ -265,8 +271,9 @@ tabbrowser[treestyletab-mode="vertical"]
 /* Round blue rectangle around tabs that are dropping targets. */
 .tabbrowser-tabs[treestyletab-mode="vertical"][treestyletab-style]
   .tabbrowser-tab:not([pinned="true"])[treestyletab-drop-position="self"]:not([selected="true"]) {
-	border: 2px solid #577bf3 !important; /* not OSX's colour but Firefox's */
 	background: #d0def5 !important;
+	border: 2px solid #577bf3 !important; /* not OSX's colour but Firefox's */
+	border-radius: 8px !important;
 	-moz-border-radius: 8px !important;
 	padding: 0 1px 0 8px !important;
 }
@@ -302,13 +309,14 @@ tabbrowser[treestyletab-mode="vertical"]
 
 .treestyletab-tabbar-toolbar:not([treestyletab-tabbar-position="top"]),
 .treestyletab-tabbar-toolbar[treestyletab-tabbar-position="top"]:not([treestyletab-tabbar-fixed="true"]) {
+	appearance: none !important;
+	-moz-appearance: none !important;
 	background: transparent !important;
 	border: 0 none !important;
+	box-shadow: none !important;
+	-moz-box-shadow: none !important;
 	margin: 0 !important;
 	padding: 0 !important;
-	-moz-appearance: none !important;
-	-moz-box-shadow: none !important;
-	box-shadow: none !important;
 }
 
 .tabbrowser-tabs[treestyletab-mode="vertical"]
@@ -330,6 +338,7 @@ tabbrowser[treestyletab-mode="vertical"]
 .treestyletab-tabbar-toolbar[treestyletab-mode="vertical"]
   > toolbarpaletteitem
   > toolbarbutton:hover {
+	appearance: none !important;
 	-moz-appearance: none !important;
 	background: transparent !important;
 	border: 0 none !important;
@@ -365,14 +374,16 @@ tabbrowser[treestyletab-mode="vertical"]
 	-moz-image-region: auto !important;
 }
 .tabbrowser-tabs[treestyletab-mode="vertical"] {
+	appearance: none !important;
+	-moz-appearance: none !important;
 	background: transparent !important;
 	margin: 0;
-	-moz-appearance: none !important;
 }
 
 /* for Linux (Gnomestrip) */
 .tabbrowser-tabs[treestyletab-mode="vertical"]
   .tab-close-button {
+	appearance: none !important;
 	-moz-appearance: none !important;
 }
 
diff --git a/chrome/treestyletab.jar!/skin/classic/treestyletab/square/base.css b/chrome/treestyletab.jar!/skin/classic/treestyletab/square/base.css
index 2e6a71f..8af24f5 100755
--- a/chrome/treestyletab.jar!/skin/classic/treestyletab/square/base.css
+++ b/chrome/treestyletab.jar!/skin/classic/treestyletab/square/base.css
@@ -4,14 +4,16 @@
 
 .tabbrowser-tabs:not([treestyletab-tabbar-position="top"]),
 .treestyletab-tabbar-toolbar:not([treestyletab-tabbar-position="top"]) {
+	appearance: none;
+	-moz-appearance: none;
 	background: transparent !important;
 	margin: 0 !important;
 	padding: 0 !important;
-	-moz-appearance: none;
 }
 .tabbrowser-strip[treestyletab-style~="border"]:not([treestyletab-tabbar-position="top"]) {
-	background: darkgray !important;
+	appearance: none;
 	-moz-appearance: none;
+	background: darkgray !important;
 }
 
 .tabbrowser-strip[treestyletab-mode="vertical"],
@@ -32,8 +34,8 @@
 	border: 0 none !important;
 	margin: 0 !important;
 	padding: 0 !important;
-	-moz-box-shadow: none !important;
 	box-shadow: none !important;
+	-moz-box-shadow: none !important;
 }
 
 .tabbrowser-strip[treestyletab-tabbar-position="left"][treestyletab-tabbar-fixed="true"],
@@ -60,6 +62,7 @@
   .tabbrowser-tab,
 .tabbrowser-tabs:not([treestyletab-tabbar-position="top"])
   .tabbrowser-tab:not([selected="true"]) {
+	appearance: none !important;
 	-moz-appearance: none !important;
 	min-height: 2em;
 	margin: 0 !important;
@@ -72,18 +75,17 @@
 	-moz-border-top-colors: transparent transparent !important;
 	border-bottom: 2px solid !important;
 	-moz-border-bottom-colors: ThreeDShadow transparent !important;
-	-moz-border-radius-topleft : 0 !important;
-	-moz-border-radius-topright : 0 !important;
-	-moz-border-radius-bottomleft : 0 !important;
-	-moz-border-radius-bottomright : 0 !important;
+	border-radius: 0 !important;
+	-moz-border-radius: 0 !important;
 	-moz-border-image: none !important;
+	box-align: stretch !important;
 	-moz-box-align: stretch !important;
 }
 .tabbrowser-tabs:not([treestyletab-tabbar-position="top"])
   .tabbrowser-tab:not([pinned]),
 .tabbrowser-tabs:not([treestyletab-tabbar-position="top"])
   .tabbrowser-tab:not([pinned]):not([selected="true"]) {
-	background: ThreeDFace repeat-x !important;
+	background: -moz-dialog repeat-x !important;
 }
 .tabbrowser-tabs:not([treestyletab-tabbar-position="top"])
   :-moz-any(.tabbrowser-tab[pinned]:not([titlechanged]),
@@ -94,7 +96,7 @@
   .tabbrowser-tabs:not([treestyletab-tabbar-position="top"])
   :-moz-any(.tabbrowser-tab[pinned],
             .tabbrowser-tab[pinned][titlechanged]) {
-	background: ThreeDFace repeat-x !important;
+	background: -moz-dialog repeat-x !important;
 }
 .tabbrowser-tabs[treestyletab-mode="vertical"][treestyletab-firsttab-border="true"]
   .tabbrowser-tab:not([pinned="true"]):not([selected="true"]):first-child {
@@ -210,8 +212,9 @@
 /* Mac OS X */
 .tabbrowser-tabs[treestyletab-mode="vertical"]
   .tabbrowser-tab {
-	text-align: start !important; 
+	box-pack: start !important;
 	-moz-box-pack: start !important;
+	text-align: start !important; 
 }
 
 
@@ -241,6 +244,7 @@
 tabbrowser[treestyletab-style~="aero"]:not([treestyletab-tabbar-position="top"]),
 :root[treestyletab-style~="aero"]:not([treestyletab-tabbar-position="top"]) #appcontent,
 :root[treestyletab-style~="aero"]:not([treestyletab-tabbar-position="top"]) #browser {
-	background: transparent !important;
+	appearance: none !important;
 	-moz-appearance: none !important;
+	background: transparent !important;
 }
diff --git a/chrome/treestyletab.jar!/skin/classic/treestyletab/square/dropshadow.css b/chrome/treestyletab.jar!/skin/classic/treestyletab/square/dropshadow.css
index 7f66df0..3c6ab5d 100755
--- a/chrome/treestyletab.jar!/skin/classic/treestyletab/square/dropshadow.css
+++ b/chrome/treestyletab.jar!/skin/classic/treestyletab/square/dropshadow.css
@@ -5,14 +5,14 @@
 
 .tabbrowser-tabs[treestyletab-mode="vertical"]
   .tabbrowser-tab:not([pinned="true"]) {
-	-moz-box-shadow: -0.3em 0.3em 0.2em rgba(0, 0, 0, 0.15);
 	box-shadow: -0.3em 0.3em 0.2em rgba(0, 0, 0, 0.15);
+	-moz-box-shadow: -0.3em 0.3em 0.2em rgba(0, 0, 0, 0.15);
 }
 
 .tabbrowser-tabs[treestyletab-mode="vertical"][treestyletab-tab-inverted="true"]
   .tabbrowser-tab:not([pinned="true"]) {
-	-moz-box-shadow: 0.3em 0.3em 0.2em rgba(0, 0, 0, 0.15);
 	box-shadow: 0.3em 0.3em 0.2em rgba(0, 0, 0, 0.15);
+	-moz-box-shadow: 0.3em 0.3em 0.2em rgba(0, 0, 0, 0.15);
 }
 
 .tabbrowser-tabs[treestyletab-mode="vertical"]
@@ -23,8 +23,8 @@
   .tabbrowser-tabs[treestyletab-mode="vertical"]:not([overflow="true"])
   .tabbrowser-arrowscrollbox
   .tabs-newtab-button {
-	-moz-box-shadow: 0 0.3em 0.2em rgba(0, 0, 0, 0.15);
 	box-shadow: 0 0.3em 0.2em rgba(0, 0, 0, 0.15);
+	-moz-box-shadow: 0 0.3em 0.2em rgba(0, 0, 0, 0.15);
 }
 
 
@@ -33,8 +33,8 @@
 .tabbrowser-tabs[treestyletab-mode="vertical"][overflow="true"]
   .tabbrowser-arrowscrollbox
   .scrollbox-innerbox {
-	-moz-box-shadow: inset -0.2em 0.2em 0.3em rgba(0, 0, 0, 0.15) !important;
 	box-shadow: inset -0.2em 0.2em 0.3em rgba(0, 0, 0, 0.15) !important;
+	-moz-box-shadow: inset -0.2em 0.2em 0.3em rgba(0, 0, 0, 0.15) !important;
 }
 
 .tabbrowser-tabs[treestyletab-mode="vertical"][treestyletab-tab-inverted="true"]:not([overflow="true"])
@@ -42,8 +42,8 @@
 .tabbrowser-tabs[treestyletab-mode="vertical"][treestyletab-tab-inverted="true"][overflow="true"]
   .tabbrowser-arrowscrollbox
   .scrollbox-innerbox {
-	-moz-box-shadow: inset 0.2em 0.2em 0.3em rgba(0, 0, 0, 0.15) !important;
 	box-shadow: inset 0.2em 0.2em 0.3em rgba(0, 0, 0, 0.15) !important;
+	-moz-box-shadow: inset 0.2em 0.2em 0.3em rgba(0, 0, 0, 0.15) !important;
 }
 
 
diff --git a/chrome/treestyletab.jar!/skin/classic/treestyletab/square/tab-surface.css b/chrome/treestyletab.jar!/skin/classic/treestyletab/square/tab-surface.css
index 26457ff..d1ba8d4 100755
--- a/chrome/treestyletab.jar!/skin/classic/treestyletab/square/tab-surface.css
+++ b/chrome/treestyletab.jar!/skin/classic/treestyletab/square/tab-surface.css
@@ -13,7 +13,7 @@
   .tabbrowser-tab
   :-moz-any(.tab-background:not([pinned]),
             .tab-background:not([titlechanged])[pinned]) {
-	background-color: ThreeDFace !important;
+	background-color: -moz-dialog !important;
 	background-image: -moz-linear-gradient(
 	                    top, 
 	                    rgba(0, 0, 0, 0.02) 0,
diff --git a/chrome/treestyletab.jar!/skin/classic/treestyletab/square/vertigo.css b/chrome/treestyletab.jar!/skin/classic/treestyletab/square/vertigo.css
index d3541a2..2edc2e2 100755
--- a/chrome/treestyletab.jar!/skin/classic/treestyletab/square/vertigo.css
+++ b/chrome/treestyletab.jar!/skin/classic/treestyletab/square/vertigo.css
@@ -90,6 +90,6 @@
 /* autohide */
 .treestyletab-tabbar-toolbar[treestyletab-tabbar-autohide][treestyletab-mode="vertical"]
   #treestyletab-tabbar-resizer-box {
-	background: ThreeDFace;
+	background: -moz-dialog;
 	opacity: 0.75;
 }
diff --git a/chrome/treestyletab.jar!/skin/classic/treestyletab/tmp.css b/chrome/treestyletab.jar!/skin/classic/treestyletab/tmp.css
index 83c8db5..efc159e 100755
--- a/chrome/treestyletab.jar!/skin/classic/treestyletab/tmp.css
+++ b/chrome/treestyletab.jar!/skin/classic/treestyletab/tmp.css
@@ -2,6 +2,7 @@
 
 :root[treestyletab-enable-compatibility-tmp="true"]
   .tabbrowser-tabs[treestyletab-mode="vertical"] .tabs-closebutton-topbox > .tabs-closebutton {
+	appearance: none !important;
 	-moz-appearance: none !important;
 	border: 0 none !important;
 	-moz-border-top-colors: none !important;
@@ -9,7 +10,7 @@
 	-moz-border-bottom-colors: none !important;
 	-moz-border-left-colors: none !important;
 	border-top: 1px solid ThreeDShadow !important;
-	background: ThreeDFace !important;
+	background: -moz-dialog !important;
 }
 
 :root[treestyletab-enable-compatibility-tmp="true"]
@@ -29,9 +30,13 @@
 
 :root[treestyletab-enable-compatibility-tmp="true"]
   .tabbrowser-tabs[treestyletab-mode="vertical"] .tabs-newtab-topbox > .tabs-newtab-button {
+	box-flex: 1;
 	-moz-box-flex: 1;
+	box-align: center;
 	-moz-box-align: center;
+	box-pack: center;
 	-moz-box-pack: center;
+	box-orient: vertical;
 	-moz-box-orient: vertical;
 }
 
diff --git a/chrome/treestyletab.jar!/skin/classic/treestyletab/twisty/twisty.css b/chrome/treestyletab.jar!/skin/classic/treestyletab/twisty/twisty.css
index c86dc9c..c4d6195 100755
--- a/chrome/treestyletab.jar!/skin/classic/treestyletab/twisty/twisty.css
+++ b/chrome/treestyletab.jar!/skin/classic/treestyletab/twisty/twisty.css
@@ -12,8 +12,11 @@
 	max-width: 16px;
 	min-height: 16px;
 	min-width: 16px;
+	box-pack: start;
 	-moz-box-pack: start;
+	box-align: center;
 	-moz-box-align: center;
+	box-flex: 1;
 	-moz-box-flex: 1;
 }
 
@@ -34,10 +37,10 @@
 	margin: 0 -5px 0 -2px;
 }
 
-.tabbrowser-tabs[treestyletab-twisty-style^="modern"]:not([treestyletab-style])[treestyletab-allow-subtree-collapse="true"]
+.tabbrowser-tabs:not([treestyletab-style])[treestyletab-allow-subtree-collapse="true"]
   .tabbrowser-tab[treestyletab-allow-subtree-collapse="true"][treestyletab-children]:not([pinned="true"])
   .treestyletab-twisty,
-.tabbrowser-tabs[treestyletab-twisty-style^="modern"][treestyletab-tabbar-position="top"][treestyletab-allow-subtree-collapse="true"]
+.tabbrowser-tabs[treestyletab-tabbar-position="top"][treestyletab-allow-subtree-collapse="true"]
   .tabbrowser-tab[treestyletab-allow-subtree-collapse="true"][treestyletab-children]:not([pinned="true"])
   .treestyletab-twisty {
 	margin: 0 -3px 0 -2px;
@@ -50,10 +53,10 @@
   .treestyletab-twisty {
 	margin: 0 -5px 0 1px;
 }
-.tabbrowser-tabs[treestyletab-twisty-style^="modern"]:not([treestyletab-style])[treestyletab-allow-subtree-collapse="true"][treestyletab-tab-contents-inverted="true"]
+.tabbrowser-tabs:not([treestyletab-style])[treestyletab-allow-subtree-collapse="true"][treestyletab-tab-contents-inverted="true"]
   .tabbrowser-tab[treestyletab-allow-subtree-collapse="true"][treestyletab-children]:not([pinned="true"])
   .treestyletab-twisty,
-.tabbrowser-tabs[treestyletab-twisty-style^="modern"][treestyletab-tabbar-position="top"][treestyletab-allow-subtree-collapse="true"][treestyletab-tab-contents-inverted="true"]
+.tabbrowser-tabs[treestyletab-tabbar-position="top"][treestyletab-allow-subtree-collapse="true"][treestyletab-tab-contents-inverted="true"]
   .tabbrowser-tab[treestyletab-allow-subtree-collapse="true"][treestyletab-children]:not([pinned="true"])
   .treestyletab-twisty {
 	margin: 0 -2px 0 -3px;
diff --git a/chrome/treestyletab.jar!/skin/classic/treestyletab/ui.css b/chrome/treestyletab.jar!/skin/classic/treestyletab/ui.css
index 27fcd77..1d079bc 100755
--- a/chrome/treestyletab.jar!/skin/classic/treestyletab/ui.css
+++ b/chrome/treestyletab.jar!/skin/classic/treestyletab/ui.css
@@ -3,7 +3,9 @@
 /* tree UI */
 
 .treestyletab-counter-container {
+	box-align: center;
 	-moz-box-align: center;
+	box-pack: end;
 	-moz-box-pack: end;
 }
 
@@ -163,6 +165,7 @@
 
 
 tabbrowser[treestyletab-drop-position] {
+	appearance: none !important;
 	-moz-appearance: none !important;
 	border: 2px solid transparent !important;
 	-moz-border-top-colors: none !important;
@@ -269,9 +272,10 @@ tabbrowser[treestyletab-tabbar-position="bottom"]
 /* toolbar customization */
 
 .treestyletab-tabbar-toolbar-ready-popup {
+	appearance: tooltip;
+	-moz-appearance: tooltip;
 	max-width: 15em;
 	opacity: 0.85;
-	-moz-appearance: tooltip;
 }
 
 .treestyletab-tabbar-toolbar-ready {
@@ -306,15 +310,16 @@ tabbrowser[treestyletab-tabbar-position="bottom"]
   > .scrollbutton-down[treestyletab-notifybgtab-phase] {
 	background: -moz-linear-gradient(-90deg, rgba(255,255,255,0), Highlight);
 	border: 0 none;
+	box-shadow: none;
+	-moz-box-shadow: none;
 	height: 2em;
 	margin-top: -2em;
 	visibility: visible;
 	opacity: 0;
 	pointer-events: none;
-	-moz-box-shadow: none;
-	     box-shadow: none;
-	-moz-transition: 1s opacity ease-out;
-	     transition: 1s opacity ease-out;
+	transition: 1s opacity ease-out;
+	transition: 1s opacity ease-out;
+	user-focus: ignore;
 	-moz-user-focus: ignore;
 }
 
diff --git a/defaults/preferences/treestyletab.js b/defaults/preferences/treestyletab.js
index e7804e5..fd3e6a2 100755
--- a/defaults/preferences/treestyletab.js
+++ b/defaults/preferences/treestyletab.js
@@ -585,7 +585,6 @@ pref("browser.link.open_newwindow.restriction.override", 0);
 pref("browser.tabs.loadFolderAndReplace.override", false);
 pref("browser.tabs.insertRelatedAfterCurrent.override", false);
 pref("browser.tabs.insertRelatedAfterCurrent.override.force", true);
-pref("extensions.treestyletab.tabsOnTopShouldBeRestored", false);
 
 /**
  * Extra commands for selected tabs (Multiple Tab Handler)
@@ -642,6 +641,7 @@ pref("extensions.treestyletab.compatibility.PersonalTitlebar", true);
 pref("extensions.treestyletab.compatibility.QuickDrag", true);
 pref("extensions.treestyletab.compatibility.RemoveNewTabButton", true);
 pref("extensions.treestyletab.compatibility.SBMCounter", true);
+pref("extensions.treestyletab.compatibility.Scriptish", false);
 pref("extensions.treestyletab.compatibility.SelectionLinks", true);
 pref("extensions.treestyletab.compatibility.SessionManager", true);
 pref("extensions.treestyletab.compatibility.SmoothlyCloseTabs", true);
diff --git a/install.rdf b/install.rdf
index 9bf34b6..d0485e8 100644
--- a/install.rdf
+++ b/install.rdf
@@ -5,7 +5,7 @@
   <RDF:Description RDF:about="urn:mozilla:install-manifest"
                    em:id="treestyletab at piro.sakura.ne.jp"
                    em:name="Tree Style Tab"
-                   em:version="0.14.2012021101"
+                   em:version="0.14.2012050301"
                    em:creator="SHIMODA Hiroshi"
                    em:description="Show tabs like a tree."
                    em:homepageURL="http://piro.sakura.ne.jp/xul/_treestyletab.html.en"
@@ -167,8 +167,8 @@
 
     <em:targetApplication>
       <RDF:Description em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
-                       em:minVersion="4.0"
-                       em:maxVersion="13.0a1" />
+                       em:minVersion="10.0"
+                       em:maxVersion="15.0a1" />
     </em:targetApplication>
   </RDF:Description>
 </RDF:RDF>
diff --git a/modules/autoHide.js b/modules/autoHide.js
index 91c45f0..09bd472 100755
--- a/modules/autoHide.js
+++ b/modules/autoHide.js
@@ -470,10 +470,7 @@ AutoHideBrowser.prototype = {
 				);
 			if (closebox[position] - padding <= coordinate &&
 				closebox[position] + closebox[size] + padding >= coordinate)
-				return {
-					padding   : padding,
-					__proto__ : closebox
-				};
+				return this.cloneBoxObject(closebox, { padding : padding });
 		}
 
 		var twisty;
@@ -487,14 +484,24 @@ AutoHideBrowser.prototype = {
 				);
 			if (twisty[position] - padding <= coordinate &&
 				twisty[position] + twisty[size] + padding >= coordinate)
-				return {
-					padding   : padding,
-					__proto__ : twisty
-				};
+				return this.cloneBoxObject(twisty, { padding : padding });
 		}
 
 		return null;
 	},
+	cloneBoxObject : function AHB_cloneBoxObject(aBoxObject, aOverride)
+	{
+		var box = {};
+		for (let i in aBoxObject)
+		{
+			if (typeof aBoxObject[i] != 'function')
+				box[i] = aBoxObject[i];
+		}
+		Object.keys(aOverride).forEach(function(aKey) {
+			box[aKey] = aOverride[aKey];
+		});
+		return box;
+	},
  
 	cancelShowHideOnMouseMove : function AHB_cancelShowHideOnMouseMove() 
 	{
diff --git a/modules/browser.js b/modules/browser.js
index 8c6a497..7beeec5 100755
--- a/modules/browser.js
+++ b/modules/browser.js
@@ -421,7 +421,7 @@ TreeStyleTabBrowser.prototype = {
 
 		var width  = faviconized ? faviconizedSize : maxWidth ;
 		var height = faviconizedSize;
-		var maxCol = Math.floor(maxWidth / width);
+		var maxCol = Math.max(1, Math.floor(maxWidth / width));
 		var maxRow = Math.ceil(count / maxCol);
 		var col    = 0;
 		var row    = 0;
@@ -601,7 +601,7 @@ TreeStyleTabBrowser.prototype = {
 
 		this._initTabbrowserExtraContents();
 
-		let position = this.position;
+		var position = this.position;
 		this.fireTabbarPositionEvent(this.kEVENT_TYPE_TABBAR_POSITION_CHANGING, 'top', position); /* PUBLIC API */
 
 		this.setTabbrowserAttribute(this.kFIXED+'-horizontal', this.getTreePref('tabbar.fixed.horizontal') ? 'true' : null, b);
@@ -687,6 +687,20 @@ TreeStyleTabBrowser.prototype = {
 		this.fireTabbarPositionEvent(false, 'top', position); /* PUBLIC API */
 
 		this.startRendering();
+
+		var self = this;
+		this.Deferred.next(function() {
+			// On Firefox 12 and later, this command is always enabled
+			// and the TabsOnTop can be enabled by <tabbrowser>.updateVisibility().
+			// So we have to reset TabsOnTop state on the startup.
+			var toggleTabsOnTop = d.getElementById('cmd_ToggleTabsOnTop');
+			var TabsOnTop = 'TabsOnTop' in w ? w.TabsOnTop : null ;
+			if (TabsOnTop && TabsOnTop.syncUI && toggleTabsOnTop && self.isVertical) {
+				toggleTabsOnTop.setAttribute('disabled', true);
+				if (TabsOnTop.enabled && TabsOnTop.toggle)
+					TabsOnTop.toggle();
+			}
+		});
 	},
 	
 	_initTabbrowserExtraContents : function TSTBrowser_initTabbrowserExtraContents() 
@@ -1392,6 +1406,7 @@ TreeStyleTabBrowser.prototype = {
 		tabContainer.addEventListener('TabPinned',      this, true);
 		tabContainer.addEventListener('TabUnpinned',    this, true);
 		tabContainer.addEventListener('mouseover', this, true);
+		tabContainer.addEventListener('mouseout', this, true);
 		tabContainer.addEventListener('dblclick',  this, true);
 		tabContainer.addEventListener('select', this, true);
 		tabContainer.addEventListener('scroll', this, true);
@@ -1472,6 +1487,8 @@ TreeStyleTabBrowser.prototype = {
 
 		this.stopRendering();
 
+		var self = this;
+
 		var w = this.window;
 		var d = this.document;
 		var b = this.mTabBrowser;
@@ -1495,11 +1512,22 @@ TreeStyleTabBrowser.prototype = {
 				// remove ordinal for "tabs on top" https://bugzilla.mozilla.org/show_bug.cgi?id=544815
 				if (this.position == 'top') {
 					this.removeTabStripAttribute('ordinal');
-					if (TabsOnTop && !this.windowService.isPopupWindow) {
-						// workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=555987
-						TabsOnTop.enabled = !TabsOnTop.enabled;
+					if (TabsOnTop && !this.windowService.isPopupWindow &&
+						this.windowService.initialized) {
+						let currentState = TabsOnTop.enabled;
+						let originalState = this.getTreePref('tabsOnTop.originalState');
+						if (originalState !== null &&
+							currentState != originalState &&
+							this.windowService.tabsOnTopChangingByUI &&
+							!this.windowService.changingTabsOnTop)
+							this.setTreePref('tabsOnTop.originalState', currentState);
+						// Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=555987
+						// This should be done when the value of the "ordinal" attribute
+						// is modified dynamically. So, we don' have to do it before
+						// the browser window is completely initialized.
+						TabsOnTop.enabled = !currentState;
 						this.Deferred.next(function() {
-							TabsOnTop.enabled = !TabsOnTop.enabled;
+							TabsOnTop.enabled = currentState;
 						}).error(this.defaultDeferredErrorHandler);
 					}
 				}
@@ -1517,20 +1545,29 @@ TreeStyleTabBrowser.prototype = {
 		}
 
 		if (TabsOnTop && !this.windowService.isPopupWindow) {
-			let tabsWasOnTop = TabsOnTop.enabled;
-			TabsOnTop.enabled = TabsOnTop.enabled && this.position == 'top' && this.fixed;
-			if (tabsWasOnTop && !TabsOnTop.enabled)
-				this.setTreePref('tabsOnTopShouldBeRestored', true);
+			let updateTabsOnTop = function() {
+					self.windowService.updateTabsOnTop();
+				};
+			// TabsOnTop.enabled is always "false" before the browser window is
+			// completely initialized. So, we have to check it with delay only
+			// on the Startup.
+			if (this.initialized)
+				updateTabsOnTop();
+			else
+				this.Deferred.next(updateTabsOnTop);
 		}
 
-		var self = this;
 		this.Deferred.next(function() {
 			self.updateFloatingTabbar(self.kTABBAR_UPDATE_BY_APPEARANCE_CHANGE);
 			self._fireTabbarStateChangedEvent();
 			self.startRendering();
 		}).error(this.defaultDeferredErrorHandler);
 
-		this.allowSubtreeCollapseExpand = this.getTreePref('allowSubtreeCollapseExpand.'+orient) ;
+		var allowToCollapse = this.getTreePref('allowSubtreeCollapseExpand.'+orient);
+		if (this.allowSubtreeCollapseExpand != allowToCollapse)
+			this.collapseExpandAllSubtree(false, false);
+		this.allowSubtreeCollapseExpand = allowToCollapse;
+
 		this.maxTreeLevel = this.getTreePref('maxTreeLevel.'+orient);
 
 		this.setTabbrowserAttribute(this.kALLOW_STACK, this.canStackTabs ? 'true' : null);
@@ -1701,7 +1738,7 @@ TreeStyleTabBrowser.prototype = {
 				statusPanelStyle.marginLeft = (contentBox.screenX - offsetParentBox.screenX + chromeMargins[3])+'px';
 				statusPanelStyle.marginRight = ((offsetParentBox.screenX + offsetParentBox.width) - (contentBox.screenX + contentBox.width) + chromeMargins[1])+'px';
 				statusPanelStyle.maxWidth = this.isVertical ?
-					parseInt(contentBox.width / 2)+'px' :
+					(contentBox.width-5)+'px' : // emulate the margin defined on https://bugzilla.mozilla.org/show_bug.cgi?id=632634
 					'' ;
 				statusPanel.__treestyletab__repositioned = true;
 			}
@@ -1937,6 +1974,7 @@ TreeStyleTabBrowser.prototype = {
 		tabContainer.removeEventListener('TabPinned',      this, true);
 		tabContainer.removeEventListener('TabUnpinned',    this, true);
 		tabContainer.removeEventListener('mouseover', this, true);
+		tabContainer.removeEventListener('mouseout', this, true);
 		tabContainer.removeEventListener('dblclick',  this, true);
 		tabContainer.removeEventListener('select', this, true);
 		tabContainer.removeEventListener('scroll', this, true);
@@ -2447,12 +2485,23 @@ TreeStyleTabBrowser.prototype = {
 				let (tab = aEvent.target) {
 					if (tab.__treestyletab__twistyHoverTimer)
 						this.window.clearTimeout(tab.__treestyletab__twistyHoverTimer);
-					if (this.isEventFiredOnTwisty(aEvent))
+					if (this.isEventFiredOnTwisty(aEvent)) {
+						tab.setAttribute(this.kTWISTY_HOVER, true);
 						tab.__treestyletab__twistyHoverTimer = this.window.setTimeout(function(aSelf) {
 							tab.setAttribute(aSelf.kTWISTY_HOVER, true);
+							delete tab.__treestyletab__twistyHoverTimer;
 						}, 0, this);
-					else
-						tab.removeAttribute(this.kTWISTY_HOVER);
+					}
+				}
+				return;
+
+			case 'mouseout':
+				let (tab = aEvent.target) {
+					if (tab.__treestyletab__twistyHoverTimer) {
+						this.window.clearTimeout(tab.__treestyletab__twistyHoverTimer);
+						delete tab.__treestyletab__twistyHoverTimer;
+					}
+					tab.removeAttribute(this.kTWISTY_HOVER);
 				}
 				return;
 
@@ -4436,12 +4485,14 @@ TreeStyleTabBrowser.prototype = {
 	onTabsOnTopSyncCommand : function TSTBrowser_onTabsOnTopSyncCommand(aEnabled) 
 	{
 		if (
+			this.windowService.tabsOnTopChangingByUI ||
 			!aEnabled ||
 			this.position != 'top' ||
 			this.fixed ||
-			!this.windowService.isPopupWindow
+			this.windowService.isPopupWindow
 			)
 			return;
+		this.windowService.tabsOnTopChangingByUI = true;
 		var self = this;
 		this.Deferred
 			.next(function() {
@@ -4451,7 +4502,10 @@ TreeStyleTabBrowser.prototype = {
 				if (self.window.TabsOnTop.enabled != aEnabled)
 					self.window.TabsOnTop.enabled = aEnabled;
 			})
-			.error(this.defaultDeferredErrorHandler);
+			.error(this.defaultDeferredErrorHandler)
+			.next(function() {
+				self.windowService.tabsOnTopChangingByUI = false;
+			});
 	},
  
 	onTreeStyleTabPrintPreviewEntered : function TSTBrowser_onTreeStyleTabPrintPreviewEntered(aEvent) 
@@ -5495,6 +5549,9 @@ TreeStyleTabBrowser.prototype = {
 		aTab.removeAttribute(this.kX_OFFSET);
 		aTab.removeAttribute(this.kY_OFFSET);
 
+		if (!this.canCollapseSubtree(this.getParentTab(aTab)))
+			aCollapsed = false;
+
 		aTab.setAttribute(this.kCOLLAPSING_PHASE, aCollapsed ? this.kCOLLAPSING_PHASE_TO_BE_COLLAPSED : this.kCOLLAPSING_PHASE_TO_BE_EXPANDED );
 
 		var CSSTransitionEnabled = ('Transition' in aTab.style || 'MozTransition' in aTab.style);
diff --git a/modules/fullTooltip.js b/modules/fullTooltip.js
index 9a4bb23..530f193 100755
--- a/modules/fullTooltip.js
+++ b/modules/fullTooltip.js
@@ -305,11 +305,12 @@ FullTooltipManager.prototype = {
 			}
 		}
 
+		var shouldShowTree = mode != this.kTOOLTIP_MODE_DEFAULT && (collapsed || mode == this.kTOOLTIP_MODE_ALWAYS);
 		if ('mOverCloseButton' in tab && tab.mOverCloseButton) {
 			if (descendant.length &&
 				(collapsed || this.getTreePref('closeParentBehavior') == this.kCLOSE_PARENT_BEHAVIOR_CLOSE_ALL_CHILDREN)) {
 				label = tree || tab.getAttribute('label');
-				label = label ?
+				label = label && shouldShowTree ?
 						this.treeBundle.getFormattedString('tooltip.closeTree.labeled', [label]) :
 						this.treeBundle.getString('tooltip.closeTree') ;
 				fullTooltipExtraLabel = this.treeBundle.getFormattedString('tooltip.closeTree.labeled', ['%TREE%']).split(/\s*%TREE%\s*/);
@@ -320,12 +321,12 @@ FullTooltipManager.prototype = {
 						'tooltip.expandSubtree' :
 						'tooltip.collapseSubtree' ;
 			label = tree || tab.getAttribute('label');
-			label = label ?
+			label = label && shouldShowTree ?
 					this.treeBundle.getFormattedString(key+'.labeled', [label]) :
 					this.treeBundle.getString(key) ;
 			fullTooltipExtraLabel = this.treeBundle.getFormattedString(key+'.labeled', ['%TREE%']).split(/\s*%TREE%\s*/);
 		}
-		else if (collapsed || mode == this.kTOOLTIP_MODE_ALWAYS) {
+		else if (shouldShowTree) {
 			label = tree;
 		}
 
@@ -335,7 +336,8 @@ FullTooltipManager.prototype = {
 		aEvent.target.setAttribute('label', label);
 		aEvent.stopPropagation();
 
-		this.setup(aEvent.target, tab, fullTooltipExtraLabel);
+		if (shouldShowTree)
+			this.setup(aEvent.target, tab, fullTooltipExtraLabel);
 	},
 
 
diff --git a/modules/tabbarDNDObserver.js b/modules/tabbarDNDObserver.js
index 449a2ab..efda6ab 100755
--- a/modules/tabbarDNDObserver.js
+++ b/modules/tabbarDNDObserver.js
@@ -35,6 +35,8 @@
  
 const EXPORTED_SYMBOLS = ['TabbarDNDObserver']; 
 
+const DEBUG = false;
+
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
@@ -242,6 +244,7 @@ catch(e) {
 	
 	getDropActionInternal : function TabbarDND_getDropActionInternal(aEvent, aSourceTab) 
 	{
+		if (DEBUG) dump('getDropActionInternal: start\n');
 		var sv = this.treeStyleTab;
 		var b  = this.browser;
 		var d  = this.document;
@@ -264,15 +267,18 @@ catch(e) {
 		var isNewTabAction = !aSourceTab || aSourceTab.ownerDocument != d;
 
 		if (tab.localName != 'tab') {
+			if (DEBUG) dump('  not on a tab\n');
 			let action = isTabMoveFromOtherWindow ? sv.kACTION_STAY : (sv.kACTION_MOVE | sv.kACTION_PART) ;
 			if (isNewTabAction) action |= sv.kACTION_NEWTAB;
 			if (aEvent[sv.screenPositionProp] < firstTab.boxObject[sv.screenPositionProp]) {
+				if (DEBUG) dump('  above the first tab\n');
 				info.target   = info.parent = info.insertBefore = firstTab;
 				info.position = isInverted ? sv.kDROP_AFTER : sv.kDROP_BEFORE ;
 				info.action   = action;
 				return info;
 			}
 			else if (aEvent[sv.screenPositionProp] > tabs[lastTabIndex].boxObject[sv.screenPositionProp] + tabs[lastTabIndex].boxObject[sv.sizeProp]) {
+				if (DEBUG) dump('  below the last tab\n');
 				info.target   = info.parent = tabs[lastTabIndex];
 				info.position = isInverted ? sv.kDROP_BEFORE : sv.kDROP_AFTER ;
 				info.action   = action;
@@ -282,10 +288,13 @@ catch(e) {
 				let index = b.getNewIndex ?
 								b.getNewIndex(aEvent) :
 								b.tabContainer._getDropIndex(aEvent) ;
+				if (DEBUG) dump('  on the tab '+index+'\n');
 				info.target = tabs[Math.min(index, lastTabIndex)];
+				if (DEBUG) dump('  info.target = '+info.target._tPos+'\n');
 			}
 		}
 		else {
+			if (DEBUG) dump('  on the tab '+tab._tPos+'\n');
 			sv.ensureTabInitialized(tab);
 			info.target = tab;
 		}
@@ -315,15 +324,18 @@ catch(e) {
 		switch (info.position)
 		{
 			case sv.kDROP_ON:
+				if (DEBUG) dump('  position = on the tab\n');
 				var visible = sv.getNextVisibleTab(tab);
 				info.action       = sv.kACTION_STAY | sv.kACTION_ATTACH;
 				info.parent       = tab;
 				info.insertBefore = sv.getTreePref('insertNewChildAt') == sv.kINSERT_FISRT ?
 						(sv.getFirstChildTab(tab) || visible) :
-						(sv.getNextSiblingTab(tab) || sv.getNextTab(sv.getLastDescendantTab(tab)));
+						(sv.getNextSiblingTab(tab) || sv.getNextTab(sv.getLastDescendantTab(tab) || tab));
+				if (DEBUG && info.insertBefore) dump('  insertBefore = '+info.insertBefore._tPos+'\n');
 				break;
 
 			case sv.kDROP_BEFORE:
+				if (DEBUG) dump('  position = before the tab\n');
 /*
 	[TARGET  ] ªdetach from parent, and move
 
@@ -348,9 +360,11 @@ catch(e) {
 					info.action       = sv.kACTION_MOVE | (info.parent ? sv.kACTION_ATTACH : sv.kACTION_PART );
 					info.insertBefore = tab;
 				}
+				if (DEBUG && info.insertBefore) dump('  insertBefore = '+info.insertBefore._tPos+'\n');
 				break;
 
 			case sv.kDROP_AFTER:
+				if (DEBUG) dump('  position = after the tab\n');
 /*
 	[TARGET  ] «if the target has a parent, attach to it and and move
 
@@ -378,12 +392,13 @@ catch(e) {
 	[TARGET   ] «attach dragged tab to the parent of the target as its next sibling
 	  [DRAGGED]
 */
-					if (aSourceTab == nextTab && sv.getDescendantTabs(info.parent).length == 1) {
+					if (aSourceTab == nextTab) {
 						info.action = sv.kACTION_MOVE | sv.kACTION_ATTACH;
 						info.parent = sv.getParentTab(tab);
-						info.insertBefore = sv.getNextTab(nextTab);
+						info.insertBefore = sv.getNextSiblingTab(tab);
 					}
 				}
+				if (DEBUG && info.insertBefore) dump('  insertBefore = '+info.insertBefore._tPos+'\n');
 				break;
 		}
 
diff --git a/modules/utils.js b/modules/utils.js
index d8615bb..6b4d66d 100755
--- a/modules/utils.js
+++ b/modules/utils.js
@@ -540,6 +540,20 @@ var TreeStyleTabUtils = {
  
 	overrideExtensions : function TSTUtils_overrideExtensions() 
 	{
+		// Scriptish
+		// https://addons.mozilla.org/firefox/addon/scriptish/
+		if (this.getTreePref('compatibility.Scriptish')) {
+			try {
+				let tabModule = Components.utils.import('resource://scriptish/utils/Scriptish_openInTab.js', {});
+				let Scriptish_openInTab = tabModule.Scriptish_openInTab;
+				tabModule.Scriptish_openInTab = function(aURL, aLoadInBackground, aReuse, aChromeWin) {
+					aChromeWin.TreeStyleTabService.readyToOpenChildTabNow(aChromeWin.gBrowser);
+					return Scriptish_openInTab.apply(this, arguments);
+				};
+			}
+			catch(e) {
+			}
+		}
 	},
  
 	updateNarrowScrollbarStyle : function TSTUtils_updateNarrowScrollbarStyle() 
@@ -601,6 +615,7 @@ var TreeStyleTabUtils = {
 		  .tabbrowser-arrowscrollbox
 		  > scrollbox
 		  > scrollbar[orient="vertical"] {
+			appearance: none;
 			-moz-appearance: none;
 			background: ThreeDFace;
 			border: 1px solid ThreeDShadow;
@@ -1394,6 +1409,18 @@ var TreeStyleTabUtils = {
 		return this.getTabFromChild(aEvent.originalTarget || aEvent.target);
 	},
  
+	getNewTabButtonFromEvent : function TSTUtils_getNewTabButtonFromEvent(aEvent) 
+	{
+		return this.evaluateXPath(
+				'ancestor-or-self::*['
+					+'@id="new-tab-button" or '
+					+'contains(concat(" ", normalize-space(@class), " "), " tabs-newtab-button ")'
+				+'][1]',
+				aEvent.originalTarget,
+				Ci.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE
+			).singleNodeValue;
+	},
+ 
 	getSplitterFromEvent : function TSTUtils_getSplitterFromEvent(aEvent) 
 	{
 		return this.evaluateXPath(
diff --git a/modules/window.js b/modules/window.js
index e58f885..6849b16 100755
--- a/modules/window.js
+++ b/modules/window.js
@@ -334,7 +334,6 @@ TreeStyleTabWindow.prototype = {
 			return;
 
 		if (this.initialized) return;
-		this.initialized = true;
 
 		if (!this.preInitialized) {
 			this.preInit();
@@ -372,6 +371,8 @@ TreeStyleTabWindow.prototype = {
 			this.onPrefChange('extensions.treestyletab.tabbar.autoHide.mode');
 
 		this.onPrefChange('extensions.treestyletab.autoCollapseExpandSubtreeOnSelect.whileFocusMovingByShortcut');
+
+		this.initialized = true;
 	},
 	initialized : false,
 	
@@ -386,8 +387,8 @@ TreeStyleTabWindow.prototype = {
 		namespace = void(0);
 		var self = this;
 		var restorePrefs = function() {
-				if (prefs.getPref('extensions.treestyletab.tabsOnTopShouldBeRestored')) {
-					prefs.clearPref('extensions.treestyletab.tabsOnTopShouldBeRestored');
+				if (prefs.getPref('extensions.treestyletab.tabsOnTop.originalState')) {
+					prefs.clearPref('extensions.treestyletab.tabsOnTop.originalState');
 					try {
 						self.browser.treeStyleTab.position = 'top';
 					}
@@ -979,25 +980,40 @@ TreeStyleTabWindow.prototype = {
 	updateTabsOnTop : function TSTWindow_updateTabsOnTop() 
 	{
 		var w = this.window;
-		if (this.isPopupWindow || !('TabsOnTop' in w) || !('enabled' in w.TabsOnTop))
+		if (
+			this.isPopupWindow ||
+			this.tabsOnTopChangingByUI ||
+			this.tabsOnTopChangingByTST ||
+			!('TabsOnTop' in w) ||
+			!('enabled' in w.TabsOnTop)
+			)
 			return;
 
-		var TabsOnTop = w.TabsOnTop;
-		if (!('_tabsOnTopDefaultState' in this))
-			this._tabsOnTopDefaultState = TabsOnTop.enabled;
+		this.tabsOnTopChangingByTST = true;
 
-		if (this.browser.treeStyleTab.position != 'top' ||
-			!this.browser.treeStyleTab.fixed) {
-			if (TabsOnTop.enabled) {
-				TabsOnTop.enabled = false;
-				this.setTreePref('tabsOnTopShouldBeRestored', true);
+		try {
+			var TabsOnTop = w.TabsOnTop;
+			var originalState = this.getTreePref('tabsOnTop.originalState');
+			if (originalState === null) {
+				let current = this.getDefaultPref('browser.tabs.onTop') === null ?
+								TabsOnTop.enabled :
+								this.getPref('browser.tabs.onTop') ;
+				this.setTreePref('tabsOnTop.originalState', originalState = current);
+			}
+
+			if (this.browser.treeStyleTab.position != 'top' ||
+				!this.browser.treeStyleTab.fixed) {
+				if (TabsOnTop.enabled)
+					TabsOnTop.enabled = false;
+			}
+			else {
+				if (TabsOnTop.enabled != originalState)
+					TabsOnTop.enabled = originalState;
+				this.clearTreePref('tabsOnTop.originalState');
 			}
 		}
-		else if ('_tabsOnTopDefaultState' in this) {
-			if (TabsOnTop.enabled!= this._tabsOnTopDefaultState)
-				TabsOnTop.enabled = this._tabsOnTopDefaultState;
-			delete this._tabsOnTopDefaultState;
-			this.setTreePref('tabsOnTopShouldBeRestored', false);
+		finally {
+			this.tabsOnTopChangingByTST = false;
 		}
 	},
  
@@ -1056,7 +1072,7 @@ TreeStyleTabWindow.prototype = {
 			case this.kNEWTAB_OPEN_AS_ORPHAN:
 			case this.kNEWTAB_DO_NOTHING:
 			default:
-				return;
+				break;
 			case this.kNEWTAB_OPEN_AS_CHILD:
 				this.readyToOpenChildTabNow(aBaseTab);
 				break;
@@ -1064,8 +1080,6 @@ TreeStyleTabWindow.prototype = {
 				let (parentTab = this.getParentTab(aBaseTab)) {
 					if (parentTab)
 						this.readyToOpenChildTabNow(parentTab);
-					else
-						return;
 				}
 				break;
 			case this.kNEWTAB_OPEN_AS_NEXT_SIBLING:
@@ -1076,6 +1090,10 @@ TreeStyleTabWindow.prototype = {
  
 	onBeforeNewTabCommand : function TSTWindow_onBeforeNewTabCommand(aTabBrowser) 
 	{
+		var self = this.windowService || this;
+		if (self._clickEventOnNewTabButtonHandled)
+			return;
+
 		var b = aTabBrowser || this.browser;
 		this._handleNewTabCommand(b.selectedTab, this.getTreePref('autoAttach.newTabCommand'));
 	},
@@ -1086,18 +1104,20 @@ TreeStyleTabWindow.prototype = {
 		if (aEvent.button != 1 && (aEvent.button != 0 || !this.isAccelKeyPressed(aEvent)))
 			return;
 
-		if (this.evaluateXPath(
-				'ancestor-or-self::*['
-					+'@id="new-tab-button" or '
-					+'contains(concat(" ", normalize-space(@class), " "), " tabs-newtab-button ")'
-				+']',
-				aEvent.originalTarget,
-				Ci.nsIDOMXPathResult.BOOLEAN_TYPE
-			).booleanValue)
+		var newTabButton = this.getNewTabButtonFromEvent(aEvent);
+		if (newTabButton) {
 			this._handleNewTabCommand(this.browser.selectedTab, this.getTreePref('autoAttach.newTabButton'));
-		else if (aEvent.target.id == 'urlbar-go-button' || aEvent.target.id == 'go-button')
+			let self = this.windowService || this;
+			self._clickEventOnNewTabButtonHandled = true;
+			this.Deferred.next(function() {
+				self._clickEventOnNewTabButtonHandled = false;
+			});
+		}
+		else if (aEvent.target.id == 'urlbar-go-button' || aEvent.target.id == 'go-button') {
 			this._handleNewTabCommand(this.browser.selectedTab, this.getTreePref('autoAttach.goButton'));
+		}
 	},
+	_clickEventOnNewTabButtonHandled : false,
  
 	onBeforeTabDuplicate : function TSTWindow_onBeforeTabDuplicate(aTab) 
 	{

-- 
Show tabs like a tree



More information about the Pkg-mozext-commits mailing list