diff --git a/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp b/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp index f2e24d3d51a..33cd037f8d5 100644 --- a/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp +++ b/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp @@ -1073,8 +1073,15 @@ HTMLStyleSheetImpl::ConstructRootFrame(nsIPresContext* aPresContext, // See if we're paginated if (aPresContext->IsPaginated()) { + // nsScrollFrame* scrollFrame; nsIFrame* pageSequenceFrame; +#if 0 + // Wrap the simple page sequence frame in a scroll frame + // XXX Only do this if it's print oreview + if NS_SUCCEEDED(NS_NewScrollFrame(aContent, aParentFrame, scrollFrame)) { +#endif + // Create a simple page sequence frame rv = NS_NewSimplePageSequenceFrame(aContent, aNewFrame, pageSequenceFrame); if (NS_SUCCEEDED(rv)) { @@ -1340,7 +1347,7 @@ HTMLStyleSheetImpl::GetAdjustedParentFrame(nsIFrame* aCurrentParentFrame, if (NS_STYLE_DISPLAY_TABLE_CAPTION!=aChildDisplayType) { nsIFrame *innerTableFrame=nsnull; - aCurrentParentFrame->FirstChild(innerTableFrame); + aCurrentParentFrame->FirstChild(nsnull, innerTableFrame); if (nsnull!=innerTableFrame) { const nsStyleDisplay* innerTableDisplay; @@ -1508,7 +1515,7 @@ HTMLStyleSheetImpl::GetFrameFor(nsIPresShell* aPresShell, nsIContent* aContent) frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display); if (display->IsBlockLevel() && IsScrollable(display)) { - frame->FirstChild(frame); + frame->FirstChild(nsnull, frame); } } diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index 806e2ef8ce5..f6d6408eeee 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -912,7 +912,7 @@ FindFrameWithContent(nsIFrame* aFrame, nsIContent* aContent) } NS_RELEASE(frameContent); - aFrame->FirstChild(aFrame); + aFrame->FirstChild(nsnull, aFrame); while (aFrame) { nsIFrame* result = FindFrameWithContent(aFrame, aContent); @@ -1043,8 +1043,8 @@ static void CompareTrees(nsIFrame* aA, nsIFrame* aB) { nsIFrame* k1, *k2; - aA->FirstChild(k1); - aB->FirstChild(k2); + aA->FirstChild(nsnull, k1); + aB->FirstChild(nsnull, k2); NS_ASSERTION(nsContainerFrame::LengthOf(k1) == nsContainerFrame::LengthOf(k2), "child counts don't match"); diff --git a/mozilla/layout/base/public/nsIFrame.h b/mozilla/layout/base/public/nsIFrame.h index b4f6b2522db..9a32fc8142a 100644 --- a/mozilla/layout/base/public/nsIFrame.h +++ b/mozilla/layout/base/public/nsIFrame.h @@ -111,11 +111,15 @@ typedef PRUint32 nsFrameState; * A frame in the layout model. This interface is supported by all frame * objects. * - * Frames are NOT reference counted. Use the DeleteFrame() member function - * to delete a frame. + * Frames can have multiple child lists: the default unnamed child list + * (referred to as the principal child list, and additional named + * child lists. There is an ordering of frames within a child list, but + * there is no order defined between frames in different child lists of + * the same parent frame. * - * The lifetime of the frame hierarchy is bounded by the lifetime of the - * presentation shell which owns the frames. + * Frames are NOT reference counted. Use the DeleteFrame() member function + * to delete a frame. The lifetime of the frame hierarchy is bounded by the + * lifetime of the presentation shell which owns the frames. */ class nsIFrame : public nsISupports { @@ -201,11 +205,18 @@ public: NS_IMETHOD SizeTo(nscoord aWidth, nscoord aHeight) = 0; /** - * Child frame enumeration. + * Get the first child frame from the specified child list. * - * Child frames are linked together in a singly-linked list. + * @param aListName the name of the child list. A NULL pointer for the atom + * name means the unnamed principal child list + * @return NS_ERROR_INVALID_ARG if there is no child list with the specified name + * @see #GetAdditionalListName() + */ + NS_IMETHOD FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const = 0; + + /** + * Child frames are linked together in a singly-linked */ - NS_IMETHOD FirstChild(nsIFrame*& aFirstChild) const = 0; NS_IMETHOD GetNextSibling(nsIFrame*& aNextSibling) const = 0; NS_IMETHOD SetNextSibling(nsIFrame* aNextSibling) = 0; diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index 2074f190b12..7e4b158e2bf 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -262,7 +262,7 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIFrame* aChildList); NS_IMETHOD ReResolveStyleContext(nsIPresContext* aPresContext, nsIStyleContext* aParentContext); - NS_IMETHOD FirstChild(nsIFrame*& aFirstChild) const; + NS_IMETHOD FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const; NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext); NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const; NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext, @@ -1839,10 +1839,15 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const // Child frame enumeration NS_IMETHODIMP -nsBlockFrame::FirstChild(nsIFrame*& aFirstChild) const +nsBlockFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const { - aFirstChild = (nsnull != mLines) ? mLines->mFirstChild : nsnull; - return NS_OK; + if (nsnull == aListName) { + aFirstChild = (nsnull != mLines) ? mLines->mFirstChild : nsnull; + return NS_OK; + } else { + aFirstChild = nsnull; + return NS_ERROR_INVALID_ARG; + } } ////////////////////////////////////////////////////////////////////// @@ -4064,7 +4069,7 @@ FindFloatersIn(nsIFrame* aFrame, nsVoidArray*& aArray) if (NS_STYLE_DISPLAY_INLINE == display->mDisplay) { nsIFrame* kid; - aFrame->FirstChild(kid); + aFrame->FirstChild(nsnull, kid); while (nsnull != kid) { nsresult rv = FindFloatersIn(kid, aArray); if (NS_OK != rv) { @@ -4376,7 +4381,7 @@ nsBlockFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, #ifdef NS_DEBUG PRInt32 childCount; nsIFrame* firstChild; - nextInFlow->FirstChild(firstChild); + nextInFlow->FirstChild(nsnull, firstChild); childCount = LengthOf(firstChild); NS_ASSERTION((0 == childCount) && (nsnull == firstChild), "deleting !empty next-in-flow"); @@ -4671,7 +4676,7 @@ nsBlockReflowState::IsLeftMostChild(nsIFrame* aFrame) // See if there are any non-zero sized child frames that precede // aFrame in the child list nsIFrame* child; - parent->FirstChild(child); + parent->FirstChild(nsnull, child); while ((nsnull != child) && (aFrame != child)) { nsSize size; diff --git a/mozilla/layout/generic/nsBlockReflowState.cpp b/mozilla/layout/generic/nsBlockReflowState.cpp index 2074f190b12..7e4b158e2bf 100644 --- a/mozilla/layout/generic/nsBlockReflowState.cpp +++ b/mozilla/layout/generic/nsBlockReflowState.cpp @@ -262,7 +262,7 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIFrame* aChildList); NS_IMETHOD ReResolveStyleContext(nsIPresContext* aPresContext, nsIStyleContext* aParentContext); - NS_IMETHOD FirstChild(nsIFrame*& aFirstChild) const; + NS_IMETHOD FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const; NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext); NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const; NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext, @@ -1839,10 +1839,15 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const // Child frame enumeration NS_IMETHODIMP -nsBlockFrame::FirstChild(nsIFrame*& aFirstChild) const +nsBlockFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const { - aFirstChild = (nsnull != mLines) ? mLines->mFirstChild : nsnull; - return NS_OK; + if (nsnull == aListName) { + aFirstChild = (nsnull != mLines) ? mLines->mFirstChild : nsnull; + return NS_OK; + } else { + aFirstChild = nsnull; + return NS_ERROR_INVALID_ARG; + } } ////////////////////////////////////////////////////////////////////// @@ -4064,7 +4069,7 @@ FindFloatersIn(nsIFrame* aFrame, nsVoidArray*& aArray) if (NS_STYLE_DISPLAY_INLINE == display->mDisplay) { nsIFrame* kid; - aFrame->FirstChild(kid); + aFrame->FirstChild(nsnull, kid); while (nsnull != kid) { nsresult rv = FindFloatersIn(kid, aArray); if (NS_OK != rv) { @@ -4376,7 +4381,7 @@ nsBlockFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, #ifdef NS_DEBUG PRInt32 childCount; nsIFrame* firstChild; - nextInFlow->FirstChild(firstChild); + nextInFlow->FirstChild(nsnull, firstChild); childCount = LengthOf(firstChild); NS_ASSERTION((0 == childCount) && (nsnull == firstChild), "deleting !empty next-in-flow"); @@ -4671,7 +4676,7 @@ nsBlockReflowState::IsLeftMostChild(nsIFrame* aFrame) // See if there are any non-zero sized child frames that precede // aFrame in the child list nsIFrame* child; - parent->FirstChild(child); + parent->FirstChild(nsnull, child); while ((nsnull != child) && (aFrame != child)) { nsSize size; diff --git a/mozilla/layout/generic/nsBlockReflowState.h b/mozilla/layout/generic/nsBlockReflowState.h index 2074f190b12..7e4b158e2bf 100644 --- a/mozilla/layout/generic/nsBlockReflowState.h +++ b/mozilla/layout/generic/nsBlockReflowState.h @@ -262,7 +262,7 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIFrame* aChildList); NS_IMETHOD ReResolveStyleContext(nsIPresContext* aPresContext, nsIStyleContext* aParentContext); - NS_IMETHOD FirstChild(nsIFrame*& aFirstChild) const; + NS_IMETHOD FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const; NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext); NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const; NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext, @@ -1839,10 +1839,15 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const // Child frame enumeration NS_IMETHODIMP -nsBlockFrame::FirstChild(nsIFrame*& aFirstChild) const +nsBlockFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const { - aFirstChild = (nsnull != mLines) ? mLines->mFirstChild : nsnull; - return NS_OK; + if (nsnull == aListName) { + aFirstChild = (nsnull != mLines) ? mLines->mFirstChild : nsnull; + return NS_OK; + } else { + aFirstChild = nsnull; + return NS_ERROR_INVALID_ARG; + } } ////////////////////////////////////////////////////////////////////// @@ -4064,7 +4069,7 @@ FindFloatersIn(nsIFrame* aFrame, nsVoidArray*& aArray) if (NS_STYLE_DISPLAY_INLINE == display->mDisplay) { nsIFrame* kid; - aFrame->FirstChild(kid); + aFrame->FirstChild(nsnull, kid); while (nsnull != kid) { nsresult rv = FindFloatersIn(kid, aArray); if (NS_OK != rv) { @@ -4376,7 +4381,7 @@ nsBlockFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, #ifdef NS_DEBUG PRInt32 childCount; nsIFrame* firstChild; - nextInFlow->FirstChild(firstChild); + nextInFlow->FirstChild(nsnull, firstChild); childCount = LengthOf(firstChild); NS_ASSERTION((0 == childCount) && (nsnull == firstChild), "deleting !empty next-in-flow"); @@ -4671,7 +4676,7 @@ nsBlockReflowState::IsLeftMostChild(nsIFrame* aFrame) // See if there are any non-zero sized child frames that precede // aFrame in the child list nsIFrame* child; - parent->FirstChild(child); + parent->FirstChild(nsnull, child); while ((nsnull != child) && (aFrame != child)) { nsSize size; diff --git a/mozilla/layout/generic/nsContainerFrame.cpp b/mozilla/layout/generic/nsContainerFrame.cpp index 507c59eeb34..63fc2148da7 100644 --- a/mozilla/layout/generic/nsContainerFrame.cpp +++ b/mozilla/layout/generic/nsContainerFrame.cpp @@ -118,7 +118,7 @@ nsContainerFrame::DidReflow(nsIPresContext& aPresContext, aStatus)); if (NS_FRAME_REFLOW_FINISHED == aStatus) { nsIFrame* kid; - FirstChild(kid); + FirstChild(nsnull, kid); while (nsnull != kid) { nsIHTMLReflow* htmlReflow; if (NS_OK == kid->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) { @@ -179,10 +179,17 @@ nsContainerFrame::GetCombinedRect(nsRect& aRect) ///////////////////////////////////////////////////////////////////////////// // Child frame enumeration -NS_METHOD nsContainerFrame::FirstChild(nsIFrame*& aFirstChild) const +NS_METHOD nsContainerFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const { - aFirstChild = mFirstChild; - return NS_OK; + // We only know about the unnamed principal child list + if (nsnull == aListName) { + aFirstChild = mFirstChild; + return NS_OK; + + } else { + aFirstChild = nsnull; + return NS_ERROR_INVALID_ARG; + } } ///////////////////////////////////////////////////////////////////////////// @@ -346,7 +353,7 @@ NS_METHOD nsContainerFrame::HandleEvent(nsIPresContext& aPresContext, aEventStatus = nsEventStatus_eIgnore; nsIFrame* kid; - FirstChild(kid); + FirstChild(nsnull, kid); while (nsnull != kid) { nsRect kidRect; kid->GetRect(kidRect); @@ -372,7 +379,7 @@ NS_METHOD nsContainerFrame::GetCursorAndContentAt(nsIPresContext& aPresContext, *aContent = mContent; nsIFrame* kid; - FirstChild(kid); + FirstChild(nsnull, kid); nsPoint tmp; while (nsnull != kid) { nsRect kidRect; @@ -472,7 +479,7 @@ nsContainerFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, nsIFrame* PRInt32 childCount; nsIFrame* firstChild; - nextInFlow->FirstChild(firstChild); + nextInFlow->FirstChild(nsnull, firstChild); childCount = LengthOf(firstChild); if ((0 != childCount) || (nsnull != firstChild)) { diff --git a/mozilla/layout/generic/nsContainerFrame.h b/mozilla/layout/generic/nsContainerFrame.h index d4fc5c03c0d..1f1392ac57f 100644 --- a/mozilla/layout/generic/nsContainerFrame.h +++ b/mozilla/layout/generic/nsContainerFrame.h @@ -55,9 +55,7 @@ public: PRInt32& aCursor); // Child frame enumeration. - // ChildAt() retruns null if the index is not in the range 0 .. ChildCount() - 1. - // IndexOf() returns -1 if the frame is not in the child list. - NS_IMETHOD FirstChild(nsIFrame*& aFirstChild) const; + NS_IMETHOD FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const; // re-resolve style context for self and children as necessary // Subclasses need to override if they add child lists or diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index e9e7b2cc127..e9338f341c3 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -524,10 +524,10 @@ NS_IMETHODIMP nsFrame::SizeTo(nscoord aWidth, nscoord aHeight) // Child frame enumeration -NS_IMETHODIMP nsFrame::FirstChild(nsIFrame*& aFirstChild) const +NS_IMETHODIMP nsFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const { aFirstChild = nsnull; - return NS_OK; + return nsnull == aListName ? NS_OK : NS_ERROR_INVALID_ARG; } PRBool nsFrame::DisplaySelection(nsIPresContext& aPresContext, PRBool isOkToTurnOn) @@ -1658,7 +1658,7 @@ void RefreshAllContentFrames(nsIFrame * aFrame, nsIContent * aContent) } NS_RELEASE(frameContent); - aFrame->FirstChild(aFrame); + aFrame->FirstChild(nsnull, aFrame); while (aFrame) { RefreshAllContentFrames(aFrame, aContent); aFrame->GetNextSibling(aFrame); diff --git a/mozilla/layout/generic/nsFrame.h b/mozilla/layout/generic/nsFrame.h index 4c8aa089872..3f3fc2b1c31 100644 --- a/mozilla/layout/generic/nsFrame.h +++ b/mozilla/layout/generic/nsFrame.h @@ -133,7 +133,7 @@ public: NS_IMETHOD SetRect(const nsRect& aRect); NS_IMETHOD MoveTo(nscoord aX, nscoord aY); NS_IMETHOD SizeTo(nscoord aWidth, nscoord aHeight); - NS_IMETHOD FirstChild(nsIFrame*& aFirstChild) const; + NS_IMETHOD FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const; NS_IMETHOD Paint(nsIPresContext& aPresContext, nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect); diff --git a/mozilla/layout/generic/nsIFrame.h b/mozilla/layout/generic/nsIFrame.h index b4f6b2522db..9a32fc8142a 100644 --- a/mozilla/layout/generic/nsIFrame.h +++ b/mozilla/layout/generic/nsIFrame.h @@ -111,11 +111,15 @@ typedef PRUint32 nsFrameState; * A frame in the layout model. This interface is supported by all frame * objects. * - * Frames are NOT reference counted. Use the DeleteFrame() member function - * to delete a frame. + * Frames can have multiple child lists: the default unnamed child list + * (referred to as the principal child list, and additional named + * child lists. There is an ordering of frames within a child list, but + * there is no order defined between frames in different child lists of + * the same parent frame. * - * The lifetime of the frame hierarchy is bounded by the lifetime of the - * presentation shell which owns the frames. + * Frames are NOT reference counted. Use the DeleteFrame() member function + * to delete a frame. The lifetime of the frame hierarchy is bounded by the + * lifetime of the presentation shell which owns the frames. */ class nsIFrame : public nsISupports { @@ -201,11 +205,18 @@ public: NS_IMETHOD SizeTo(nscoord aWidth, nscoord aHeight) = 0; /** - * Child frame enumeration. + * Get the first child frame from the specified child list. * - * Child frames are linked together in a singly-linked list. + * @param aListName the name of the child list. A NULL pointer for the atom + * name means the unnamed principal child list + * @return NS_ERROR_INVALID_ARG if there is no child list with the specified name + * @see #GetAdditionalListName() + */ + NS_IMETHOD FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const = 0; + + /** + * Child frames are linked together in a singly-linked */ - NS_IMETHOD FirstChild(nsIFrame*& aFirstChild) const = 0; NS_IMETHOD GetNextSibling(nsIFrame*& aNextSibling) const = 0; NS_IMETHOD SetNextSibling(nsIFrame* aNextSibling) = 0; diff --git a/mozilla/layout/html/base/src/nsAbsoluteFrame.cpp b/mozilla/layout/html/base/src/nsAbsoluteFrame.cpp index 3424a9b4da8..74fa8060faa 100644 --- a/mozilla/layout/html/base/src/nsAbsoluteFrame.cpp +++ b/mozilla/layout/html/base/src/nsAbsoluteFrame.cpp @@ -147,7 +147,7 @@ nsIFrame* nsAbsoluteFrame::GetContainingBlock() const // nsIAbsoluteItems // XXX This is pretty yucky, but there isn't currently a better way to do // this... - lastFrame->FirstChild(result); + lastFrame->FirstChild(nsnull, result); while (nsnull != result) { nsIAbsoluteItems* interface; @@ -155,7 +155,7 @@ nsIFrame* nsAbsoluteFrame::GetContainingBlock() const break; } - result->FirstChild(result); + result->FirstChild(nsnull, result); } } diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index 2074f190b12..7e4b158e2bf 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -262,7 +262,7 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIFrame* aChildList); NS_IMETHOD ReResolveStyleContext(nsIPresContext* aPresContext, nsIStyleContext* aParentContext); - NS_IMETHOD FirstChild(nsIFrame*& aFirstChild) const; + NS_IMETHOD FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const; NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext); NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const; NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext, @@ -1839,10 +1839,15 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const // Child frame enumeration NS_IMETHODIMP -nsBlockFrame::FirstChild(nsIFrame*& aFirstChild) const +nsBlockFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const { - aFirstChild = (nsnull != mLines) ? mLines->mFirstChild : nsnull; - return NS_OK; + if (nsnull == aListName) { + aFirstChild = (nsnull != mLines) ? mLines->mFirstChild : nsnull; + return NS_OK; + } else { + aFirstChild = nsnull; + return NS_ERROR_INVALID_ARG; + } } ////////////////////////////////////////////////////////////////////// @@ -4064,7 +4069,7 @@ FindFloatersIn(nsIFrame* aFrame, nsVoidArray*& aArray) if (NS_STYLE_DISPLAY_INLINE == display->mDisplay) { nsIFrame* kid; - aFrame->FirstChild(kid); + aFrame->FirstChild(nsnull, kid); while (nsnull != kid) { nsresult rv = FindFloatersIn(kid, aArray); if (NS_OK != rv) { @@ -4376,7 +4381,7 @@ nsBlockFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, #ifdef NS_DEBUG PRInt32 childCount; nsIFrame* firstChild; - nextInFlow->FirstChild(firstChild); + nextInFlow->FirstChild(nsnull, firstChild); childCount = LengthOf(firstChild); NS_ASSERTION((0 == childCount) && (nsnull == firstChild), "deleting !empty next-in-flow"); @@ -4671,7 +4676,7 @@ nsBlockReflowState::IsLeftMostChild(nsIFrame* aFrame) // See if there are any non-zero sized child frames that precede // aFrame in the child list nsIFrame* child; - parent->FirstChild(child); + parent->FirstChild(nsnull, child); while ((nsnull != child) && (aFrame != child)) { nsSize size; diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.cpp b/mozilla/layout/html/base/src/nsBlockReflowState.cpp index 2074f190b12..7e4b158e2bf 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowState.cpp @@ -262,7 +262,7 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIFrame* aChildList); NS_IMETHOD ReResolveStyleContext(nsIPresContext* aPresContext, nsIStyleContext* aParentContext); - NS_IMETHOD FirstChild(nsIFrame*& aFirstChild) const; + NS_IMETHOD FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const; NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext); NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const; NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext, @@ -1839,10 +1839,15 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const // Child frame enumeration NS_IMETHODIMP -nsBlockFrame::FirstChild(nsIFrame*& aFirstChild) const +nsBlockFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const { - aFirstChild = (nsnull != mLines) ? mLines->mFirstChild : nsnull; - return NS_OK; + if (nsnull == aListName) { + aFirstChild = (nsnull != mLines) ? mLines->mFirstChild : nsnull; + return NS_OK; + } else { + aFirstChild = nsnull; + return NS_ERROR_INVALID_ARG; + } } ////////////////////////////////////////////////////////////////////// @@ -4064,7 +4069,7 @@ FindFloatersIn(nsIFrame* aFrame, nsVoidArray*& aArray) if (NS_STYLE_DISPLAY_INLINE == display->mDisplay) { nsIFrame* kid; - aFrame->FirstChild(kid); + aFrame->FirstChild(nsnull, kid); while (nsnull != kid) { nsresult rv = FindFloatersIn(kid, aArray); if (NS_OK != rv) { @@ -4376,7 +4381,7 @@ nsBlockFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, #ifdef NS_DEBUG PRInt32 childCount; nsIFrame* firstChild; - nextInFlow->FirstChild(firstChild); + nextInFlow->FirstChild(nsnull, firstChild); childCount = LengthOf(firstChild); NS_ASSERTION((0 == childCount) && (nsnull == firstChild), "deleting !empty next-in-flow"); @@ -4671,7 +4676,7 @@ nsBlockReflowState::IsLeftMostChild(nsIFrame* aFrame) // See if there are any non-zero sized child frames that precede // aFrame in the child list nsIFrame* child; - parent->FirstChild(child); + parent->FirstChild(nsnull, child); while ((nsnull != child) && (aFrame != child)) { nsSize size; diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.h b/mozilla/layout/html/base/src/nsBlockReflowState.h index 2074f190b12..7e4b158e2bf 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.h +++ b/mozilla/layout/html/base/src/nsBlockReflowState.h @@ -262,7 +262,7 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIFrame* aChildList); NS_IMETHOD ReResolveStyleContext(nsIPresContext* aPresContext, nsIStyleContext* aParentContext); - NS_IMETHOD FirstChild(nsIFrame*& aFirstChild) const; + NS_IMETHOD FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const; NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext); NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const; NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext, @@ -1839,10 +1839,15 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const // Child frame enumeration NS_IMETHODIMP -nsBlockFrame::FirstChild(nsIFrame*& aFirstChild) const +nsBlockFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const { - aFirstChild = (nsnull != mLines) ? mLines->mFirstChild : nsnull; - return NS_OK; + if (nsnull == aListName) { + aFirstChild = (nsnull != mLines) ? mLines->mFirstChild : nsnull; + return NS_OK; + } else { + aFirstChild = nsnull; + return NS_ERROR_INVALID_ARG; + } } ////////////////////////////////////////////////////////////////////// @@ -4064,7 +4069,7 @@ FindFloatersIn(nsIFrame* aFrame, nsVoidArray*& aArray) if (NS_STYLE_DISPLAY_INLINE == display->mDisplay) { nsIFrame* kid; - aFrame->FirstChild(kid); + aFrame->FirstChild(nsnull, kid); while (nsnull != kid) { nsresult rv = FindFloatersIn(kid, aArray); if (NS_OK != rv) { @@ -4376,7 +4381,7 @@ nsBlockFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, #ifdef NS_DEBUG PRInt32 childCount; nsIFrame* firstChild; - nextInFlow->FirstChild(firstChild); + nextInFlow->FirstChild(nsnull, firstChild); childCount = LengthOf(firstChild); NS_ASSERTION((0 == childCount) && (nsnull == firstChild), "deleting !empty next-in-flow"); @@ -4671,7 +4676,7 @@ nsBlockReflowState::IsLeftMostChild(nsIFrame* aFrame) // See if there are any non-zero sized child frames that precede // aFrame in the child list nsIFrame* child; - parent->FirstChild(child); + parent->FirstChild(nsnull, child); while ((nsnull != child) && (aFrame != child)) { nsSize size; diff --git a/mozilla/layout/html/base/src/nsContainerFrame.cpp b/mozilla/layout/html/base/src/nsContainerFrame.cpp index 507c59eeb34..63fc2148da7 100644 --- a/mozilla/layout/html/base/src/nsContainerFrame.cpp +++ b/mozilla/layout/html/base/src/nsContainerFrame.cpp @@ -118,7 +118,7 @@ nsContainerFrame::DidReflow(nsIPresContext& aPresContext, aStatus)); if (NS_FRAME_REFLOW_FINISHED == aStatus) { nsIFrame* kid; - FirstChild(kid); + FirstChild(nsnull, kid); while (nsnull != kid) { nsIHTMLReflow* htmlReflow; if (NS_OK == kid->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) { @@ -179,10 +179,17 @@ nsContainerFrame::GetCombinedRect(nsRect& aRect) ///////////////////////////////////////////////////////////////////////////// // Child frame enumeration -NS_METHOD nsContainerFrame::FirstChild(nsIFrame*& aFirstChild) const +NS_METHOD nsContainerFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const { - aFirstChild = mFirstChild; - return NS_OK; + // We only know about the unnamed principal child list + if (nsnull == aListName) { + aFirstChild = mFirstChild; + return NS_OK; + + } else { + aFirstChild = nsnull; + return NS_ERROR_INVALID_ARG; + } } ///////////////////////////////////////////////////////////////////////////// @@ -346,7 +353,7 @@ NS_METHOD nsContainerFrame::HandleEvent(nsIPresContext& aPresContext, aEventStatus = nsEventStatus_eIgnore; nsIFrame* kid; - FirstChild(kid); + FirstChild(nsnull, kid); while (nsnull != kid) { nsRect kidRect; kid->GetRect(kidRect); @@ -372,7 +379,7 @@ NS_METHOD nsContainerFrame::GetCursorAndContentAt(nsIPresContext& aPresContext, *aContent = mContent; nsIFrame* kid; - FirstChild(kid); + FirstChild(nsnull, kid); nsPoint tmp; while (nsnull != kid) { nsRect kidRect; @@ -472,7 +479,7 @@ nsContainerFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, nsIFrame* PRInt32 childCount; nsIFrame* firstChild; - nextInFlow->FirstChild(firstChild); + nextInFlow->FirstChild(nsnull, firstChild); childCount = LengthOf(firstChild); if ((0 != childCount) || (nsnull != firstChild)) { diff --git a/mozilla/layout/html/base/src/nsContainerFrame.h b/mozilla/layout/html/base/src/nsContainerFrame.h index d4fc5c03c0d..1f1392ac57f 100644 --- a/mozilla/layout/html/base/src/nsContainerFrame.h +++ b/mozilla/layout/html/base/src/nsContainerFrame.h @@ -55,9 +55,7 @@ public: PRInt32& aCursor); // Child frame enumeration. - // ChildAt() retruns null if the index is not in the range 0 .. ChildCount() - 1. - // IndexOf() returns -1 if the frame is not in the child list. - NS_IMETHOD FirstChild(nsIFrame*& aFirstChild) const; + NS_IMETHOD FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const; // re-resolve style context for self and children as necessary // Subclasses need to override if they add child lists or diff --git a/mozilla/layout/html/base/src/nsFrame.cpp b/mozilla/layout/html/base/src/nsFrame.cpp index e9e7b2cc127..e9338f341c3 100644 --- a/mozilla/layout/html/base/src/nsFrame.cpp +++ b/mozilla/layout/html/base/src/nsFrame.cpp @@ -524,10 +524,10 @@ NS_IMETHODIMP nsFrame::SizeTo(nscoord aWidth, nscoord aHeight) // Child frame enumeration -NS_IMETHODIMP nsFrame::FirstChild(nsIFrame*& aFirstChild) const +NS_IMETHODIMP nsFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const { aFirstChild = nsnull; - return NS_OK; + return nsnull == aListName ? NS_OK : NS_ERROR_INVALID_ARG; } PRBool nsFrame::DisplaySelection(nsIPresContext& aPresContext, PRBool isOkToTurnOn) @@ -1658,7 +1658,7 @@ void RefreshAllContentFrames(nsIFrame * aFrame, nsIContent * aContent) } NS_RELEASE(frameContent); - aFrame->FirstChild(aFrame); + aFrame->FirstChild(nsnull, aFrame); while (aFrame) { RefreshAllContentFrames(aFrame, aContent); aFrame->GetNextSibling(aFrame); diff --git a/mozilla/layout/html/base/src/nsFrame.h b/mozilla/layout/html/base/src/nsFrame.h index 4c8aa089872..3f3fc2b1c31 100644 --- a/mozilla/layout/html/base/src/nsFrame.h +++ b/mozilla/layout/html/base/src/nsFrame.h @@ -133,7 +133,7 @@ public: NS_IMETHOD SetRect(const nsRect& aRect); NS_IMETHOD MoveTo(nscoord aX, nscoord aY); NS_IMETHOD SizeTo(nscoord aWidth, nscoord aHeight); - NS_IMETHOD FirstChild(nsIFrame*& aFirstChild) const; + NS_IMETHOD FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const; NS_IMETHOD Paint(nsIPresContext& aPresContext, nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect); diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index 806e2ef8ce5..f6d6408eeee 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -912,7 +912,7 @@ FindFrameWithContent(nsIFrame* aFrame, nsIContent* aContent) } NS_RELEASE(frameContent); - aFrame->FirstChild(aFrame); + aFrame->FirstChild(nsnull, aFrame); while (aFrame) { nsIFrame* result = FindFrameWithContent(aFrame, aContent); @@ -1043,8 +1043,8 @@ static void CompareTrees(nsIFrame* aA, nsIFrame* aB) { nsIFrame* k1, *k2; - aA->FirstChild(k1); - aB->FirstChild(k2); + aA->FirstChild(nsnull, k1); + aB->FirstChild(nsnull, k2); NS_ASSERTION(nsContainerFrame::LengthOf(k1) == nsContainerFrame::LengthOf(k2), "child counts don't match"); diff --git a/mozilla/layout/html/forms/src/nsLabelFrame.cpp b/mozilla/layout/html/forms/src/nsLabelFrame.cpp index 4dc236e13b2..329feaec7f5 100644 --- a/mozilla/layout/html/forms/src/nsLabelFrame.cpp +++ b/mozilla/layout/html/forms/src/nsLabelFrame.cpp @@ -371,7 +371,7 @@ PRBool nsLabelFrame::FindFirstControl(nsIFrame* aParentFrame, nsIFormControlFrame*& aResultFrame) { nsIFrame* child = nsnull; - aParentFrame->FirstChild(child); + aParentFrame->FirstChild(nsnull, child); while (nsnull != child) { nsIFormControlFrame* fcFrame = nsnull; nsresult result = child->QueryInterface(kIFormControlFrameIID, (void**)&fcFrame); diff --git a/mozilla/layout/html/style/src/nsHTMLStyleSheet.cpp b/mozilla/layout/html/style/src/nsHTMLStyleSheet.cpp index f2e24d3d51a..33cd037f8d5 100644 --- a/mozilla/layout/html/style/src/nsHTMLStyleSheet.cpp +++ b/mozilla/layout/html/style/src/nsHTMLStyleSheet.cpp @@ -1073,8 +1073,15 @@ HTMLStyleSheetImpl::ConstructRootFrame(nsIPresContext* aPresContext, // See if we're paginated if (aPresContext->IsPaginated()) { + // nsScrollFrame* scrollFrame; nsIFrame* pageSequenceFrame; +#if 0 + // Wrap the simple page sequence frame in a scroll frame + // XXX Only do this if it's print oreview + if NS_SUCCEEDED(NS_NewScrollFrame(aContent, aParentFrame, scrollFrame)) { +#endif + // Create a simple page sequence frame rv = NS_NewSimplePageSequenceFrame(aContent, aNewFrame, pageSequenceFrame); if (NS_SUCCEEDED(rv)) { @@ -1340,7 +1347,7 @@ HTMLStyleSheetImpl::GetAdjustedParentFrame(nsIFrame* aCurrentParentFrame, if (NS_STYLE_DISPLAY_TABLE_CAPTION!=aChildDisplayType) { nsIFrame *innerTableFrame=nsnull; - aCurrentParentFrame->FirstChild(innerTableFrame); + aCurrentParentFrame->FirstChild(nsnull, innerTableFrame); if (nsnull!=innerTableFrame) { const nsStyleDisplay* innerTableDisplay; @@ -1508,7 +1515,7 @@ HTMLStyleSheetImpl::GetFrameFor(nsIPresShell* aPresShell, nsIContent* aContent) frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display); if (display->IsBlockLevel() && IsScrollable(display)) { - frame->FirstChild(frame); + frame->FirstChild(nsnull, frame); } } diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index a01287396dd..fa0001a9da4 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -324,7 +324,7 @@ NS_IMETHODIMP nsTableFrame::DidAppendRowGroup(nsTableRowGroupFrame *aRowGroupFra { nsresult rv=NS_OK; nsIFrame *nextRow=nsnull; - aRowGroupFrame->FirstChild(nextRow); + aRowGroupFrame->FirstChild(nsnull, nextRow); for ( ; nsnull!=nextRow; nextRow->GetNextSibling(nextRow)) { const nsStyleDisplay *rowDisplay; @@ -909,7 +909,7 @@ NS_METHOD nsTableFrame::ReBuildCellMap() if (PR_TRUE==IsRowGroup(rowGroupDisplay->mDisplay)) { nsIFrame *rowFrame; - rowGroupFrame->FirstChild(rowFrame); + rowGroupFrame->FirstChild(nsnull, rowFrame); for ( ; nsnull!=rowFrame; rowFrame->GetNextSibling(rowFrame)) { const nsStyleDisplay *rowDisplay; @@ -2887,7 +2887,7 @@ NS_METHOD nsTableFrame::GetColumnFrame(PRInt32 aColIndex, nsTableColFrame *&aCol else { // ah shucks, we have to go hunt for the column frame brute-force style nsIFrame *childFrame; - FirstChild(childFrame); + FirstChild(nsnull, childFrame); for (;;) { if (nsnull==childFrame) @@ -2958,7 +2958,7 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext, if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == childDisplay->mDisplay) { // if it's a col group then get the columns and cache them in the CellMap nsTableColFrame *colFrame=nsnull; - childFrame->FirstChild((nsIFrame *&)colFrame); + childFrame->FirstChild(nsnull, (nsIFrame *&)colFrame); while (nsnull!=colFrame) { nsTableColFrame *cachedColFrame = mCellMap->GetColumnFrame(colIndex); @@ -2976,7 +2976,7 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext, if (PR_TRUE==RequiresPass1Layout()) { nsIFrame *rowFrame; - childFrame->FirstChild(rowFrame); + childFrame->FirstChild(nsnull, rowFrame); while (nsnull!=rowFrame) { const nsStyleDisplay *rowDisplay; @@ -2984,7 +2984,7 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext, if (NS_STYLE_DISPLAY_TABLE_ROW == rowDisplay->mDisplay) { nsIFrame *cellFrame; - rowFrame->FirstChild(cellFrame); + rowFrame->FirstChild(nsnull, cellFrame); while (nsnull!=cellFrame) { /* this is the first time we are guaranteed to have both the cell frames @@ -3015,7 +3015,7 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext, if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == childDisplay->mDisplay) { nsTableColFrame *colFrame=nsnull; - childFrame->FirstChild((nsIFrame *&)colFrame); + childFrame->FirstChild(nsnull, (nsIFrame *&)colFrame); while (nsnull!=colFrame) { // for every column, create an entry in the column cache // assumes that the col style has been twiddled to account for first cell width attribute @@ -3102,7 +3102,7 @@ void nsTableFrame::InvalidateCellMap() if (PR_TRUE==IsRowGroup(rowGroupDisplay->mDisplay)) { nsIFrame *rowFrame; - rowGroupFrame->FirstChild(rowFrame); + rowGroupFrame->FirstChild(nsnull, rowFrame); for ( ; nsnull!=rowFrame; rowFrame->GetNextSibling(rowFrame)) { const nsStyleDisplay *rowDisplay; @@ -3135,7 +3135,7 @@ nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext, // add headers and footers to cf nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); nsIFrame * rg = nsnull; - firstInFlow->FirstChild(rg); + firstInFlow->FirstChild(nsnull, rg); NS_ASSERTION (nsnull!=rg, "previous frame has no children"); PRInt32 index = 0; nsIFrame * bodyRowGroupFromOverflow = mOverflowList; @@ -3427,7 +3427,7 @@ NS_METHOD nsTableFrame::GetTableFrame(nsIFrame *aSourceFrame, nsTableFrame *& aT // if found, the childFrame must be the inner frame nsresult rv; nsIFrame *childFrame=nsnull; - rv = aTableFrame->FirstChild(childFrame); + rv = aTableFrame->FirstChild(nsnull, childFrame); while ((NS_OK==rv) && (nsnull!=childFrame)) { const nsStyleDisplay *childDisplay; diff --git a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp index 478abd827bf..39a0236c45c 100644 --- a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp @@ -1213,7 +1213,7 @@ PRBool nsTableOuterFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, n PRInt32 childCount; nsIFrame* firstChild; - nextInFlow->FirstChild(firstChild); + nextInFlow->FirstChild(nsnull, firstChild); childCount = LengthOf(firstChild); NS_ASSERTION(childCount == 0, "deleting !empty next-in-flow"); diff --git a/mozilla/layout/html/table/src/nsTableRowFrame.cpp b/mozilla/layout/html/table/src/nsTableRowFrame.cpp index b8f9444cb6b..34f5080d11e 100644 --- a/mozilla/layout/html/table/src/nsTableRowFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableRowFrame.cpp @@ -1393,7 +1393,7 @@ PRBool nsTableRowFrame::Contains(nsPoint& aPoint) // if that fails, check the cells, they might span outside the row rect else { nsIFrame* kid; - FirstChild(kid); + FirstChild(nsnull, kid); while (nsnull != kid) { nsRect kidRect; kid->GetRect(kidRect); diff --git a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp index 30c7c86d508..22c06a2bdd0 100644 --- a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp @@ -240,7 +240,7 @@ NS_METHOD nsTableRowGroupFrame::HandleEvent(nsIPresContext& aPresContext, aEventStatus = nsEventStatus_eIgnore; nsIFrame* kid; - FirstChild(kid); + FirstChild(nsnull, kid); while (nsnull != kid) { nsRect kidRect; kid->GetRect(kidRect); @@ -694,7 +694,7 @@ void nsTableRowGroupFrame::ShrinkWrapChildren(nsIPresContext* aPresContext, if (gsDebug) printf("TRGF SWC: for row %p...\n", rowFrame); // check this row for a cell with rowspans nsIFrame *cellFrame; - rowFrame->FirstChild(cellFrame); + rowFrame->FirstChild(nsnull, cellFrame); while (nsnull != cellFrame) { const nsStyleDisplay *childDisplay; @@ -1109,7 +1109,7 @@ PRBool nsTableRowGroupFrame::NoRowsFollow() (NS_STYLE_DISPLAY_TABLE_ROW_GROUP == sibDisplay->mDisplay)) { nsIFrame *childFrame=nsnull; - nextSib->FirstChild(childFrame); + nextSib->FirstChild(nsnull, childFrame); while (nsnull!=childFrame) { const nsStyleDisplay *childDisplay; diff --git a/mozilla/layout/style/nsHTMLStyleSheet.cpp b/mozilla/layout/style/nsHTMLStyleSheet.cpp index f2e24d3d51a..33cd037f8d5 100644 --- a/mozilla/layout/style/nsHTMLStyleSheet.cpp +++ b/mozilla/layout/style/nsHTMLStyleSheet.cpp @@ -1073,8 +1073,15 @@ HTMLStyleSheetImpl::ConstructRootFrame(nsIPresContext* aPresContext, // See if we're paginated if (aPresContext->IsPaginated()) { + // nsScrollFrame* scrollFrame; nsIFrame* pageSequenceFrame; +#if 0 + // Wrap the simple page sequence frame in a scroll frame + // XXX Only do this if it's print oreview + if NS_SUCCEEDED(NS_NewScrollFrame(aContent, aParentFrame, scrollFrame)) { +#endif + // Create a simple page sequence frame rv = NS_NewSimplePageSequenceFrame(aContent, aNewFrame, pageSequenceFrame); if (NS_SUCCEEDED(rv)) { @@ -1340,7 +1347,7 @@ HTMLStyleSheetImpl::GetAdjustedParentFrame(nsIFrame* aCurrentParentFrame, if (NS_STYLE_DISPLAY_TABLE_CAPTION!=aChildDisplayType) { nsIFrame *innerTableFrame=nsnull; - aCurrentParentFrame->FirstChild(innerTableFrame); + aCurrentParentFrame->FirstChild(nsnull, innerTableFrame); if (nsnull!=innerTableFrame) { const nsStyleDisplay* innerTableDisplay; @@ -1508,7 +1515,7 @@ HTMLStyleSheetImpl::GetFrameFor(nsIPresShell* aPresShell, nsIContent* aContent) frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display); if (display->IsBlockLevel() && IsScrollable(display)) { - frame->FirstChild(frame); + frame->FirstChild(nsnull, frame); } } diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index a01287396dd..fa0001a9da4 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -324,7 +324,7 @@ NS_IMETHODIMP nsTableFrame::DidAppendRowGroup(nsTableRowGroupFrame *aRowGroupFra { nsresult rv=NS_OK; nsIFrame *nextRow=nsnull; - aRowGroupFrame->FirstChild(nextRow); + aRowGroupFrame->FirstChild(nsnull, nextRow); for ( ; nsnull!=nextRow; nextRow->GetNextSibling(nextRow)) { const nsStyleDisplay *rowDisplay; @@ -909,7 +909,7 @@ NS_METHOD nsTableFrame::ReBuildCellMap() if (PR_TRUE==IsRowGroup(rowGroupDisplay->mDisplay)) { nsIFrame *rowFrame; - rowGroupFrame->FirstChild(rowFrame); + rowGroupFrame->FirstChild(nsnull, rowFrame); for ( ; nsnull!=rowFrame; rowFrame->GetNextSibling(rowFrame)) { const nsStyleDisplay *rowDisplay; @@ -2887,7 +2887,7 @@ NS_METHOD nsTableFrame::GetColumnFrame(PRInt32 aColIndex, nsTableColFrame *&aCol else { // ah shucks, we have to go hunt for the column frame brute-force style nsIFrame *childFrame; - FirstChild(childFrame); + FirstChild(nsnull, childFrame); for (;;) { if (nsnull==childFrame) @@ -2958,7 +2958,7 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext, if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == childDisplay->mDisplay) { // if it's a col group then get the columns and cache them in the CellMap nsTableColFrame *colFrame=nsnull; - childFrame->FirstChild((nsIFrame *&)colFrame); + childFrame->FirstChild(nsnull, (nsIFrame *&)colFrame); while (nsnull!=colFrame) { nsTableColFrame *cachedColFrame = mCellMap->GetColumnFrame(colIndex); @@ -2976,7 +2976,7 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext, if (PR_TRUE==RequiresPass1Layout()) { nsIFrame *rowFrame; - childFrame->FirstChild(rowFrame); + childFrame->FirstChild(nsnull, rowFrame); while (nsnull!=rowFrame) { const nsStyleDisplay *rowDisplay; @@ -2984,7 +2984,7 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext, if (NS_STYLE_DISPLAY_TABLE_ROW == rowDisplay->mDisplay) { nsIFrame *cellFrame; - rowFrame->FirstChild(cellFrame); + rowFrame->FirstChild(nsnull, cellFrame); while (nsnull!=cellFrame) { /* this is the first time we are guaranteed to have both the cell frames @@ -3015,7 +3015,7 @@ void nsTableFrame::BuildColumnCache( nsIPresContext& aPresContext, if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == childDisplay->mDisplay) { nsTableColFrame *colFrame=nsnull; - childFrame->FirstChild((nsIFrame *&)colFrame); + childFrame->FirstChild(nsnull, (nsIFrame *&)colFrame); while (nsnull!=colFrame) { // for every column, create an entry in the column cache // assumes that the col style has been twiddled to account for first cell width attribute @@ -3102,7 +3102,7 @@ void nsTableFrame::InvalidateCellMap() if (PR_TRUE==IsRowGroup(rowGroupDisplay->mDisplay)) { nsIFrame *rowFrame; - rowGroupFrame->FirstChild(rowFrame); + rowGroupFrame->FirstChild(nsnull, rowFrame); for ( ; nsnull!=rowFrame; rowFrame->GetNextSibling(rowFrame)) { const nsStyleDisplay *rowDisplay; @@ -3135,7 +3135,7 @@ nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext, // add headers and footers to cf nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow(); nsIFrame * rg = nsnull; - firstInFlow->FirstChild(rg); + firstInFlow->FirstChild(nsnull, rg); NS_ASSERTION (nsnull!=rg, "previous frame has no children"); PRInt32 index = 0; nsIFrame * bodyRowGroupFromOverflow = mOverflowList; @@ -3427,7 +3427,7 @@ NS_METHOD nsTableFrame::GetTableFrame(nsIFrame *aSourceFrame, nsTableFrame *& aT // if found, the childFrame must be the inner frame nsresult rv; nsIFrame *childFrame=nsnull; - rv = aTableFrame->FirstChild(childFrame); + rv = aTableFrame->FirstChild(nsnull, childFrame); while ((NS_OK==rv) && (nsnull!=childFrame)) { const nsStyleDisplay *childDisplay; diff --git a/mozilla/layout/tables/nsTableOuterFrame.cpp b/mozilla/layout/tables/nsTableOuterFrame.cpp index 478abd827bf..39a0236c45c 100644 --- a/mozilla/layout/tables/nsTableOuterFrame.cpp +++ b/mozilla/layout/tables/nsTableOuterFrame.cpp @@ -1213,7 +1213,7 @@ PRBool nsTableOuterFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, n PRInt32 childCount; nsIFrame* firstChild; - nextInFlow->FirstChild(firstChild); + nextInFlow->FirstChild(nsnull, firstChild); childCount = LengthOf(firstChild); NS_ASSERTION(childCount == 0, "deleting !empty next-in-flow"); diff --git a/mozilla/layout/tables/nsTableRowFrame.cpp b/mozilla/layout/tables/nsTableRowFrame.cpp index b8f9444cb6b..34f5080d11e 100644 --- a/mozilla/layout/tables/nsTableRowFrame.cpp +++ b/mozilla/layout/tables/nsTableRowFrame.cpp @@ -1393,7 +1393,7 @@ PRBool nsTableRowFrame::Contains(nsPoint& aPoint) // if that fails, check the cells, they might span outside the row rect else { nsIFrame* kid; - FirstChild(kid); + FirstChild(nsnull, kid); while (nsnull != kid) { nsRect kidRect; kid->GetRect(kidRect); diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.cpp b/mozilla/layout/tables/nsTableRowGroupFrame.cpp index 30c7c86d508..22c06a2bdd0 100644 --- a/mozilla/layout/tables/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableRowGroupFrame.cpp @@ -240,7 +240,7 @@ NS_METHOD nsTableRowGroupFrame::HandleEvent(nsIPresContext& aPresContext, aEventStatus = nsEventStatus_eIgnore; nsIFrame* kid; - FirstChild(kid); + FirstChild(nsnull, kid); while (nsnull != kid) { nsRect kidRect; kid->GetRect(kidRect); @@ -694,7 +694,7 @@ void nsTableRowGroupFrame::ShrinkWrapChildren(nsIPresContext* aPresContext, if (gsDebug) printf("TRGF SWC: for row %p...\n", rowFrame); // check this row for a cell with rowspans nsIFrame *cellFrame; - rowFrame->FirstChild(cellFrame); + rowFrame->FirstChild(nsnull, cellFrame); while (nsnull != cellFrame) { const nsStyleDisplay *childDisplay; @@ -1109,7 +1109,7 @@ PRBool nsTableRowGroupFrame::NoRowsFollow() (NS_STYLE_DISPLAY_TABLE_ROW_GROUP == sibDisplay->mDisplay)) { nsIFrame *childFrame=nsnull; - nextSib->FirstChild(childFrame); + nextSib->FirstChild(nsnull, childFrame); while (nsnull!=childFrame) { const nsStyleDisplay *childDisplay;