diff --git a/modules/utils.js b/modules/utils.js index 6fac3313..f6bc13b5 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -1261,12 +1261,11 @@ var TreeStyleTabUtils = { if (!aTab) return null; var id = aTab.getAttribute(this.kID); if (!id) return null; // not initialized yet - var tab = this.evaluateXPath( - 'parent::*/child::xul:tab[contains(concat("|", @'+this.kCHILDREN+', "|"), "|'+id+'|")]', + return this.evaluateXPath( + 'preceding-sibling::xul:tab[contains(concat("|", @'+this.kCHILDREN+', "|"), "|'+id+'|")]', aTab, Ci.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE ).singleNodeValue; - return tab == aTab ? null : tab ; }, getRootTab : function TSTUtils_getRootTab(aTab) /* PUBLIC API */