Bug 454821. Better signature for GetChildArray. r+sr=sicking

This commit is contained in:
Boris Zbarsky
2008-12-03 09:02:03 -05:00
parent 1a82c3fce4
commit 79c71131a8
13 changed files with 30 additions and 25 deletions

View File

@@ -4839,9 +4839,9 @@ nsGenericElement::GetChildAt(PRUint32 aIndex) const
}
nsIContent * const *
nsGenericElement::GetChildArray() const
nsGenericElement::GetChildArray(PRUint32* aChildCount) const
{
return mAttrsAndChildren.GetChildArray();
return mAttrsAndChildren.GetChildArray(aChildCount);
}
PRInt32
@@ -5095,7 +5095,6 @@ TryMatchingElementsInSubtree(nsINode* aRoot,
ElementMatchedCallback aCallback,
void* aClosure)
{
PRUint32 count = aRoot->GetChildCount();
/* To improve the performance of '+' and '~' combinators and the :nth-*
* selectors, we keep track of the immediately previous sibling data. That's
* cheaper than heap-allocating all the datas and keeping track of them all,
@@ -5104,7 +5103,8 @@ TryMatchingElementsInSubtree(nsINode* aRoot,
char databuf[2 * sizeof(RuleProcessorData)];
RuleProcessorData* prevSibling = nsnull;
RuleProcessorData* data = reinterpret_cast<RuleProcessorData*>(databuf);
nsIContent * const * kidSlot = aRoot->GetChildArray();
PRUint32 count;
nsIContent * const * kidSlot = aRoot->GetChildArray(&count);
nsIContent * const * end = kidSlot + count;
#ifdef DEBUG