getParentTabを最適化

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6421 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2010-03-24 12:52:29 +00:00
parent 57186260b2
commit dc97cf3cc1

View File

@ -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 */