diff --git a/content/base/public/nsINode.h b/content/base/public/nsINode.h index a4e02f7898d..10f69bc9db4 100644 --- a/content/base/public/nsINode.h +++ b/content/base/public/nsINode.h @@ -933,42 +933,6 @@ public: */ nsIDocument* GetOwnerDocument() const; - /** - * Iterator that can be used to easily iterate over the children. This has - * the same restrictions on its use as GetChildArray does. - */ - class ChildIterator { - public: - ChildIterator(const nsINode* aNode) { Init(aNode); } - ChildIterator(const nsINode* aNode, PRUint32 aOffset) { - Init(aNode); - Advance(aOffset); - } - ~ChildIterator() { - NS_ASSERTION(!mGuard.Mutated(0), "Unexpected mutations happened"); - } - - PRBool IsDone() const { return mCur == mEnd; } - operator nsIContent*() const { return *mCur; } - void Next() { NS_PRECONDITION(mCur != mEnd, "Check IsDone"); ++mCur; } - void Advance(PRUint32 aOffset) { - NS_ASSERTION(mCur + aOffset <= mEnd, "Unexpected offset"); - mCur += aOffset; - } - private: - void Init(const nsINode* aNode) { - NS_PRECONDITION(aNode, "Must have node here!"); - PRUint32 childCount; - mCur = aNode->GetChildArray(&childCount); - mEnd = mCur + childCount; - } -#ifdef DEBUG - nsMutationGuard mGuard; -#endif - nsIContent* const * mCur; - nsIContent* const * mEnd; - }; - /** * The default script type (language) ID for this node. * All nodes must support fetching the default script language. diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index b481b76d614..6e1cfd980f3 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -733,8 +733,10 @@ nsGenericHTMLElement::FireMutationEventsForDirectParsing(nsIDocument* aDoc, NS_ASSERTION(newChildCount - aOldChildCount >= 0, "What, some unexpected dom mutation has happened?"); childNodes.SetCapacity(newChildCount - aOldChildCount); - for (nsINode::ChildIterator iter(aDest); !iter.IsDone(); iter.Next()) { - childNodes.AppendElement(iter); + for (nsIContent* child = aDest->GetFirstChild(); + child; + child = child->GetNextSibling()) { + childNodes.AppendElement(child); } nsGenericElement::FireNodeInserted(aDoc, aDest, childNodes); } diff --git a/content/xul/templates/src/nsXULTemplateBuilder.cpp b/content/xul/templates/src/nsXULTemplateBuilder.cpp index c9e6f2a0213..8cd66466ec7 100644 --- a/content/xul/templates/src/nsXULTemplateBuilder.cpp +++ b/content/xul/templates/src/nsXULTemplateBuilder.cpp @@ -2127,9 +2127,10 @@ nsXULTemplateBuilder::DetermineMemberVariable(nsIContent* aElement) { // recursively iterate over the children looking for an element // with uri="?..." - for (nsINode::ChildIterator iter(aElement); !iter.IsDone(); iter.Next()) { + for (nsIContent* child = aElement->GetFirstChild(); + child; + child = child->GetNextSibling()) { nsAutoString uri; - nsIContent *child = iter; child->GetAttr(kNameSpaceID_None, nsGkAtoms::uri, uri); if (!uri.IsEmpty() && uri[0] == PRUnichar('?')) { return NS_NewAtom(uri);