зеркало из https://github.com/mozilla/pjs.git
Bug 134295: Make position() work together with xsl:sort again. This will put back some problems with attribute-nodes, but those problems should be much less common then the current situation.
r=peterv sr=jst
This commit is contained in:
Родитель
277cd8403f
Коммит
95eff9cc70
|
@ -319,14 +319,17 @@ void NodeSet::reverse()
|
|||
* @param aNode the Node to get the index for
|
||||
* @return index of specified node or -1 if the node does not exist
|
||||
*/
|
||||
MBool NodeSet::indexOf(Node* aNode) const
|
||||
int NodeSet::indexOf(Node* aNode) const
|
||||
{
|
||||
// XXX evaluate cost of this
|
||||
// Workaround to fix the fact that attributes can't be
|
||||
// pointer-compared
|
||||
MBool nonDup;
|
||||
int pos = findPosition(aNode, 0, mElementCount - 1, nonDup);
|
||||
return nonDup ? -1 : pos;
|
||||
// XXX this doesn't fully work since attribute-nodes are broken
|
||||
// and can't be pointer-compared. However it's the best we can
|
||||
// do for now.
|
||||
int i;
|
||||
for (i = 0; i < mElementCount; ++i) {
|
||||
if (mElements[i] == aNode)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Загрузка…
Ссылка в новой задаче