diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 2dab6873a3f9..b413db39bed4 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -367,7 +367,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresContext* aPresContext, // Init the table outer frame and see if we need to create a view, e.g. // the frame is absolutely positioned - aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewFrame, aStyleContext, PR_FALSE); nsCOMPtr parentStyleContext; @@ -389,7 +389,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresContext* aPresContext, aNewFrame->SetInitialChildList(*aPresContext, nsnull, innerFrame); childList = innerFrame; - innerFrame->Init(*aPresContext, aContent, aNewFrame, aStyleContext); + innerFrame->Init(*aPresContext, aContent, aNewFrame, aStyleContext, nsnull); nsIFrame* lastChildFrame = nsnull; PRInt32 count; @@ -502,7 +502,8 @@ nsCSSFrameConstructor::ConstructAnonymousTableFrame (nsIPresContext* aPresConte getter_AddRefs(outerStyleContext)); result = NS_NewTableOuterFrame(aOuterFrame); if (NS_SUCCEEDED(result)) { - aOuterFrame->Init(*aPresContext, aContent, aParentFrame, outerStyleContext); + aOuterFrame->Init(*aPresContext, aContent, aParentFrame, outerStyleContext, + nsnull); // create the inner table frames nsCOMPtr innerStyleContext; @@ -512,7 +513,8 @@ nsCSSFrameConstructor::ConstructAnonymousTableFrame (nsIPresContext* aPresConte getter_AddRefs(innerStyleContext)); result = aTableCreator.CreateTableFrame(aInnerFrame); if (NS_SUCCEEDED(result)) { - aInnerFrame->Init(*aPresContext, aContent, aOuterFrame, innerStyleContext); + aInnerFrame->Init(*aPresContext, aContent, aOuterFrame, innerStyleContext, + nsnull); } } } @@ -541,20 +543,23 @@ nsCSSFrameConstructor::ConstructTableCaptionFrame(nsIPresContext* aPresContext, if (NS_STYLE_DISPLAY_TABLE == parentDisplay->mDisplay) { // parent is an outer table aParentFrame->FirstChild(nsnull, &innerFrame); - aNewCaptionFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + aNewCaptionFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, + nsnull); innerFrame->SetNextSibling(aNewCaptionFrame); // the caller is responsible for calling SetInitialChildList on the outer, inner frames aNewTopMostFrame = aNewCaptionFrame; } else { // parent is not a table, need to create a new table nsIFrame* outerFrame; - ConstructAnonymousTableFrame(aPresContext, aContent, aParentFrame, outerFrame, innerFrame, aFixedItems, aTableCreator); + ConstructAnonymousTableFrame(aPresContext, aContent, aParentFrame, outerFrame, + innerFrame, aFixedItems, aTableCreator); nsCOMPtr outerStyleContext; outerFrame->GetStyleContext(getter_AddRefs(outerStyleContext)); nsCOMPtr adjStyleContext; aPresContext->ResolveStyleContextFor(aContent, outerStyleContext, PR_FALSE, getter_AddRefs(adjStyleContext)); - aNewCaptionFrame->Init(*aPresContext, aContent, outerFrame, adjStyleContext); + aNewCaptionFrame->Init(*aPresContext, aContent, outerFrame, adjStyleContext, + nsnull); innerFrame->SetNextSibling(aNewCaptionFrame); outerFrame->SetInitialChildList(*aPresContext, nsnull, innerFrame); innerFrame->SetInitialChildList(*aPresContext, nsnull, nsnull); @@ -663,7 +668,8 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPresContex // Create a scroll frame and initialize it rv = NS_NewScrollFrame(aNewTopMostFrame); if (NS_SUCCEEDED(rv)) { - aNewTopMostFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + aNewTopMostFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, + nsnull); // The scroll frame gets the original style context, the scrolled frame gets // a pseudo element style context that inherits the background properties @@ -679,7 +685,8 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPresContex if (NS_SUCCEEDED(rv)) { // Initialize the frame and force it to have a view - aNewGroupFrame->Init(*aPresContext, aContent, aNewTopMostFrame, scrolledPseudoStyle); + aNewGroupFrame->Init(*aPresContext, aContent, aNewTopMostFrame, scrolledPseudoStyle, + nsnull); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewGroupFrame, scrolledPseudoStyle, PR_TRUE); aNewTopMostFrame->SetInitialChildList(*aPresContext, nsnull, aNewGroupFrame); @@ -689,7 +696,8 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPresContex rv = (aIsRowGroup) ? aTableCreator.CreateTableRowGroupFrame(aNewTopMostFrame) : aTableCreator.CreateTableColGroupFrame(aNewTopMostFrame); if (NS_SUCCEEDED(rv)) { - aNewTopMostFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + aNewTopMostFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, + nsnull); aNewGroupFrame = aNewTopMostFrame; } } @@ -769,7 +777,8 @@ nsCSSFrameConstructor::ConstructTableRowFrame(nsIPresContext* aPresContext, rv = ConstructTableRowFrameOnly(aPresContext, aContent, groupFrame, styleContext, aAbsoluteItems, contentDisplayIsRow, aNewRowFrame, aFixedItems, aTableCreator); if (NS_SUCCEEDED(rv)) { - aNewRowFrame->Init(*aPresContext, aContent, groupFrame, styleContext); + aNewRowFrame->Init(*aPresContext, aContent, groupFrame, styleContext, + nsnull); if (aToDo) { aToDo->Push(groupFrame); aToDo->Push(aNewRowFrame); @@ -799,7 +808,8 @@ nsCSSFrameConstructor::ConstructTableRowFrameOnly(nsIPresContext* aPresContext, { nsresult rv = aTableCreator.CreateTableRowFrame(aNewRowFrame); if (NS_SUCCEEDED(rv)) { - aNewRowFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + aNewRowFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, + nsnull); if (aProcessChildren) { nsFrameItems childItems; rv = TableProcessChildren(aPresContext, aContent, aNewRowFrame, aAbsoluteItems, @@ -829,7 +839,8 @@ nsCSSFrameConstructor::ConstructTableColFrame(nsIPresContext* aPresContext, const nsStyleDisplay* parentDisplay = GetDisplay(aParentFrame); if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == parentDisplay->mDisplay) { rv = aTableCreator.CreateTableColFrame(aNewColFrame); - aNewColFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + aNewColFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, + nsnull); aNewTopMostFrame = aNewColFrame; } else { // construct anonymous col group frame nsIFrame* groupFrame; @@ -844,7 +855,7 @@ nsCSSFrameConstructor::ConstructTableColFrame(nsIPresContext* aPresContext, PR_FALSE, getter_AddRefs(styleContext)); rv = aTableCreator.CreateTableColFrame(aNewColFrame); - aNewColFrame->Init(*aPresContext, aContent, groupFrame, styleContext); + aNewColFrame->Init(*aPresContext, aContent, groupFrame, styleContext, nsnull); if (NS_SUCCEEDED(rv)) { groupFrame->SetInitialChildList(*aPresContext, nsnull, aNewColFrame); } @@ -947,7 +958,7 @@ nsCSSFrameConstructor::ConstructTableCellFrameOnly(nsIPresContext* aPresContext rv = aTableCreator.CreateTableCellFrame(aNewFrame); if (NS_SUCCEEDED(rv)) { // Initialize the table cell frame - aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull); // Create an area frame that will format the cell's content nsIFrame* cellBodyFrame; @@ -964,7 +975,7 @@ nsCSSFrameConstructor::ConstructTableCellFrameOnly(nsIPresContext* aPresContext aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::cellContentPseudo, aStyleContext, PR_FALSE, getter_AddRefs(bodyPseudoStyle)); - cellBodyFrame->Init(*aPresContext, aContent, aNewFrame, bodyPseudoStyle); + cellBodyFrame->Init(*aPresContext, aContent, aNewFrame, bodyPseudoStyle, nsnull); nsFrameItems childItems; if (aWrapContent) { @@ -1233,7 +1244,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresContext* aPresContext, nsIFrame* areaFrame; NS_NewAreaFrame(areaFrame, 0); - areaFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext); + areaFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext, nsnull); // The area frame is the "initial containing block" mInitialContainingBlock = areaFrame; @@ -1265,7 +1276,8 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresContext* aPresContext, if (IsScrollable(aPresContext, display)) { NS_NewScrollFrame(scrollFrame); - scrollFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext); + scrollFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext, + nsnull); // The scrolled frame gets a pseudo element style context nsCOMPtr scrolledPseudoStyle; @@ -1285,7 +1297,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresContext* aPresContext, // flag that says that this is the body... NS_NewAreaFrame(areaFrame, NS_BLOCK_DOCUMENT_ROOT|NS_BLOCK_MARGIN_ROOT); areaFrame->Init(*aPresContext, aDocElement, scrollFrame ? scrollFrame : - aParentFrame, styleContext); + aParentFrame, styleContext, nsnull); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, areaFrame, styleContext, PR_FALSE); @@ -1343,7 +1355,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext, getter_AddRefs(viewportPseudoStyle)); // Initialize the viewport frame. It has a NULL content object - viewportFrame->Init(*aPresContext, nsnull, nsnull, viewportPseudoStyle); + viewportFrame->Init(*aPresContext, nsnull, nsnull, viewportPseudoStyle, nsnull); // Bind the viewport frame to the root view nsCOMPtr presShell; @@ -1384,7 +1396,8 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext, if (isScrollable) { NS_NewScrollFrame(scrollFrame); // XXX should probably be a scrolled content pseudo style context - scrollFrame->Init(*aPresContext, nsnull, viewportFrame, viewportPseudoStyle); + scrollFrame->Init(*aPresContext, nsnull, viewportFrame, viewportPseudoStyle, + nsnull); // Inform the view manager about the root scrollable view nsIView* scrollFrameView; @@ -1405,7 +1418,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext, NS_NewSimplePageSequenceFrame(pageSequenceFrame); // XXX should probably be a page sequence pseudo style context pageSequenceFrame->Init(*aPresContext, nsnull, isScrollable ? scrollFrame : - viewportFrame, viewportPseudoStyle); + viewportFrame, viewportPseudoStyle, nsnull); if (isScrollable) { nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageSequenceFrame, viewportPseudoStyle, PR_TRUE); @@ -1428,7 +1441,8 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext, viewportPseudoStyle, PR_FALSE, getter_AddRefs(pagePseudoStyle)); - pageFrame->Init(*aPresContext, nsnull, pageSequenceFrame, pagePseudoStyle); + pageFrame->Init(*aPresContext, nsnull, pageSequenceFrame, pagePseudoStyle, + nsnull); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageFrame, pagePseudoStyle, PR_TRUE); @@ -1461,7 +1475,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext, // XXX this should be a root pseudo style context rootFrame->Init(*aPresContext, nsnull, isScrollable ? scrollFrame : - viewportFrame, viewportPseudoStyle); + viewportFrame, viewportPseudoStyle, nsnull); if (isScrollable) { nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, rootFrame, viewportPseudoStyle, PR_TRUE); @@ -1504,7 +1518,7 @@ nsCSSFrameConstructor::CreatePlaceholderFrameFor(nsIPresContext* aPresContext, PR_FALSE, getter_AddRefs(placeholderPseudoStyle)); placeholderFrame->Init(*aPresContext, aContent, aParentFrame, - placeholderPseudoStyle); + placeholderPseudoStyle, nsnull); // Add mapping from absolutely positioned frame to its placeholder frame nsCOMPtr presShell; @@ -1701,7 +1715,7 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresContext* aPresContext, rv = NS_NewObjectFrame(newFrame); nsIFrame *blockFrame; NS_NewBlockFrame(blockFrame, 0); - blockFrame->Init(*aPresContext, aContent, newFrame, aStyleContext); + blockFrame->Init(*aPresContext, aContent, newFrame, aStyleContext, nsnull); newFrame = blockFrame; processChildren = PR_TRUE; } @@ -1752,7 +1766,8 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresContext* aPresContext, } } - newFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext); + newFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext, + nsnull); // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame, @@ -1993,7 +2008,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext, if (NS_SUCCEEDED(rv) && newFrame != nsnull) { nsIFrame* geometricParent = isAbsolutelyPositioned ? aAbsoluteItems.containingBlock : aParentFrame; - newFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext); + newFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext, nsnull); // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame, @@ -2056,7 +2071,8 @@ nsCSSFrameConstructor::InitializeScrollFrame(nsIFrame* scrollFrame, } else if (aIsFixedPositioned) { geometricParent = aFixedItems.containingBlock; } - scrollFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext); + scrollFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext, + nsnull); // The scroll frame gets the original style context, and the scrolled // frame gets a SCROLLED-CONTENT pseudo element style context that @@ -2071,7 +2087,8 @@ nsCSSFrameConstructor::InitializeScrollFrame(nsIFrame* scrollFrame, NS_NewAreaFrame(scrolledFrame, NS_BLOCK_SHRINK_WRAP); // Initialize the frame and force it to have a view - scrolledFrame->Init(*aPresContext, aContent, scrollFrame, scrolledPseudoStyle); + scrolledFrame->Init(*aPresContext, aContent, scrollFrame, scrolledPseudoStyle, + nsnull); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, scrolledFrame, scrolledPseudoStyle, PR_TRUE); @@ -2223,7 +2240,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPresCo NS_NewAreaFrame(newFrame, 0); newFrame->Init(*aPresContext, aContent, isAbsolutelyPositioned ? aAbsoluteItems.containingBlock : aFixedItems.containingBlock, - aStyleContext); + aStyleContext, nsnull); // Create a view nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame, @@ -2254,7 +2271,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPresCo NS_NewAreaFrame(newFrame, NS_BLOCK_SHRINK_WRAP); // Initialize the frame - newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull); // See if we need to create a view nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame, @@ -2274,7 +2291,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPresCo // Create an area frame. No space manager, though NS_NewAreaFrame(newFrame, NS_AREA_NO_SPACE_MGR); - newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull); // Create a view nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame, @@ -2398,7 +2415,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPresCo // If we succeeded in creating a frame then initialize the frame and // process children if requested if (NS_SUCCEEDED(rv) && (nsnull != newFrame)) { - newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull); // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame, @@ -3443,8 +3460,9 @@ nsCSSFrameConstructor::ConstructAlternateImageFrame(nsIPresContext* aPresContext getter_AddRefs(textStyleContext)); // Initialize the frames - inlineFrame->Init(*aPresContext, aContent, aParentFrame, textStyleContext); - textFrame->Init(*aPresContext, altTextContent, inlineFrame, textStyleContext); + inlineFrame->Init(*aPresContext, aContent, aParentFrame, textStyleContext, nsnull); + textFrame->Init(*aPresContext, altTextContent, inlineFrame, + textStyleContext, nsnull); inlineFrame->SetInitialChildList(*aPresContext, nsnull, textFrame); // Return the inline frame diff --git a/layout/base/public/nsIFrame.h b/layout/base/public/nsIFrame.h index 378809f9e99e..33846151e2d1 100644 --- a/layout/base/public/nsIFrame.h +++ b/layout/base/public/nsIFrame.h @@ -163,18 +163,25 @@ public: * Called to initialize the frame. This is called immediately after creating * the frame. * - * If you want a view associated with your frame you should create the view + * If the frame is a continuing frame, then aPrevInFlow indicates the previous + * frame (the frame that was split). You should connect the continuing frame to + * its prev-in-flow, e.g. by using the AppendToFlow() function + * + * If you want a view associated with your frame, you should create the view * now. * * @param aContent the content object associated with the frame * @param aGeometricParent the geometric parent frame * @param aContentParent the content parent frame * @param aContext the style context associated with the frame + * @param aPrevInFlow the prev-in-flow frame + * @see #AppendToFlow() */ NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext) = 0; + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow) = 0; /** * Called to set the initial list of frames. This happens after the frame diff --git a/layout/forms/nsFieldSetFrame.cpp b/layout/forms/nsFieldSetFrame.cpp index 733c20ade43c..28d1ce169db4 100644 --- a/layout/forms/nsFieldSetFrame.cpp +++ b/layout/forms/nsFieldSetFrame.cpp @@ -132,7 +132,7 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext, nsHTMLAtoms::fieldsetContentPseudo, mStyleContext, PR_FALSE, &styleContext); - mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext); + mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull); NS_RELEASE(styleContext); nsIFrame* newChildList = aChildList; diff --git a/layout/forms/nsFileControlFrame.cpp b/layout/forms/nsFileControlFrame.cpp index 3393441d2c8e..6808f81715e4 100644 --- a/layout/forms/nsFileControlFrame.cpp +++ b/layout/forms/nsFileControlFrame.cpp @@ -209,10 +209,10 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext, if (NS_SUCCEEDED(rv)) { // Found the pseudo style for the text field - childFrame->Init(aPresContext, text, this, textFieldStyleContext); + childFrame->Init(aPresContext, text, this, textFieldStyleContext, nsnull); } else { // Can't find pseduo style so use the style set for the file updload element - childFrame->Init(aPresContext, mContent, this, mStyleContext); + childFrame->Init(aPresContext, mContent, this, mStyleContext, nsnull); } mTextFrame = (nsTextControlFrame*)childFrame; mFrames.SetFrames(childFrame); @@ -236,10 +236,10 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext, getter_AddRefs(buttonStyleContext)); if (NS_SUCCEEDED(rv)) { // Found pseduo style for the button - childFrame->Init(aPresContext, browse, this, buttonStyleContext); + childFrame->Init(aPresContext, browse, this, buttonStyleContext, nsnull); } else { // Can't find pseudo style for the button so use the style set for the file upload element - childFrame->Init(aPresContext, mContent, this, mStyleContext); + childFrame->Init(aPresContext, mContent, this, mStyleContext, nsnull); } mFrames.FirstChild()->SetNextSibling(childFrame); diff --git a/layout/forms/nsHTMLButtonControlFrame.cpp b/layout/forms/nsHTMLButtonControlFrame.cpp index a282940bf84a..c8fbb229645d 100644 --- a/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/layout/forms/nsHTMLButtonControlFrame.cpp @@ -549,7 +549,7 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext& aPresContext, aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::buttonContentPseudo, mStyleContext, PR_FALSE, &styleContext); - mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext); + mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull); NS_RELEASE(styleContext); // Set the parent for each of the child frames diff --git a/layout/forms/nsLegendFrame.cpp b/layout/forms/nsLegendFrame.cpp index aa4b1463cfd2..0152486fa18f 100644 --- a/layout/forms/nsLegendFrame.cpp +++ b/layout/forms/nsLegendFrame.cpp @@ -99,7 +99,7 @@ nsLegendFrame::SetInitialChildList(nsIPresContext& aPresContext, aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::legendContentPseudo, mStyleContext, PR_FALSE, &styleContext); - mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext); + mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull); NS_RELEASE(styleContext); // Set the parent for each of the child frames diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp index 4dd90ca3be86..81dc28112a9f 100644 --- a/layout/forms/nsListControlFrame.cpp +++ b/layout/forms/nsListControlFrame.cpp @@ -769,11 +769,13 @@ nsListControlFrame::DoRemoveFrame(nsBlockReflowState& aState, //---------------------------------------------------------------------- NS_IMETHODIMP nsListControlFrame::Init(nsIPresContext& aPresContext, - nsIContent* aContent, - nsIFrame* aParent, - nsIStyleContext* aContext) + nsIContent* aContent, + nsIFrame* aParent, + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow) { - nsresult result = nsScrollFrame::Init(aPresContext, aContent, aParent, aContext); + nsresult result = nsScrollFrame::Init(aPresContext, aContent, aParent, aContext, + aPrevInFlow); /*if (NS_OK == result) { nsIDOMNode* node; if (mContent && (NS_OK == mContent->QueryInterface(kIDOMNodeIID, (void**) &node))) { diff --git a/layout/forms/nsListControlFrame.h b/layout/forms/nsListControlFrame.h index 73bc13991b5a..82558726f59f 100644 --- a/layout/forms/nsListControlFrame.h +++ b/layout/forms/nsListControlFrame.h @@ -119,7 +119,8 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext); + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow); NS_IMETHOD Deselect(); diff --git a/layout/generic/nsAreaFrame.cpp b/layout/generic/nsAreaFrame.cpp index 88c31fbb5450..0194fd02dabc 100644 --- a/layout/generic/nsAreaFrame.cpp +++ b/layout/generic/nsAreaFrame.cpp @@ -77,7 +77,8 @@ NS_IMETHODIMP nsAreaFrame::Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext) + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow) { // Create a space manager if requested if (0 == (mFlags & NS_AREA_NO_SPACE_MGR)) { @@ -85,7 +86,7 @@ nsAreaFrame::Init(nsIPresContext& aPresContext, NS_ADDREF(mSpaceManager); } - return nsBlockFrame::Init(aPresContext, aContent, aParent, aContext); + return nsBlockFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow); } NS_IMETHODIMP @@ -592,9 +593,8 @@ nsAreaFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); cf->SetFlags(mFlags); - cf->AppendToFlow(this); aContinuingFrame = cf; return NS_OK; } diff --git a/layout/generic/nsAreaFrame.h b/layout/generic/nsAreaFrame.h index 86246e3871ae..4dbb1916c7ea 100644 --- a/layout/generic/nsAreaFrame.h +++ b/layout/generic/nsAreaFrame.h @@ -52,7 +52,8 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext); + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow); NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext); diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 89097d3030db..ab64c72835af 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -4503,7 +4503,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext, NS_RELEASE(kidSC); return NS_ERROR_OUT_OF_MEMORY; } - mBullet->Init(aPresContext, mContent, this, kidSC); + mBullet->Init(aPresContext, mContent, this, kidSC, nsnull); NS_RELEASE(kidSC); // If the list bullet frame should be positioned inside then add @@ -4551,9 +4551,8 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); cf->SetFlags(mFlags); - cf->AppendToFlow(this); aContinuingFrame = cf; return NS_OK; } diff --git a/layout/generic/nsBlockReflowState.cpp b/layout/generic/nsBlockReflowState.cpp index 89097d3030db..ab64c72835af 100644 --- a/layout/generic/nsBlockReflowState.cpp +++ b/layout/generic/nsBlockReflowState.cpp @@ -4503,7 +4503,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext, NS_RELEASE(kidSC); return NS_ERROR_OUT_OF_MEMORY; } - mBullet->Init(aPresContext, mContent, this, kidSC); + mBullet->Init(aPresContext, mContent, this, kidSC, nsnull); NS_RELEASE(kidSC); // If the list bullet frame should be positioned inside then add @@ -4551,9 +4551,8 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); cf->SetFlags(mFlags); - cf->AppendToFlow(this); aContinuingFrame = cf; return NS_OK; } diff --git a/layout/generic/nsBlockReflowState.h b/layout/generic/nsBlockReflowState.h index 89097d3030db..ab64c72835af 100644 --- a/layout/generic/nsBlockReflowState.h +++ b/layout/generic/nsBlockReflowState.h @@ -4503,7 +4503,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext, NS_RELEASE(kidSC); return NS_ERROR_OUT_OF_MEMORY; } - mBullet->Init(aPresContext, mContent, this, kidSC); + mBullet->Init(aPresContext, mContent, this, kidSC, nsnull); NS_RELEASE(kidSC); // If the list bullet frame should be positioned inside then add @@ -4551,9 +4551,8 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); cf->SetFlags(mFlags); - cf->AppendToFlow(this); aContinuingFrame = cf; return NS_OK; } diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 9432984e85f2..2aef268316ca 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -221,7 +221,8 @@ NS_IMETHODIMP nsFrame::Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext) + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow) { mContent = aContent; NS_IF_ADDREF(mContent); diff --git a/layout/generic/nsFrame.h b/layout/generic/nsFrame.h index 2a567de30a7d..7369335d6dc8 100644 --- a/layout/generic/nsFrame.h +++ b/layout/generic/nsFrame.h @@ -113,7 +113,8 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext); + nsIStyleContext* aContext, + nsIFrame* asPrevInFlow); NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext, nsIAtom* aListName, nsIFrame* aChildList); diff --git a/layout/generic/nsFrameFrame.cpp b/layout/generic/nsFrameFrame.cpp index a29aed7d8176..c24e4e0deb60 100644 --- a/layout/generic/nsFrameFrame.cpp +++ b/layout/generic/nsFrameFrame.cpp @@ -325,7 +325,7 @@ nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext, firstChild = new nsHTMLFrameInnerFrame; mFrames.SetFrames(firstChild); // XXX temporary! use style system to get correct style! - firstChild->Init(aPresContext, mContent, this, mStyleContext); + firstChild->Init(aPresContext, mContent, this, mStyleContext, nsnull); } // nsContainerFrame::PaintBorder has some problems, kludge it here diff --git a/layout/generic/nsFrameSetFrame.cpp b/layout/generic/nsFrameSetFrame.cpp index 19c77cd9abe9..c29c3752eed8 100644 --- a/layout/generic/nsFrameSetFrame.cpp +++ b/layout/generic/nsFrameSetFrame.cpp @@ -941,7 +941,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, PR_FALSE, &kidSC); if (nsHTMLAtoms::frameset == tag) { result = NS_NewHTMLFramesetFrame(frame); - frame->Init(aPresContext, child, this, kidSC); + frame->Init(aPresContext, child, this, kidSC, nsnull); childTypes[mChildCount] = FRAMESET; nsHTMLFramesetFrame* childFrame = (nsHTMLFramesetFrame*)frame; @@ -951,7 +951,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, childBorderColors[mChildCount].Set(childFrame->GetBorderColor()); } else { // frame result = NS_NewHTMLFrameOuterFrame(frame); - frame->Init(aPresContext, child, this, kidSC); + frame->Init(aPresContext, child, this, kidSC, nsnull); childTypes[mChildCount] = FRAME; // @@ -988,7 +988,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, mStyleContext, PR_FALSE, &pseudoStyleContext); - blankFrame->Init(aPresContext, mContent, this, pseudoStyleContext); + blankFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull); NS_RELEASE(pseudoStyleContext); if (nsnull == lastChild) { @@ -1028,7 +1028,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::horizontalFramesetBorderPseudo, mStyleContext, PR_FALSE, &pseudoStyleContext); - borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext); + borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull); NS_RELEASE(pseudoStyleContext); mChildCount++; @@ -1056,7 +1056,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, mStyleContext, PR_FALSE, &pseudoStyleContext); - borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext); + borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull); NS_RELEASE(pseudoStyleContext); mChildCount++; diff --git a/layout/generic/nsHTMLContainerFrame.cpp b/layout/generic/nsHTMLContainerFrame.cpp index c20d17d2a37d..9aa92074d2e4 100644 --- a/layout/generic/nsHTMLContainerFrame.cpp +++ b/layout/generic/nsHTMLContainerFrame.cpp @@ -98,7 +98,7 @@ nsHTMLContainerFrame::CreatePlaceholderFrame(nsIPresContext& aPresContext, kidSC, PR_FALSE, &placeholderPseudoStyle); NS_RELEASE(kidSC); - placeholder->Init(aPresContext, content, this, placeholderPseudoStyle); + placeholder->Init(aPresContext, content, this, placeholderPseudoStyle, nsnull); NS_RELEASE(placeholderPseudoStyle); NS_IF_RELEASE(content); diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index 378809f9e99e..33846151e2d1 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -163,18 +163,25 @@ public: * Called to initialize the frame. This is called immediately after creating * the frame. * - * If you want a view associated with your frame you should create the view + * If the frame is a continuing frame, then aPrevInFlow indicates the previous + * frame (the frame that was split). You should connect the continuing frame to + * its prev-in-flow, e.g. by using the AppendToFlow() function + * + * If you want a view associated with your frame, you should create the view * now. * * @param aContent the content object associated with the frame * @param aGeometricParent the geometric parent frame * @param aContentParent the content parent frame * @param aContext the style context associated with the frame + * @param aPrevInFlow the prev-in-flow frame + * @see #AppendToFlow() */ NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext) = 0; + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow) = 0; /** * Called to set the initial list of frames. This happens after the frame diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index b91a5f0723ab..e09f20e383bd 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -336,9 +336,10 @@ NS_IMETHODIMP nsImageFrame::Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext) + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow) { - nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aParent, aContext); + nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow); // Set the image loader's source URL and base URL nsAutoString src; diff --git a/layout/generic/nsInlineFrame.cpp b/layout/generic/nsInlineFrame.cpp index 58c5c15f07fe..cb399db7f02a 100644 --- a/layout/generic/nsInlineFrame.cpp +++ b/layout/generic/nsInlineFrame.cpp @@ -413,7 +413,7 @@ nsInlineFrame::CreateAnonymousBlock(nsIPresContext& aPresContext, mStyleContext, PR_FALSE, getter_AddRefs(newSC)); - rv = bf->Init(aPresContext, mContent, this, newSC); + rv = bf->Init(aPresContext, mContent, this, newSC, nsnull); if (NS_FAILED(rv)) { bf->DeleteFrame(aPresContext); delete bf; @@ -1773,8 +1773,7 @@ nsInlineFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); - cf->AppendToFlow(this); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); aContinuingFrame = cf; return NS_OK; } diff --git a/layout/generic/nsPageFrame.cpp b/layout/generic/nsPageFrame.cpp index b10c5ffe342b..c0b967d7a36d 100644 --- a/layout/generic/nsPageFrame.cpp +++ b/layout/generic/nsPageFrame.cpp @@ -148,8 +148,7 @@ nsPageFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); - cf->AppendToFlow(this); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); aContinuingFrame = cf; return NS_OK; } diff --git a/layout/generic/nsSplittableFrame.cpp b/layout/generic/nsSplittableFrame.cpp index 024af96cc270..2d0165a33fe1 100644 --- a/layout/generic/nsSplittableFrame.cpp +++ b/layout/generic/nsSplittableFrame.cpp @@ -21,6 +21,35 @@ #include "nsIStyleContext.h" #include "nsISizeOfHandler.h" +NS_IMETHODIMP +nsSplittableFrame::Init(nsIPresContext& aPresContext, + nsIContent* aContent, + nsIFrame* aParent, + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow) +{ + nsresult rv; + + rv = nsFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow); + + if (aPrevInFlow) { + // Hook the frame into the flow + AppendToFlow(aPrevInFlow); + + // Make sure the general flags bits are the same + nsFrameState state; + aPrevInFlow->GetFrameState(&state); + if (state & NS_FRAME_SYNC_FRAME_AND_VIEW) { + mState |= NS_FRAME_SYNC_FRAME_AND_VIEW; + } + if (state & NS_FRAME_REPLACED_ELEMENT) { + mState |= NS_FRAME_REPLACED_ELEMENT; + } + } + + return rv; +} + NS_IMETHODIMP nsSplittableFrame::IsSplittable(nsSplittableType& aIsSplittable) const { diff --git a/layout/generic/nsSplittableFrame.h b/layout/generic/nsSplittableFrame.h index ee5e5ae76042..c7ea437bd761 100644 --- a/layout/generic/nsSplittableFrame.h +++ b/layout/generic/nsSplittableFrame.h @@ -24,6 +24,12 @@ class nsSplittableFrame : public nsFrame { public: + NS_IMETHOD Init(nsIPresContext& aPresContext, + nsIContent* aContent, + nsIFrame* aParent, + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow); + // CreateContinuingFrame() does the default behavior of using the // content delegate to create a new frame NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const; diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index 941cdd6237e4..7d8352a29823 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -503,9 +503,7 @@ TextFrame::CreateContinuingFrame(nsIPresContext& aCX, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aCX, mContent, aParent, aStyleContext); - cf->AppendToFlow(this); - cf->mState |= NS_FRAME_REPLACED_ELEMENT;/* XXX kipp: hack for inline reflow */ + cf->Init(aCX, mContent, aParent, aStyleContext, this); aContinuingFrame = cf; return NS_OK; } diff --git a/layout/html/base/src/nsAreaFrame.cpp b/layout/html/base/src/nsAreaFrame.cpp index 88c31fbb5450..0194fd02dabc 100644 --- a/layout/html/base/src/nsAreaFrame.cpp +++ b/layout/html/base/src/nsAreaFrame.cpp @@ -77,7 +77,8 @@ NS_IMETHODIMP nsAreaFrame::Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext) + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow) { // Create a space manager if requested if (0 == (mFlags & NS_AREA_NO_SPACE_MGR)) { @@ -85,7 +86,7 @@ nsAreaFrame::Init(nsIPresContext& aPresContext, NS_ADDREF(mSpaceManager); } - return nsBlockFrame::Init(aPresContext, aContent, aParent, aContext); + return nsBlockFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow); } NS_IMETHODIMP @@ -592,9 +593,8 @@ nsAreaFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); cf->SetFlags(mFlags); - cf->AppendToFlow(this); aContinuingFrame = cf; return NS_OK; } diff --git a/layout/html/base/src/nsAreaFrame.h b/layout/html/base/src/nsAreaFrame.h index 86246e3871ae..4dbb1916c7ea 100644 --- a/layout/html/base/src/nsAreaFrame.h +++ b/layout/html/base/src/nsAreaFrame.h @@ -52,7 +52,8 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext); + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow); NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext); diff --git a/layout/html/base/src/nsBlockFrame.cpp b/layout/html/base/src/nsBlockFrame.cpp index 89097d3030db..ab64c72835af 100644 --- a/layout/html/base/src/nsBlockFrame.cpp +++ b/layout/html/base/src/nsBlockFrame.cpp @@ -4503,7 +4503,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext, NS_RELEASE(kidSC); return NS_ERROR_OUT_OF_MEMORY; } - mBullet->Init(aPresContext, mContent, this, kidSC); + mBullet->Init(aPresContext, mContent, this, kidSC, nsnull); NS_RELEASE(kidSC); // If the list bullet frame should be positioned inside then add @@ -4551,9 +4551,8 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); cf->SetFlags(mFlags); - cf->AppendToFlow(this); aContinuingFrame = cf; return NS_OK; } diff --git a/layout/html/base/src/nsBlockReflowState.cpp b/layout/html/base/src/nsBlockReflowState.cpp index 89097d3030db..ab64c72835af 100644 --- a/layout/html/base/src/nsBlockReflowState.cpp +++ b/layout/html/base/src/nsBlockReflowState.cpp @@ -4503,7 +4503,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext, NS_RELEASE(kidSC); return NS_ERROR_OUT_OF_MEMORY; } - mBullet->Init(aPresContext, mContent, this, kidSC); + mBullet->Init(aPresContext, mContent, this, kidSC, nsnull); NS_RELEASE(kidSC); // If the list bullet frame should be positioned inside then add @@ -4551,9 +4551,8 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); cf->SetFlags(mFlags); - cf->AppendToFlow(this); aContinuingFrame = cf; return NS_OK; } diff --git a/layout/html/base/src/nsBlockReflowState.h b/layout/html/base/src/nsBlockReflowState.h index 89097d3030db..ab64c72835af 100644 --- a/layout/html/base/src/nsBlockReflowState.h +++ b/layout/html/base/src/nsBlockReflowState.h @@ -4503,7 +4503,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext, NS_RELEASE(kidSC); return NS_ERROR_OUT_OF_MEMORY; } - mBullet->Init(aPresContext, mContent, this, kidSC); + mBullet->Init(aPresContext, mContent, this, kidSC, nsnull); NS_RELEASE(kidSC); // If the list bullet frame should be positioned inside then add @@ -4551,9 +4551,8 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); cf->SetFlags(mFlags); - cf->AppendToFlow(this); aContinuingFrame = cf; return NS_OK; } diff --git a/layout/html/base/src/nsFrame.cpp b/layout/html/base/src/nsFrame.cpp index 9432984e85f2..2aef268316ca 100644 --- a/layout/html/base/src/nsFrame.cpp +++ b/layout/html/base/src/nsFrame.cpp @@ -221,7 +221,8 @@ NS_IMETHODIMP nsFrame::Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext) + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow) { mContent = aContent; NS_IF_ADDREF(mContent); diff --git a/layout/html/base/src/nsFrame.h b/layout/html/base/src/nsFrame.h index 2a567de30a7d..7369335d6dc8 100644 --- a/layout/html/base/src/nsFrame.h +++ b/layout/html/base/src/nsFrame.h @@ -113,7 +113,8 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext); + nsIStyleContext* aContext, + nsIFrame* asPrevInFlow); NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext, nsIAtom* aListName, nsIFrame* aChildList); diff --git a/layout/html/base/src/nsHTMLContainerFrame.cpp b/layout/html/base/src/nsHTMLContainerFrame.cpp index c20d17d2a37d..9aa92074d2e4 100644 --- a/layout/html/base/src/nsHTMLContainerFrame.cpp +++ b/layout/html/base/src/nsHTMLContainerFrame.cpp @@ -98,7 +98,7 @@ nsHTMLContainerFrame::CreatePlaceholderFrame(nsIPresContext& aPresContext, kidSC, PR_FALSE, &placeholderPseudoStyle); NS_RELEASE(kidSC); - placeholder->Init(aPresContext, content, this, placeholderPseudoStyle); + placeholder->Init(aPresContext, content, this, placeholderPseudoStyle, nsnull); NS_RELEASE(placeholderPseudoStyle); NS_IF_RELEASE(content); diff --git a/layout/html/base/src/nsHTMLImage.h b/layout/html/base/src/nsHTMLImage.h index f199a7ad5eaf..826541a8c993 100644 --- a/layout/html/base/src/nsHTMLImage.h +++ b/layout/html/base/src/nsHTMLImage.h @@ -99,7 +99,8 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext); + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow); NS_IMETHOD Paint(nsIPresContext& aPresContext, nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect, diff --git a/layout/html/base/src/nsImageFrame.cpp b/layout/html/base/src/nsImageFrame.cpp index b91a5f0723ab..e09f20e383bd 100644 --- a/layout/html/base/src/nsImageFrame.cpp +++ b/layout/html/base/src/nsImageFrame.cpp @@ -336,9 +336,10 @@ NS_IMETHODIMP nsImageFrame::Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext) + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow) { - nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aParent, aContext); + nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow); // Set the image loader's source URL and base URL nsAutoString src; diff --git a/layout/html/base/src/nsInlineFrame.cpp b/layout/html/base/src/nsInlineFrame.cpp index 58c5c15f07fe..cb399db7f02a 100644 --- a/layout/html/base/src/nsInlineFrame.cpp +++ b/layout/html/base/src/nsInlineFrame.cpp @@ -413,7 +413,7 @@ nsInlineFrame::CreateAnonymousBlock(nsIPresContext& aPresContext, mStyleContext, PR_FALSE, getter_AddRefs(newSC)); - rv = bf->Init(aPresContext, mContent, this, newSC); + rv = bf->Init(aPresContext, mContent, this, newSC, nsnull); if (NS_FAILED(rv)) { bf->DeleteFrame(aPresContext); delete bf; @@ -1773,8 +1773,7 @@ nsInlineFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); - cf->AppendToFlow(this); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); aContinuingFrame = cf; return NS_OK; } diff --git a/layout/html/base/src/nsPageFrame.cpp b/layout/html/base/src/nsPageFrame.cpp index b10c5ffe342b..c0b967d7a36d 100644 --- a/layout/html/base/src/nsPageFrame.cpp +++ b/layout/html/base/src/nsPageFrame.cpp @@ -148,8 +148,7 @@ nsPageFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); - cf->AppendToFlow(this); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); aContinuingFrame = cf; return NS_OK; } diff --git a/layout/html/base/src/nsScrollFrame.cpp b/layout/html/base/src/nsScrollFrame.cpp index 391c820dae22..e96a6130ba5b 100644 --- a/layout/html/base/src/nsScrollFrame.cpp +++ b/layout/html/base/src/nsScrollFrame.cpp @@ -48,10 +48,12 @@ NS_IMETHODIMP nsScrollFrame::Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aStyleContext) + nsIStyleContext* aStyleContext, + nsIFrame* aPrevInFlow) { nsresult rv = nsHTMLContainerFrame::Init(aPresContext, aContent, - aParent, aStyleContext); + aParent, aStyleContext, + aPrevInFlow); // Create the scrolling view CreateScrollingView(); diff --git a/layout/html/base/src/nsScrollFrame.h b/layout/html/base/src/nsScrollFrame.h index dbcbd3d16606..3d8831d94f50 100644 --- a/layout/html/base/src/nsScrollFrame.h +++ b/layout/html/base/src/nsScrollFrame.h @@ -32,7 +32,8 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext); + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow); NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext, nsIAtom* aListName, diff --git a/layout/html/base/src/nsSplittableFrame.cpp b/layout/html/base/src/nsSplittableFrame.cpp index 024af96cc270..2d0165a33fe1 100644 --- a/layout/html/base/src/nsSplittableFrame.cpp +++ b/layout/html/base/src/nsSplittableFrame.cpp @@ -21,6 +21,35 @@ #include "nsIStyleContext.h" #include "nsISizeOfHandler.h" +NS_IMETHODIMP +nsSplittableFrame::Init(nsIPresContext& aPresContext, + nsIContent* aContent, + nsIFrame* aParent, + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow) +{ + nsresult rv; + + rv = nsFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow); + + if (aPrevInFlow) { + // Hook the frame into the flow + AppendToFlow(aPrevInFlow); + + // Make sure the general flags bits are the same + nsFrameState state; + aPrevInFlow->GetFrameState(&state); + if (state & NS_FRAME_SYNC_FRAME_AND_VIEW) { + mState |= NS_FRAME_SYNC_FRAME_AND_VIEW; + } + if (state & NS_FRAME_REPLACED_ELEMENT) { + mState |= NS_FRAME_REPLACED_ELEMENT; + } + } + + return rv; +} + NS_IMETHODIMP nsSplittableFrame::IsSplittable(nsSplittableType& aIsSplittable) const { diff --git a/layout/html/base/src/nsSplittableFrame.h b/layout/html/base/src/nsSplittableFrame.h index ee5e5ae76042..c7ea437bd761 100644 --- a/layout/html/base/src/nsSplittableFrame.h +++ b/layout/html/base/src/nsSplittableFrame.h @@ -24,6 +24,12 @@ class nsSplittableFrame : public nsFrame { public: + NS_IMETHOD Init(nsIPresContext& aPresContext, + nsIContent* aContent, + nsIFrame* aParent, + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow); + // CreateContinuingFrame() does the default behavior of using the // content delegate to create a new frame NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const; diff --git a/layout/html/base/src/nsTextFrame.cpp b/layout/html/base/src/nsTextFrame.cpp index 941cdd6237e4..7d8352a29823 100644 --- a/layout/html/base/src/nsTextFrame.cpp +++ b/layout/html/base/src/nsTextFrame.cpp @@ -503,9 +503,7 @@ TextFrame::CreateContinuingFrame(nsIPresContext& aCX, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aCX, mContent, aParent, aStyleContext); - cf->AppendToFlow(this); - cf->mState |= NS_FRAME_REPLACED_ELEMENT;/* XXX kipp: hack for inline reflow */ + cf->Init(aCX, mContent, aParent, aStyleContext, this); aContinuingFrame = cf; return NS_OK; } diff --git a/layout/html/document/src/nsFrameFrame.cpp b/layout/html/document/src/nsFrameFrame.cpp index a29aed7d8176..c24e4e0deb60 100644 --- a/layout/html/document/src/nsFrameFrame.cpp +++ b/layout/html/document/src/nsFrameFrame.cpp @@ -325,7 +325,7 @@ nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext, firstChild = new nsHTMLFrameInnerFrame; mFrames.SetFrames(firstChild); // XXX temporary! use style system to get correct style! - firstChild->Init(aPresContext, mContent, this, mStyleContext); + firstChild->Init(aPresContext, mContent, this, mStyleContext, nsnull); } // nsContainerFrame::PaintBorder has some problems, kludge it here diff --git a/layout/html/document/src/nsFrameSetFrame.cpp b/layout/html/document/src/nsFrameSetFrame.cpp index 19c77cd9abe9..c29c3752eed8 100644 --- a/layout/html/document/src/nsFrameSetFrame.cpp +++ b/layout/html/document/src/nsFrameSetFrame.cpp @@ -941,7 +941,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, PR_FALSE, &kidSC); if (nsHTMLAtoms::frameset == tag) { result = NS_NewHTMLFramesetFrame(frame); - frame->Init(aPresContext, child, this, kidSC); + frame->Init(aPresContext, child, this, kidSC, nsnull); childTypes[mChildCount] = FRAMESET; nsHTMLFramesetFrame* childFrame = (nsHTMLFramesetFrame*)frame; @@ -951,7 +951,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, childBorderColors[mChildCount].Set(childFrame->GetBorderColor()); } else { // frame result = NS_NewHTMLFrameOuterFrame(frame); - frame->Init(aPresContext, child, this, kidSC); + frame->Init(aPresContext, child, this, kidSC, nsnull); childTypes[mChildCount] = FRAME; // @@ -988,7 +988,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, mStyleContext, PR_FALSE, &pseudoStyleContext); - blankFrame->Init(aPresContext, mContent, this, pseudoStyleContext); + blankFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull); NS_RELEASE(pseudoStyleContext); if (nsnull == lastChild) { @@ -1028,7 +1028,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::horizontalFramesetBorderPseudo, mStyleContext, PR_FALSE, &pseudoStyleContext); - borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext); + borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull); NS_RELEASE(pseudoStyleContext); mChildCount++; @@ -1056,7 +1056,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, mStyleContext, PR_FALSE, &pseudoStyleContext); - borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext); + borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull); NS_RELEASE(pseudoStyleContext); mChildCount++; diff --git a/layout/html/forms/src/nsFieldSetFrame.cpp b/layout/html/forms/src/nsFieldSetFrame.cpp index 733c20ade43c..28d1ce169db4 100644 --- a/layout/html/forms/src/nsFieldSetFrame.cpp +++ b/layout/html/forms/src/nsFieldSetFrame.cpp @@ -132,7 +132,7 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext, nsHTMLAtoms::fieldsetContentPseudo, mStyleContext, PR_FALSE, &styleContext); - mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext); + mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull); NS_RELEASE(styleContext); nsIFrame* newChildList = aChildList; diff --git a/layout/html/forms/src/nsFileControlFrame.cpp b/layout/html/forms/src/nsFileControlFrame.cpp index 3393441d2c8e..6808f81715e4 100644 --- a/layout/html/forms/src/nsFileControlFrame.cpp +++ b/layout/html/forms/src/nsFileControlFrame.cpp @@ -209,10 +209,10 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext, if (NS_SUCCEEDED(rv)) { // Found the pseudo style for the text field - childFrame->Init(aPresContext, text, this, textFieldStyleContext); + childFrame->Init(aPresContext, text, this, textFieldStyleContext, nsnull); } else { // Can't find pseduo style so use the style set for the file updload element - childFrame->Init(aPresContext, mContent, this, mStyleContext); + childFrame->Init(aPresContext, mContent, this, mStyleContext, nsnull); } mTextFrame = (nsTextControlFrame*)childFrame; mFrames.SetFrames(childFrame); @@ -236,10 +236,10 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext, getter_AddRefs(buttonStyleContext)); if (NS_SUCCEEDED(rv)) { // Found pseduo style for the button - childFrame->Init(aPresContext, browse, this, buttonStyleContext); + childFrame->Init(aPresContext, browse, this, buttonStyleContext, nsnull); } else { // Can't find pseudo style for the button so use the style set for the file upload element - childFrame->Init(aPresContext, mContent, this, mStyleContext); + childFrame->Init(aPresContext, mContent, this, mStyleContext, nsnull); } mFrames.FirstChild()->SetNextSibling(childFrame); diff --git a/layout/html/forms/src/nsHTMLButtonControlFrame.cpp b/layout/html/forms/src/nsHTMLButtonControlFrame.cpp index a282940bf84a..c8fbb229645d 100644 --- a/layout/html/forms/src/nsHTMLButtonControlFrame.cpp +++ b/layout/html/forms/src/nsHTMLButtonControlFrame.cpp @@ -549,7 +549,7 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext& aPresContext, aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::buttonContentPseudo, mStyleContext, PR_FALSE, &styleContext); - mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext); + mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull); NS_RELEASE(styleContext); // Set the parent for each of the child frames diff --git a/layout/html/forms/src/nsLabelFrame.cpp b/layout/html/forms/src/nsLabelFrame.cpp index 48483c34375d..8fe3f5cdffaa 100644 --- a/layout/html/forms/src/nsLabelFrame.cpp +++ b/layout/html/forms/src/nsLabelFrame.cpp @@ -362,7 +362,7 @@ nsLabelFrame::SetInitialChildList(nsIPresContext& aPresContext, aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::labelContentPseudo, mStyleContext, PR_FALSE, &styleContext); - mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext); + mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull); NS_RELEASE(styleContext); // Set the geometric and content parent for each of the child frames diff --git a/layout/html/forms/src/nsLegendFrame.cpp b/layout/html/forms/src/nsLegendFrame.cpp index aa4b1463cfd2..0152486fa18f 100644 --- a/layout/html/forms/src/nsLegendFrame.cpp +++ b/layout/html/forms/src/nsLegendFrame.cpp @@ -99,7 +99,7 @@ nsLegendFrame::SetInitialChildList(nsIPresContext& aPresContext, aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::legendContentPseudo, mStyleContext, PR_FALSE, &styleContext); - mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext); + mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull); NS_RELEASE(styleContext); // Set the parent for each of the child frames diff --git a/layout/html/forms/src/nsListControlFrame.cpp b/layout/html/forms/src/nsListControlFrame.cpp index 4dd90ca3be86..81dc28112a9f 100644 --- a/layout/html/forms/src/nsListControlFrame.cpp +++ b/layout/html/forms/src/nsListControlFrame.cpp @@ -769,11 +769,13 @@ nsListControlFrame::DoRemoveFrame(nsBlockReflowState& aState, //---------------------------------------------------------------------- NS_IMETHODIMP nsListControlFrame::Init(nsIPresContext& aPresContext, - nsIContent* aContent, - nsIFrame* aParent, - nsIStyleContext* aContext) + nsIContent* aContent, + nsIFrame* aParent, + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow) { - nsresult result = nsScrollFrame::Init(aPresContext, aContent, aParent, aContext); + nsresult result = nsScrollFrame::Init(aPresContext, aContent, aParent, aContext, + aPrevInFlow); /*if (NS_OK == result) { nsIDOMNode* node; if (mContent && (NS_OK == mContent->QueryInterface(kIDOMNodeIID, (void**) &node))) { diff --git a/layout/html/forms/src/nsListControlFrame.h b/layout/html/forms/src/nsListControlFrame.h index 73bc13991b5a..82558726f59f 100644 --- a/layout/html/forms/src/nsListControlFrame.h +++ b/layout/html/forms/src/nsListControlFrame.h @@ -119,7 +119,8 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext); + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow); NS_IMETHOD Deselect(); diff --git a/layout/html/style/src/nsCSSFrameConstructor.cpp b/layout/html/style/src/nsCSSFrameConstructor.cpp index 2dab6873a3f9..b413db39bed4 100644 --- a/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -367,7 +367,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresContext* aPresContext, // Init the table outer frame and see if we need to create a view, e.g. // the frame is absolutely positioned - aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewFrame, aStyleContext, PR_FALSE); nsCOMPtr parentStyleContext; @@ -389,7 +389,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresContext* aPresContext, aNewFrame->SetInitialChildList(*aPresContext, nsnull, innerFrame); childList = innerFrame; - innerFrame->Init(*aPresContext, aContent, aNewFrame, aStyleContext); + innerFrame->Init(*aPresContext, aContent, aNewFrame, aStyleContext, nsnull); nsIFrame* lastChildFrame = nsnull; PRInt32 count; @@ -502,7 +502,8 @@ nsCSSFrameConstructor::ConstructAnonymousTableFrame (nsIPresContext* aPresConte getter_AddRefs(outerStyleContext)); result = NS_NewTableOuterFrame(aOuterFrame); if (NS_SUCCEEDED(result)) { - aOuterFrame->Init(*aPresContext, aContent, aParentFrame, outerStyleContext); + aOuterFrame->Init(*aPresContext, aContent, aParentFrame, outerStyleContext, + nsnull); // create the inner table frames nsCOMPtr innerStyleContext; @@ -512,7 +513,8 @@ nsCSSFrameConstructor::ConstructAnonymousTableFrame (nsIPresContext* aPresConte getter_AddRefs(innerStyleContext)); result = aTableCreator.CreateTableFrame(aInnerFrame); if (NS_SUCCEEDED(result)) { - aInnerFrame->Init(*aPresContext, aContent, aOuterFrame, innerStyleContext); + aInnerFrame->Init(*aPresContext, aContent, aOuterFrame, innerStyleContext, + nsnull); } } } @@ -541,20 +543,23 @@ nsCSSFrameConstructor::ConstructTableCaptionFrame(nsIPresContext* aPresContext, if (NS_STYLE_DISPLAY_TABLE == parentDisplay->mDisplay) { // parent is an outer table aParentFrame->FirstChild(nsnull, &innerFrame); - aNewCaptionFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + aNewCaptionFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, + nsnull); innerFrame->SetNextSibling(aNewCaptionFrame); // the caller is responsible for calling SetInitialChildList on the outer, inner frames aNewTopMostFrame = aNewCaptionFrame; } else { // parent is not a table, need to create a new table nsIFrame* outerFrame; - ConstructAnonymousTableFrame(aPresContext, aContent, aParentFrame, outerFrame, innerFrame, aFixedItems, aTableCreator); + ConstructAnonymousTableFrame(aPresContext, aContent, aParentFrame, outerFrame, + innerFrame, aFixedItems, aTableCreator); nsCOMPtr outerStyleContext; outerFrame->GetStyleContext(getter_AddRefs(outerStyleContext)); nsCOMPtr adjStyleContext; aPresContext->ResolveStyleContextFor(aContent, outerStyleContext, PR_FALSE, getter_AddRefs(adjStyleContext)); - aNewCaptionFrame->Init(*aPresContext, aContent, outerFrame, adjStyleContext); + aNewCaptionFrame->Init(*aPresContext, aContent, outerFrame, adjStyleContext, + nsnull); innerFrame->SetNextSibling(aNewCaptionFrame); outerFrame->SetInitialChildList(*aPresContext, nsnull, innerFrame); innerFrame->SetInitialChildList(*aPresContext, nsnull, nsnull); @@ -663,7 +668,8 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPresContex // Create a scroll frame and initialize it rv = NS_NewScrollFrame(aNewTopMostFrame); if (NS_SUCCEEDED(rv)) { - aNewTopMostFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + aNewTopMostFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, + nsnull); // The scroll frame gets the original style context, the scrolled frame gets // a pseudo element style context that inherits the background properties @@ -679,7 +685,8 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPresContex if (NS_SUCCEEDED(rv)) { // Initialize the frame and force it to have a view - aNewGroupFrame->Init(*aPresContext, aContent, aNewTopMostFrame, scrolledPseudoStyle); + aNewGroupFrame->Init(*aPresContext, aContent, aNewTopMostFrame, scrolledPseudoStyle, + nsnull); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewGroupFrame, scrolledPseudoStyle, PR_TRUE); aNewTopMostFrame->SetInitialChildList(*aPresContext, nsnull, aNewGroupFrame); @@ -689,7 +696,8 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPresContex rv = (aIsRowGroup) ? aTableCreator.CreateTableRowGroupFrame(aNewTopMostFrame) : aTableCreator.CreateTableColGroupFrame(aNewTopMostFrame); if (NS_SUCCEEDED(rv)) { - aNewTopMostFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + aNewTopMostFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, + nsnull); aNewGroupFrame = aNewTopMostFrame; } } @@ -769,7 +777,8 @@ nsCSSFrameConstructor::ConstructTableRowFrame(nsIPresContext* aPresContext, rv = ConstructTableRowFrameOnly(aPresContext, aContent, groupFrame, styleContext, aAbsoluteItems, contentDisplayIsRow, aNewRowFrame, aFixedItems, aTableCreator); if (NS_SUCCEEDED(rv)) { - aNewRowFrame->Init(*aPresContext, aContent, groupFrame, styleContext); + aNewRowFrame->Init(*aPresContext, aContent, groupFrame, styleContext, + nsnull); if (aToDo) { aToDo->Push(groupFrame); aToDo->Push(aNewRowFrame); @@ -799,7 +808,8 @@ nsCSSFrameConstructor::ConstructTableRowFrameOnly(nsIPresContext* aPresContext, { nsresult rv = aTableCreator.CreateTableRowFrame(aNewRowFrame); if (NS_SUCCEEDED(rv)) { - aNewRowFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + aNewRowFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, + nsnull); if (aProcessChildren) { nsFrameItems childItems; rv = TableProcessChildren(aPresContext, aContent, aNewRowFrame, aAbsoluteItems, @@ -829,7 +839,8 @@ nsCSSFrameConstructor::ConstructTableColFrame(nsIPresContext* aPresContext, const nsStyleDisplay* parentDisplay = GetDisplay(aParentFrame); if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == parentDisplay->mDisplay) { rv = aTableCreator.CreateTableColFrame(aNewColFrame); - aNewColFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + aNewColFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, + nsnull); aNewTopMostFrame = aNewColFrame; } else { // construct anonymous col group frame nsIFrame* groupFrame; @@ -844,7 +855,7 @@ nsCSSFrameConstructor::ConstructTableColFrame(nsIPresContext* aPresContext, PR_FALSE, getter_AddRefs(styleContext)); rv = aTableCreator.CreateTableColFrame(aNewColFrame); - aNewColFrame->Init(*aPresContext, aContent, groupFrame, styleContext); + aNewColFrame->Init(*aPresContext, aContent, groupFrame, styleContext, nsnull); if (NS_SUCCEEDED(rv)) { groupFrame->SetInitialChildList(*aPresContext, nsnull, aNewColFrame); } @@ -947,7 +958,7 @@ nsCSSFrameConstructor::ConstructTableCellFrameOnly(nsIPresContext* aPresContext rv = aTableCreator.CreateTableCellFrame(aNewFrame); if (NS_SUCCEEDED(rv)) { // Initialize the table cell frame - aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull); // Create an area frame that will format the cell's content nsIFrame* cellBodyFrame; @@ -964,7 +975,7 @@ nsCSSFrameConstructor::ConstructTableCellFrameOnly(nsIPresContext* aPresContext aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::cellContentPseudo, aStyleContext, PR_FALSE, getter_AddRefs(bodyPseudoStyle)); - cellBodyFrame->Init(*aPresContext, aContent, aNewFrame, bodyPseudoStyle); + cellBodyFrame->Init(*aPresContext, aContent, aNewFrame, bodyPseudoStyle, nsnull); nsFrameItems childItems; if (aWrapContent) { @@ -1233,7 +1244,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresContext* aPresContext, nsIFrame* areaFrame; NS_NewAreaFrame(areaFrame, 0); - areaFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext); + areaFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext, nsnull); // The area frame is the "initial containing block" mInitialContainingBlock = areaFrame; @@ -1265,7 +1276,8 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresContext* aPresContext, if (IsScrollable(aPresContext, display)) { NS_NewScrollFrame(scrollFrame); - scrollFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext); + scrollFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext, + nsnull); // The scrolled frame gets a pseudo element style context nsCOMPtr scrolledPseudoStyle; @@ -1285,7 +1297,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresContext* aPresContext, // flag that says that this is the body... NS_NewAreaFrame(areaFrame, NS_BLOCK_DOCUMENT_ROOT|NS_BLOCK_MARGIN_ROOT); areaFrame->Init(*aPresContext, aDocElement, scrollFrame ? scrollFrame : - aParentFrame, styleContext); + aParentFrame, styleContext, nsnull); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, areaFrame, styleContext, PR_FALSE); @@ -1343,7 +1355,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext, getter_AddRefs(viewportPseudoStyle)); // Initialize the viewport frame. It has a NULL content object - viewportFrame->Init(*aPresContext, nsnull, nsnull, viewportPseudoStyle); + viewportFrame->Init(*aPresContext, nsnull, nsnull, viewportPseudoStyle, nsnull); // Bind the viewport frame to the root view nsCOMPtr presShell; @@ -1384,7 +1396,8 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext, if (isScrollable) { NS_NewScrollFrame(scrollFrame); // XXX should probably be a scrolled content pseudo style context - scrollFrame->Init(*aPresContext, nsnull, viewportFrame, viewportPseudoStyle); + scrollFrame->Init(*aPresContext, nsnull, viewportFrame, viewportPseudoStyle, + nsnull); // Inform the view manager about the root scrollable view nsIView* scrollFrameView; @@ -1405,7 +1418,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext, NS_NewSimplePageSequenceFrame(pageSequenceFrame); // XXX should probably be a page sequence pseudo style context pageSequenceFrame->Init(*aPresContext, nsnull, isScrollable ? scrollFrame : - viewportFrame, viewportPseudoStyle); + viewportFrame, viewportPseudoStyle, nsnull); if (isScrollable) { nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageSequenceFrame, viewportPseudoStyle, PR_TRUE); @@ -1428,7 +1441,8 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext, viewportPseudoStyle, PR_FALSE, getter_AddRefs(pagePseudoStyle)); - pageFrame->Init(*aPresContext, nsnull, pageSequenceFrame, pagePseudoStyle); + pageFrame->Init(*aPresContext, nsnull, pageSequenceFrame, pagePseudoStyle, + nsnull); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageFrame, pagePseudoStyle, PR_TRUE); @@ -1461,7 +1475,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext, // XXX this should be a root pseudo style context rootFrame->Init(*aPresContext, nsnull, isScrollable ? scrollFrame : - viewportFrame, viewportPseudoStyle); + viewportFrame, viewportPseudoStyle, nsnull); if (isScrollable) { nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, rootFrame, viewportPseudoStyle, PR_TRUE); @@ -1504,7 +1518,7 @@ nsCSSFrameConstructor::CreatePlaceholderFrameFor(nsIPresContext* aPresContext, PR_FALSE, getter_AddRefs(placeholderPseudoStyle)); placeholderFrame->Init(*aPresContext, aContent, aParentFrame, - placeholderPseudoStyle); + placeholderPseudoStyle, nsnull); // Add mapping from absolutely positioned frame to its placeholder frame nsCOMPtr presShell; @@ -1701,7 +1715,7 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresContext* aPresContext, rv = NS_NewObjectFrame(newFrame); nsIFrame *blockFrame; NS_NewBlockFrame(blockFrame, 0); - blockFrame->Init(*aPresContext, aContent, newFrame, aStyleContext); + blockFrame->Init(*aPresContext, aContent, newFrame, aStyleContext, nsnull); newFrame = blockFrame; processChildren = PR_TRUE; } @@ -1752,7 +1766,8 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresContext* aPresContext, } } - newFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext); + newFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext, + nsnull); // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame, @@ -1993,7 +2008,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext, if (NS_SUCCEEDED(rv) && newFrame != nsnull) { nsIFrame* geometricParent = isAbsolutelyPositioned ? aAbsoluteItems.containingBlock : aParentFrame; - newFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext); + newFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext, nsnull); // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame, @@ -2056,7 +2071,8 @@ nsCSSFrameConstructor::InitializeScrollFrame(nsIFrame* scrollFrame, } else if (aIsFixedPositioned) { geometricParent = aFixedItems.containingBlock; } - scrollFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext); + scrollFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext, + nsnull); // The scroll frame gets the original style context, and the scrolled // frame gets a SCROLLED-CONTENT pseudo element style context that @@ -2071,7 +2087,8 @@ nsCSSFrameConstructor::InitializeScrollFrame(nsIFrame* scrollFrame, NS_NewAreaFrame(scrolledFrame, NS_BLOCK_SHRINK_WRAP); // Initialize the frame and force it to have a view - scrolledFrame->Init(*aPresContext, aContent, scrollFrame, scrolledPseudoStyle); + scrolledFrame->Init(*aPresContext, aContent, scrollFrame, scrolledPseudoStyle, + nsnull); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, scrolledFrame, scrolledPseudoStyle, PR_TRUE); @@ -2223,7 +2240,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPresCo NS_NewAreaFrame(newFrame, 0); newFrame->Init(*aPresContext, aContent, isAbsolutelyPositioned ? aAbsoluteItems.containingBlock : aFixedItems.containingBlock, - aStyleContext); + aStyleContext, nsnull); // Create a view nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame, @@ -2254,7 +2271,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPresCo NS_NewAreaFrame(newFrame, NS_BLOCK_SHRINK_WRAP); // Initialize the frame - newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull); // See if we need to create a view nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame, @@ -2274,7 +2291,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPresCo // Create an area frame. No space manager, though NS_NewAreaFrame(newFrame, NS_AREA_NO_SPACE_MGR); - newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull); // Create a view nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame, @@ -2398,7 +2415,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPresCo // If we succeeded in creating a frame then initialize the frame and // process children if requested if (NS_SUCCEEDED(rv) && (nsnull != newFrame)) { - newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); + newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull); // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame, @@ -3443,8 +3460,9 @@ nsCSSFrameConstructor::ConstructAlternateImageFrame(nsIPresContext* aPresContext getter_AddRefs(textStyleContext)); // Initialize the frames - inlineFrame->Init(*aPresContext, aContent, aParentFrame, textStyleContext); - textFrame->Init(*aPresContext, altTextContent, inlineFrame, textStyleContext); + inlineFrame->Init(*aPresContext, aContent, aParentFrame, textStyleContext, nsnull); + textFrame->Init(*aPresContext, altTextContent, inlineFrame, + textStyleContext, nsnull); inlineFrame->SetInitialChildList(*aPresContext, nsnull, textFrame); // Return the inline frame diff --git a/layout/html/table/src/nsTableCellFrame.cpp b/layout/html/table/src/nsTableCellFrame.cpp index b76098507ebf..2a8f27e0023f 100644 --- a/layout/html/table/src/nsTableCellFrame.cpp +++ b/layout/html/table/src/nsTableCellFrame.cpp @@ -596,8 +596,7 @@ nsTableCellFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); - cf->AppendToFlow(this); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); PRInt32 baseColIndex; GetColIndex(baseColIndex); cf->InitCellFrame(baseColIndex); diff --git a/layout/html/table/src/nsTableColGroupFrame.cpp b/layout/html/table/src/nsTableColGroupFrame.cpp index 309d2420eca0..a16c8e80d2fb 100644 --- a/layout/html/table/src/nsTableColGroupFrame.cpp +++ b/layout/html/table/src/nsTableColGroupFrame.cpp @@ -92,7 +92,7 @@ nsTableColGroupFrame::InitNewFrames(nsIPresContext& aPresContext, nsIFrame* aChi aPresContext.ResolveStyleContextFor(col, mStyleContext, PR_TRUE, getter_AddRefs(colStyleContext)); - colFrame->Init(aPresContext, col, this, colStyleContext); + colFrame->Init(aPresContext, col, this, colStyleContext, nsnull); colFrame->SetInitialChildList(aPresContext, nsnull, nsnull); // Set nsColFrame-specific information diff --git a/layout/html/table/src/nsTableFrame.cpp b/layout/html/table/src/nsTableFrame.cpp index 91a29df0e625..26c2ea3399b8 100644 --- a/layout/html/table/src/nsTableFrame.cpp +++ b/layout/html/table/src/nsTableFrame.cpp @@ -305,7 +305,8 @@ NS_IMETHODIMP nsTableFrame::Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext) + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow) { float p2t; aPresContext.GetPixelsToTwips(&p2t); @@ -313,7 +314,8 @@ nsTableFrame::Init(nsIPresContext& aPresContext, mDefaultCellSpacingY = NSIntPixelsToTwips(2, p2t); mDefaultCellPadding = NSIntPixelsToTwips(1, p2t); - return nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext); + return nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext, + aPrevInFlow); } @@ -768,7 +770,8 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext) // Create a col group frame nsIFrame* newFrame; NS_NewTableColGroupFrame(newFrame); - newFrame->Init(aPresContext, lastColGroupElement, this, colGroupStyleContext); + newFrame->Init(aPresContext, lastColGroupElement, this, colGroupStyleContext, + nsnull); lastColGroupFrame = (nsTableColGroupFrame*)newFrame; NS_RELEASE(colGroupStyleContext); // kidStyleContenxt: REFCNT-- @@ -802,7 +805,7 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext) &colStyleContext); // colStyleContext: REFCNT++ NS_NewTableColFrame(colFrame); colFrame->Init(aPresContext, lastColGroupElement, lastColGroupFrame, - colStyleContext); + colStyleContext, nsnull); NS_RELEASE(colStyleContext); colFrame->SetInitialChildList(aPresContext, nsnull, nsnull); @@ -4459,8 +4462,7 @@ nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); - cf->AppendToFlow(this); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); if (PR_TRUE==gsDebug) printf("nsTableFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf); // set my width, because all frames in a table flow are the same width // code in nsTableOuterFrame depends on this being set @@ -4492,7 +4494,7 @@ nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext, nsIFrame* duplicateFrame; NS_NewTableRowGroupFrame(duplicateFrame); - duplicateFrame->Init(aPresContext, content, cf, kidStyleContext); + duplicateFrame->Init(aPresContext, content, cf, kidStyleContext, nsnull); NS_RELEASE(kidStyleContext); // kidStyleContenxt: REFCNT-- if (nsnull==lastSib) diff --git a/layout/html/table/src/nsTableFrame.h b/layout/html/table/src/nsTableFrame.h index 675511cb6322..55f78738c673 100644 --- a/layout/html/table/src/nsTableFrame.h +++ b/layout/html/table/src/nsTableFrame.h @@ -84,7 +84,8 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext); + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow); /** @see nsIFrame::DeleteFrame */ diff --git a/layout/html/table/src/nsTableOuterFrame.cpp b/layout/html/table/src/nsTableOuterFrame.cpp index 0abc2d4d417c..623ba938c45c 100644 --- a/layout/html/table/src/nsTableOuterFrame.cpp +++ b/layout/html/table/src/nsTableOuterFrame.cpp @@ -1094,8 +1094,7 @@ nsTableOuterFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); - cf->AppendToFlow(this); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); if (PR_TRUE==gsDebug) printf("nsTableOuterFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf); aContinuingFrame = cf; diff --git a/layout/html/table/src/nsTableRowFrame.cpp b/layout/html/table/src/nsTableRowFrame.cpp index 7333366ff5cb..5a2f3d42cd85 100644 --- a/layout/html/table/src/nsTableRowFrame.cpp +++ b/layout/html/table/src/nsTableRowFrame.cpp @@ -1440,8 +1440,7 @@ nsTableRowFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); - cf->AppendToFlow(this); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); cf->SetRowIndex(GetRowIndex()); // Create a continuing frame for each table cell frame diff --git a/layout/html/table/src/nsTableRowGroupFrame.cpp b/layout/html/table/src/nsTableRowGroupFrame.cpp index 1235a1b9d7f2..f06768cba14b 100644 --- a/layout/html/table/src/nsTableRowGroupFrame.cpp +++ b/layout/html/table/src/nsTableRowGroupFrame.cpp @@ -1307,8 +1307,7 @@ nsTableRowGroupFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); - cf->AppendToFlow(this); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); if (PR_TRUE==gsDebug) printf("nsTableRowGroupFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf); aContinuingFrame = cf; return NS_OK; diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp index b76098507ebf..2a8f27e0023f 100644 --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -596,8 +596,7 @@ nsTableCellFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); - cf->AppendToFlow(this); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); PRInt32 baseColIndex; GetColIndex(baseColIndex); cf->InitCellFrame(baseColIndex); diff --git a/layout/tables/nsTableColGroupFrame.cpp b/layout/tables/nsTableColGroupFrame.cpp index 309d2420eca0..a16c8e80d2fb 100644 --- a/layout/tables/nsTableColGroupFrame.cpp +++ b/layout/tables/nsTableColGroupFrame.cpp @@ -92,7 +92,7 @@ nsTableColGroupFrame::InitNewFrames(nsIPresContext& aPresContext, nsIFrame* aChi aPresContext.ResolveStyleContextFor(col, mStyleContext, PR_TRUE, getter_AddRefs(colStyleContext)); - colFrame->Init(aPresContext, col, this, colStyleContext); + colFrame->Init(aPresContext, col, this, colStyleContext, nsnull); colFrame->SetInitialChildList(aPresContext, nsnull, nsnull); // Set nsColFrame-specific information diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index 91a29df0e625..26c2ea3399b8 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -305,7 +305,8 @@ NS_IMETHODIMP nsTableFrame::Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext) + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow) { float p2t; aPresContext.GetPixelsToTwips(&p2t); @@ -313,7 +314,8 @@ nsTableFrame::Init(nsIPresContext& aPresContext, mDefaultCellSpacingY = NSIntPixelsToTwips(2, p2t); mDefaultCellPadding = NSIntPixelsToTwips(1, p2t); - return nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext); + return nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext, + aPrevInFlow); } @@ -768,7 +770,8 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext) // Create a col group frame nsIFrame* newFrame; NS_NewTableColGroupFrame(newFrame); - newFrame->Init(aPresContext, lastColGroupElement, this, colGroupStyleContext); + newFrame->Init(aPresContext, lastColGroupElement, this, colGroupStyleContext, + nsnull); lastColGroupFrame = (nsTableColGroupFrame*)newFrame; NS_RELEASE(colGroupStyleContext); // kidStyleContenxt: REFCNT-- @@ -802,7 +805,7 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext) &colStyleContext); // colStyleContext: REFCNT++ NS_NewTableColFrame(colFrame); colFrame->Init(aPresContext, lastColGroupElement, lastColGroupFrame, - colStyleContext); + colStyleContext, nsnull); NS_RELEASE(colStyleContext); colFrame->SetInitialChildList(aPresContext, nsnull, nsnull); @@ -4459,8 +4462,7 @@ nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); - cf->AppendToFlow(this); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); if (PR_TRUE==gsDebug) printf("nsTableFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf); // set my width, because all frames in a table flow are the same width // code in nsTableOuterFrame depends on this being set @@ -4492,7 +4494,7 @@ nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext, nsIFrame* duplicateFrame; NS_NewTableRowGroupFrame(duplicateFrame); - duplicateFrame->Init(aPresContext, content, cf, kidStyleContext); + duplicateFrame->Init(aPresContext, content, cf, kidStyleContext, nsnull); NS_RELEASE(kidStyleContext); // kidStyleContenxt: REFCNT-- if (nsnull==lastSib) diff --git a/layout/tables/nsTableFrame.h b/layout/tables/nsTableFrame.h index 675511cb6322..55f78738c673 100644 --- a/layout/tables/nsTableFrame.h +++ b/layout/tables/nsTableFrame.h @@ -84,7 +84,8 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext); + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow); /** @see nsIFrame::DeleteFrame */ diff --git a/layout/tables/nsTableOuterFrame.cpp b/layout/tables/nsTableOuterFrame.cpp index 0abc2d4d417c..623ba938c45c 100644 --- a/layout/tables/nsTableOuterFrame.cpp +++ b/layout/tables/nsTableOuterFrame.cpp @@ -1094,8 +1094,7 @@ nsTableOuterFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); - cf->AppendToFlow(this); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); if (PR_TRUE==gsDebug) printf("nsTableOuterFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf); aContinuingFrame = cf; diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp index 7333366ff5cb..5a2f3d42cd85 100644 --- a/layout/tables/nsTableRowFrame.cpp +++ b/layout/tables/nsTableRowFrame.cpp @@ -1440,8 +1440,7 @@ nsTableRowFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); - cf->AppendToFlow(this); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); cf->SetRowIndex(GetRowIndex()); // Create a continuing frame for each table cell frame diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp index 1235a1b9d7f2..f06768cba14b 100644 --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -1307,8 +1307,7 @@ nsTableRowGroupFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, aStyleContext); - cf->AppendToFlow(this); + cf->Init(aPresContext, mContent, aParent, aStyleContext, this); if (PR_TRUE==gsDebug) printf("nsTableRowGroupFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf); aContinuingFrame = cf; return NS_OK; diff --git a/layout/xul/base/src/nsProgressMeterFrame.cpp b/layout/xul/base/src/nsProgressMeterFrame.cpp index ec351c4b6edc..9d4cf9789c4f 100644 --- a/layout/xul/base/src/nsProgressMeterFrame.cpp +++ b/layout/xul/base/src/nsProgressMeterFrame.cpp @@ -201,10 +201,12 @@ NS_IMETHODIMP nsProgressMeterFrame::Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext) + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow) { - nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aParent, aContext); + nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aParent, aContext, + aPrevInFlow); // get the value nsAutoString value; diff --git a/layout/xul/base/src/nsProgressMeterFrame.h b/layout/xul/base/src/nsProgressMeterFrame.h index d19b178d0bad..fab5664cc8ae 100644 --- a/layout/xul/base/src/nsProgressMeterFrame.h +++ b/layout/xul/base/src/nsProgressMeterFrame.h @@ -59,7 +59,8 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext); + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow); // nsIHTMLReflow overrides NS_IMETHOD Reflow(nsIPresContext& aPresContext, diff --git a/layout/xul/base/src/nsTitledButtonFrame.cpp b/layout/xul/base/src/nsTitledButtonFrame.cpp index d6b8d31c70ca..15cd0d0272b1 100644 --- a/layout/xul/base/src/nsTitledButtonFrame.cpp +++ b/layout/xul/base/src/nsTitledButtonFrame.cpp @@ -195,9 +195,11 @@ NS_IMETHODIMP nsTitledButtonFrame::Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext) + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow) { - nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aParent, aContext); + nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aParent, aContext, + aPrevInFlow); mRenderer.UpdateButtonStyles(this,aPresContext); diff --git a/layout/xul/base/src/nsTitledButtonFrame.h b/layout/xul/base/src/nsTitledButtonFrame.h index 2e787aa84925..468251beaf16 100644 --- a/layout/xul/base/src/nsTitledButtonFrame.h +++ b/layout/xul/base/src/nsTitledButtonFrame.h @@ -47,7 +47,8 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext); + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow); NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext); diff --git a/layout/xul/base/src/nsTreeCellFrame.cpp b/layout/xul/base/src/nsTreeCellFrame.cpp index 5923846aca57..12cf294142f3 100644 --- a/layout/xul/base/src/nsTreeCellFrame.cpp +++ b/layout/xul/base/src/nsTreeCellFrame.cpp @@ -93,7 +93,8 @@ NS_IMETHODIMP nsTreeCellFrame::Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext) + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow) { // Determine if we're a column header or not. @@ -120,9 +121,8 @@ nsTreeCellFrame::Init(nsIPresContext& aPresContext, } } - nsresult rv = nsTableCellFrame::Init(aPresContext, aContent, aParent, aContext); - - return rv; + return nsTableCellFrame::Init(aPresContext, aContent, aParent, aContext, + aPrevInFlow); } nsTableFrame* nsTreeCellFrame::GetTreeFrame() diff --git a/layout/xul/base/src/nsTreeCellFrame.h b/layout/xul/base/src/nsTreeCellFrame.h index 1d3b28c21e09..50a2cd786393 100644 --- a/layout/xul/base/src/nsTreeCellFrame.h +++ b/layout/xul/base/src/nsTreeCellFrame.h @@ -36,7 +36,8 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, nsIFrame* aParent, - nsIStyleContext* aContext); // Overridden to set whether we're a column header + nsIStyleContext* aContext, + nsIFrame* aPrevInFlow); // Overridden to set whether we're a column header NS_IMETHOD Reflow(nsIPresContext& aPresContext, nsHTMLReflowMetrics& aDesiredSize,