diff --git a/content/treestyletab/preloadImages.js b/content/treestyletab/preloadImages.js index 9a202539..8e58dbd0 100644 --- a/content/treestyletab/preloadImages.js +++ b/content/treestyletab/preloadImages.js @@ -30,7 +30,7 @@ TreeStyleTabService._preLoadImages = { 'chrome://treestyletab/skin/metal/shadow-active-l.png', 'chrome://treestyletab/skin/metal/shadow-inactive-l.png' ].concat( - 'MozBorderImage' in document.documentElement.style ? + TreeStyleTabService.Comparator.compare(TreeStyleTabService.XULAppInfo.version, '3.5') >= 0 ? [ 'chrome://treestyletab/skin/metal/tab-active-middle.png', 'chrome://treestyletab/skin/metal/tab-active-middle-selected.png', @@ -47,7 +47,7 @@ TreeStyleTabService._preLoadImages = { 'chrome://treestyletab/skin/metal/shadow-active-r.png', 'chrome://treestyletab/skin/metal/shadow-inactive-r.png' ].concat( - 'MozBorderImage' in document.documentElement.style ? + TreeStyleTabService.Comparator.compare(TreeStyleTabService.XULAppInfo.version, '3.5') >= 0 ? [ 'chrome://treestyletab/skin/metal/tab-active-middle.png', 'chrome://treestyletab/skin/metal/tab-active-middle-selected.png', diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index 9226a25e..781113d6 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -9,8 +9,11 @@ var TreeStyleTabService = { get currentTabbarPosition() /* PUBLIC API */ { - return this.browser.getAttribute(this.kTABBAR_POSITION) || - this.utils.currentTabbarPosition; + return ( + // Don't touch to the element before it is initialized by XBL constructor. + (this.preInitialized && this.browser.getAttribute(this.kTABBAR_POSITION)) || + this.utils.currentTabbarPosition + ); }, set currentTabbarPosition(aValue) {