Bug 485808. Create an iterator class to do forward iteration over the result of GetChildArray(). r+sr=sicking
This commit is contained in:
@@ -173,6 +173,8 @@ NS_DEFINE_IID(kThisPtrOffsetsSID, NS_THISPTROFFSETS_SID);
|
||||
|
||||
PRInt32 nsIContent::sTabFocusModel = eTabFocus_any;
|
||||
PRBool nsIContent::sTabFocusModelAppliesToXUL = PR_FALSE;
|
||||
PRUint32 nsMutationGuard::sMutationCount = 0;
|
||||
|
||||
nsresult NS_NewContentIterator(nsIContentIterator** aInstancePtrResult);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -5123,17 +5125,10 @@ TryMatchingElementsInSubtree(nsINode* aRoot,
|
||||
char databuf[2 * sizeof(RuleProcessorData)];
|
||||
RuleProcessorData* prevSibling = nsnull;
|
||||
RuleProcessorData* data = reinterpret_cast<RuleProcessorData*>(databuf);
|
||||
PRUint32 count;
|
||||
nsIContent * const * kidSlot = aRoot->GetChildArray(&count);
|
||||
nsIContent * const * end = kidSlot + count;
|
||||
|
||||
#ifdef DEBUG
|
||||
nsMutationGuard debugMutationGuard;
|
||||
#endif
|
||||
|
||||
PRBool continueIteration = PR_TRUE;
|
||||
for (; kidSlot != end; ++kidSlot) {
|
||||
nsIContent* kid = *kidSlot;
|
||||
for (nsINode::ChildIterator iter(aRoot); !iter.IsDone(); iter.Next()) {
|
||||
nsIContent* kid = iter;
|
||||
if (!kid->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
continue;
|
||||
}
|
||||
@@ -5193,10 +5188,6 @@ TryMatchingElementsInSubtree(nsINode* aRoot,
|
||||
prevSibling->~RuleProcessorData();
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(!debugMutationGuard.Mutated(0), "Unexpected mutations happened");
|
||||
#endif
|
||||
|
||||
return continueIteration;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user