diff --git a/layout/generic/nsHTMLContainerFrame.cpp b/layout/generic/nsHTMLContainerFrame.cpp index 6a99d103c4c..5b241b5830a 100644 --- a/layout/generic/nsHTMLContainerFrame.cpp +++ b/layout/generic/nsHTMLContainerFrame.cpp @@ -611,12 +611,12 @@ nsHTMLContainerFrame::ReparentFrameView(nsPresContext* aPresContext, } nsresult -nsHTMLContainerFrame::ReparentFrameViewList(nsPresContext* aPresContext, - nsIFrame* aChildFrameList, - nsIFrame* aOldParentFrame, - nsIFrame* aNewParentFrame) +nsHTMLContainerFrame::ReparentFrameViewList(nsPresContext* aPresContext, + const nsFrameList& aChildFrameList, + nsIFrame* aOldParentFrame, + nsIFrame* aNewParentFrame) { - NS_PRECONDITION(aChildFrameList, "null child frame list"); + NS_PRECONDITION(aChildFrameList.NotEmpty(), "empty child frame list"); NS_PRECONDITION(aOldParentFrame, "null old parent frame pointer"); NS_PRECONDITION(aNewParentFrame, "null new parent frame pointer"); NS_PRECONDITION(aOldParentFrame != aNewParentFrame, "same old and new parent frame"); @@ -665,9 +665,8 @@ nsHTMLContainerFrame::ReparentFrameViewList(nsPresContext* aPresContext, nsIViewManager* viewManager = oldParentView->GetViewManager(); // They're not so we need to reparent any child views - for (nsIFrame* f = aChildFrameList; f; f = f->GetNextSibling()) { - ReparentFrameViewTo(f, viewManager, newParentView, - oldParentView); + for (nsFrameList::Enumerator e(aChildFrameList); !e.AtEnd(); e.Next()) { + ReparentFrameViewTo(e.get(), viewManager, newParentView, oldParentView); } } diff --git a/layout/generic/nsHTMLContainerFrame.h b/layout/generic/nsHTMLContainerFrame.h index f5ee84d28dd..17501e37a7a 100644 --- a/layout/generic/nsHTMLContainerFrame.h +++ b/layout/generic/nsHTMLContainerFrame.h @@ -96,10 +96,10 @@ public: nsIFrame* aOldParentFrame, nsIFrame* aNewParentFrame); - static nsresult ReparentFrameViewList(nsPresContext* aPresContext, - nsIFrame* aChildFrameList, - nsIFrame* aOldParentFrame, - nsIFrame* aNewParentFrame); + static nsresult ReparentFrameViewList(nsPresContext* aPresContext, + const nsFrameList& aChildFrameList, + nsIFrame* aOldParentFrame, + nsIFrame* aNewParentFrame); /** * Displays the standard border, background and outline for the frame