diff --git a/mozilla/layout/base/src/nsContainerFrame.cpp b/mozilla/layout/base/src/nsContainerFrame.cpp index b29da3451b2..f89b29ce1fd 100644 --- a/mozilla/layout/base/src/nsContainerFrame.cpp +++ b/mozilla/layout/base/src/nsContainerFrame.cpp @@ -59,7 +59,6 @@ nsContainerFrame::Init(nsIPresContext& aPresContext, nsIFrame* aChildList) NS_PRECONDITION(nsnull == mFirstChild, "already initialized"); mFirstChild = aChildList; - mChildCount = LengthOf(mFirstChild); return NS_OK; } @@ -398,7 +397,6 @@ nsContainerFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, nsIFrame* // Delete the next-in-flow frame and adjust its parents child count WillDeleteNextInFlowFrame(nextInFlow); nextInFlow->DeleteFrame(aPresContext); - parent->mChildCount--; #ifdef NS_DEBUG aChild->GetNextInFlow(nextInFlow); @@ -445,10 +443,6 @@ void nsContainerFrame::PushChildren(nsIFrame* aFromChild, nsIFrame* aPrevSibling PRInt32 numChildren = 0; nsIFrame* lastChild = nsnull; -#ifdef NOISY - ListTag(stdout); - printf(": pushing kids (childCount=%d)\n", mChildCount); -#endif // Compute the number of children being pushed, and for each child change // its geometric parent. Remember the last child for (nsIFrame* f = aFromChild; nsnull != f; f->GetNextSibling(f)) { @@ -473,12 +467,7 @@ void nsContainerFrame::PushChildren(nsIFrame* aFromChild, nsIFrame* aPrevSibling // Prepend the frames to our next-in-flow's child list lastChild->SetNextSibling(nextInFlow->mFirstChild); nextInFlow->mFirstChild = aFromChild; - nextInFlow->mChildCount += numChildren; -#ifdef NOISY - ListTag(stdout); - printf(": push kids done (childCount=%d)\n", mChildCount); -#endif } else { // Add the frames to our overflow list NS_ASSERTION(nsnull == mOverflowList, "bad overflow list"); @@ -549,7 +538,6 @@ void nsContainerFrame::AppendChildren(nsIFrame* aChild, PRBool aSetParent) nsIFrame* lastChild; for (nsIFrame* f = aChild; nsnull != f; f->GetNextSibling(f)) { lastChild = f; - mChildCount++; // Reset the geometric parent if requested if (aSetParent) { @@ -642,17 +630,7 @@ NS_METHOD nsContainerFrame::VerifyTree() const { #ifdef NS_DEBUG NS_ASSERTION(0 == (mState & NS_FRAME_IN_REFLOW), "frame is in reflow"); - - // Check our child count - PRInt32 len = LengthOf(mFirstChild); - VERIFY_ASSERT(len == mChildCount, "bad child count"); - - nsIFrame* lastChild = LastFrame(mFirstChild); - if (len != 0) { - VERIFY_ASSERT(nsnull != lastChild, "bad last child"); - } VERIFY_ASSERT(nsnull == mOverflowList, "bad overflow list"); - #endif return NS_OK; } diff --git a/mozilla/layout/base/src/nsContainerFrame.h b/mozilla/layout/base/src/nsContainerFrame.h index d2703088fa0..9b32bc28405 100644 --- a/mozilla/layout/base/src/nsContainerFrame.h +++ b/mozilla/layout/base/src/nsContainerFrame.h @@ -169,7 +169,6 @@ protected: #endif nsIFrame* mFirstChild; - PRInt32 mChildCount; nsIFrame* mOverflowList; }; diff --git a/mozilla/layout/forms/nsFileControlFrame.cpp b/mozilla/layout/forms/nsFileControlFrame.cpp index 3cf840646b9..68dd250e68d 100644 --- a/mozilla/layout/forms/nsFileControlFrame.cpp +++ b/mozilla/layout/forms/nsFileControlFrame.cpp @@ -213,7 +213,6 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext, childFrame->SetStyleContext(&aPresContext, mStyleContext); mFirstChild->SetNextSibling(childFrame); - mChildCount = 2; NS_RELEASE(text); NS_RELEASE(browse); diff --git a/mozilla/layout/generic/nsFrameFrame.cpp b/mozilla/layout/generic/nsFrameFrame.cpp index 2eb4a43c60f..777cdc0d937 100644 --- a/mozilla/layout/generic/nsFrameFrame.cpp +++ b/mozilla/layout/generic/nsFrameFrame.cpp @@ -310,7 +310,6 @@ nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext, mFirstChild = new nsHTMLFrameInnerFrame(mContent, this); // XXX temporary! use style system to get correct style! mFirstChild->SetStyleContext(&aPresContext, mStyleContext); - mChildCount = 1; } // nsContainerFrame::PaintBorder has some problems, kludge it here diff --git a/mozilla/layout/generic/nsFrameSetFrame.h b/mozilla/layout/generic/nsFrameSetFrame.h index 1725eae0045..cfacbcae681 100644 --- a/mozilla/layout/generic/nsFrameSetFrame.h +++ b/mozilla/layout/generic/nsFrameSetFrame.h @@ -195,6 +195,7 @@ protected: nsHTMLFramesetBorderFrame* mDragger; nsPoint mLastDragPoint; PRInt32 mMinDrag; + PRInt32 mChildCount; }; #if 0 diff --git a/mozilla/layout/generic/nsHTMLContainerFrame.cpp b/mozilla/layout/generic/nsHTMLContainerFrame.cpp index 94f74c86e73..5a05d296a10 100644 --- a/mozilla/layout/generic/nsHTMLContainerFrame.cpp +++ b/mozilla/layout/generic/nsHTMLContainerFrame.cpp @@ -212,12 +212,6 @@ nsHTMLContainerFrame::ContentDeleted(nsIPresShell* aShell, flow->mFirstChild = nextSib; } - // Update flows child count and last-content-offset. Note that - // only the last content needs updating when a deadFrame is - // removed from flow (because only the children that follow the - // deletion need renumbering). - flow->mChildCount--; - // Break frame out of its flow and then destroy it nsIFrame* nextInFlow; deadFrame->GetNextInFlow(nextInFlow); diff --git a/mozilla/layout/html/base/src/nsBodyFrame.h b/mozilla/layout/html/base/src/nsBodyFrame.h index 298896e4b52..8161d36a3c7 100644 --- a/mozilla/layout/html/base/src/nsBodyFrame.h +++ b/mozilla/layout/html/base/src/nsBodyFrame.h @@ -113,6 +113,7 @@ protected: private: nsSpaceManager* mSpaceManager; nsVoidArray mAbsoluteItems; + PRInt32 mChildCount; nsSize GetColumnAvailSpace(nsIPresContext* aPresContext, const nsMargin& aBorderPadding, diff --git a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp b/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp index 94f74c86e73..5a05d296a10 100644 --- a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp +++ b/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp @@ -212,12 +212,6 @@ nsHTMLContainerFrame::ContentDeleted(nsIPresShell* aShell, flow->mFirstChild = nextSib; } - // Update flows child count and last-content-offset. Note that - // only the last content needs updating when a deadFrame is - // removed from flow (because only the children that follow the - // deletion need renumbering). - flow->mChildCount--; - // Break frame out of its flow and then destroy it nsIFrame* nextInFlow; deadFrame->GetNextInFlow(nextInFlow); diff --git a/mozilla/layout/html/base/src/nsScrollFrame.cpp b/mozilla/layout/html/base/src/nsScrollFrame.cpp index 2fb6f3284d7..7fd750b9a80 100644 --- a/mozilla/layout/html/base/src/nsScrollFrame.cpp +++ b/mozilla/layout/html/base/src/nsScrollFrame.cpp @@ -61,7 +61,6 @@ nsScrollBodyFrame::CreateFirstChild(nsIPresContext* aPresContext) if (aPresContext->IsPaginated()) { // Yes. Create the first page frame mFirstChild = new nsPageFrame(mContent, this);/* XXX mContent won't work here */ - mChildCount = 1; } else { if (nsnull != mContent) { #if 0 @@ -81,7 +80,6 @@ nsScrollBodyFrame::CreateFirstChild(nsIPresContext* aPresContext) } #else nsBodyFrame::NewFrame(&mFirstChild, mContent, this); - mChildCount = 1; #endif } } @@ -205,7 +203,6 @@ nsScrollBodyFrame::Reflow(nsIPresContext& aPresContext, NS_ASSERTION(nsnull == kidNextSibling, "unexpected sibling"); #endif kidFrame->SetNextSibling(continuingPage); - mChildCount++; } // Get the next page @@ -368,7 +365,6 @@ nsScrollInnerFrame::Reflow(nsIPresContext& aPresContext, if (nsnull == mFirstChild) { mFirstChild = new nsScrollBodyFrame(mContent, this); - mChildCount = 1; } // Allow the child frame to be as wide as our max width (minus a @@ -465,7 +461,6 @@ nsScrollOuterFrame::Reflow(nsIPresContext& aPresContext, if (nsnull == mFirstChild) { mFirstChild = new nsScrollInnerFrame(mContent, this); - mChildCount = 1; } const nsStyleSpacing* spacing = (const nsStyleSpacing*) diff --git a/mozilla/layout/html/document/src/nsFrameFrame.cpp b/mozilla/layout/html/document/src/nsFrameFrame.cpp index 2eb4a43c60f..777cdc0d937 100644 --- a/mozilla/layout/html/document/src/nsFrameFrame.cpp +++ b/mozilla/layout/html/document/src/nsFrameFrame.cpp @@ -310,7 +310,6 @@ nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext, mFirstChild = new nsHTMLFrameInnerFrame(mContent, this); // XXX temporary! use style system to get correct style! mFirstChild->SetStyleContext(&aPresContext, mStyleContext); - mChildCount = 1; } // nsContainerFrame::PaintBorder has some problems, kludge it here diff --git a/mozilla/layout/html/document/src/nsFrameSetFrame.h b/mozilla/layout/html/document/src/nsFrameSetFrame.h index 1725eae0045..cfacbcae681 100644 --- a/mozilla/layout/html/document/src/nsFrameSetFrame.h +++ b/mozilla/layout/html/document/src/nsFrameSetFrame.h @@ -195,6 +195,7 @@ protected: nsHTMLFramesetBorderFrame* mDragger; nsPoint mLastDragPoint; PRInt32 mMinDrag; + PRInt32 mChildCount; }; #if 0 diff --git a/mozilla/layout/html/forms/src/nsFileControlFrame.cpp b/mozilla/layout/html/forms/src/nsFileControlFrame.cpp index 3cf840646b9..68dd250e68d 100644 --- a/mozilla/layout/html/forms/src/nsFileControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFileControlFrame.cpp @@ -213,7 +213,6 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext, childFrame->SetStyleContext(&aPresContext, mStyleContext); mFirstChild->SetNextSibling(childFrame); - mChildCount = 2; NS_RELEASE(text); NS_RELEASE(browse);