diff --git a/mozilla/content/base/src/nsStyleContext.cpp b/mozilla/content/base/src/nsStyleContext.cpp index d1200c9093d..8e359a36646 100644 --- a/mozilla/content/base/src/nsStyleContext.cpp +++ b/mozilla/content/base/src/nsStyleContext.cpp @@ -137,7 +137,7 @@ static nscoord CalcSideFor(const nsIFrame* aFrame, const nsStyleCoord& aCoord, case eStyleUnit_Inherit: nsIFrame* parentFrame; - aFrame->GetGeometricParent(parentFrame); // XXX may not be direct parent... + aFrame->GetParent(parentFrame); // XXX may not be direct parent... if (nsnull != parentFrame) { nsIStyleContext* parentContext; parentFrame->GetStyleContext(parentContext); @@ -168,7 +168,7 @@ static nscoord CalcSideFor(const nsIFrame* aFrame, const nsStyleCoord& aCoord, nscoord baseWidth = 0; PRBool isBase = PR_FALSE; nsIFrame* frame; - aFrame->GetGeometricParent(frame); + aFrame->GetParent(frame); while (nsnull != frame) { frame->IsPercentageBase(isBase); if (isBase) { @@ -177,7 +177,7 @@ static nscoord CalcSideFor(const nsIFrame* aFrame, const nsStyleCoord& aCoord, baseWidth = size.width; // not really width, need to subtract out padding... break; } - frame->GetGeometricParent(frame); + frame->GetParent(frame); } result = (nscoord)((float)baseWidth * aCoord.GetPercentValue()); } diff --git a/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp b/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp index 1dcb5bea3cd..0e5d7719b4a 100644 --- a/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp +++ b/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp @@ -231,7 +231,7 @@ nsAbsoluteItems::AddAbsolutelyPositionedChild(nsIFrame* aChildFrame) { #ifdef NS_DEBUG nsIFrame* parent; - aChildFrame->GetGeometricParent(parent); + aChildFrame->GetParent(parent); NS_PRECONDITION(parent == containingBlock, "bad geometric parent"); #endif @@ -390,8 +390,7 @@ protected: nsresult ConstructTableFrame(nsIPresContext* aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aStyleContext, nsAbsoluteItems& aAboluteItems, nsIFrame*& aNewFrame); @@ -1097,8 +1096,7 @@ HTMLStyleSheetImpl::CreateInputFrame(nsIContent* aContent, nsIFrame*& aFrame) nsresult HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aStyleContext, nsAbsoluteItems& aAbsoluteItems, nsIFrame*& aNewFrame) @@ -1114,8 +1112,7 @@ HTMLStyleSheetImpl::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, aGeometricParent, aContentParent, - aStyleContext); + aNewFrame->Init(*aPresContext, aContent, aParent, aStyleContext); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewFrame, aStyleContext, PR_FALSE); @@ -1130,7 +1127,7 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, nsHTMLAtoms::tablePseudo, aStyleContext); */ - innerFrame->Init(*aPresContext, aContent, aNewFrame, aNewFrame, aStyleContext); + innerFrame->Init(*aPresContext, aContent, aNewFrame, aStyleContext); // this should be "innerTableStyleContext" but I haven't tested that thoroughly yet // Iterate the child content @@ -1158,8 +1155,7 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, // Have we already created a caption? If so, ignore this caption if (nsnull == captionFrame) { NS_NewAreaFrame(captionFrame, 0); - captionFrame->Init(*aPresContext, childContent, aNewFrame, - aNewFrame, childStyleContext); + captionFrame->Init(*aPresContext, childContent, aNewFrame, childStyleContext); // Process the caption's child content and set the initial child list nsIFrame* captionChildList; ProcessChildren(aPresContext, childContent, captionFrame, @@ -1175,8 +1171,7 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, case NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP: case NS_STYLE_DISPLAY_TABLE_ROW_GROUP: NS_NewTableRowGroupFrame(frame); - frame->Init(*aPresContext, childContent, innerFrame, innerFrame, - childStyleContext); + frame->Init(*aPresContext, childContent, innerFrame, childStyleContext); break; case NS_STYLE_DISPLAY_TABLE_ROW: @@ -1193,13 +1188,12 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, NS_NewTableRowGroupFrame(frame); NS_RELEASE(childStyleContext); // we can't use this resolved style, so get rid of it childStyleContext = rowGroupStyleContext; // the row group style context will get set to childStyleContext after the switch ends. - frame->Init(*aPresContext, childContent, innerFrame, - innerFrame, childStyleContext); + frame->Init(*aPresContext, childContent, innerFrame, childStyleContext); // need to resolve the style context for the column again to be sure it's a child of the colgroup style context rowStyleContext = aPresContext->ResolveStyleContextFor(childContent, rowGroupStyleContext); nsIFrame *rowFrame; NS_NewTableRowFrame(rowFrame); - rowFrame->Init(*aPresContext, childContent, frame, frame, rowStyleContext); + rowFrame->Init(*aPresContext, childContent, frame, rowStyleContext); rowFrame->SetInitialChildList(*aPresContext, nsnull, nsnull); grandChildList = rowFrame; break; @@ -1245,12 +1239,12 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, NS_NewTableColGroupFrame(frame); NS_RELEASE(childStyleContext); // we can't use this resolved style, so get rid of it childStyleContext = colGroupStyleContext; // the col group style context will get set to childStyleContext after the switch ends. - frame->Init(*aPresContext, childContent, innerFrame, innerFrame, childStyleContext); + frame->Init(*aPresContext, childContent, innerFrame, childStyleContext); // need to resolve the style context for the column again to be sure it's a child of the colgroup style context colStyleContext = aPresContext->ResolveStyleContextFor(childContent, colGroupStyleContext); nsIFrame *colFrame; NS_NewTableColFrame(colFrame); - colFrame->Init(*aPresContext, childContent, frame, frame, colStyleContext); + colFrame->Init(*aPresContext, childContent, frame, colStyleContext); colFrame->SetInitialChildList(*aPresContext, nsnull, nsnull); grandChildList = colFrame; break; @@ -1258,7 +1252,7 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, case NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP: NS_NewTableColGroupFrame(frame); - frame->Init(*aPresContext, childContent, innerFrame, innerFrame, childStyleContext); + frame->Init(*aPresContext, childContent, innerFrame, childStyleContext); break; default: @@ -1319,7 +1313,7 @@ HTMLStyleSheetImpl::ConstructTableCellFrame(nsIPresContext* aPresContext, rv = NS_NewTableCellFrame(aNewFrame); if (NS_SUCCEEDED(rv)) { // Initialize the table cell frame - aNewFrame->Init(*aPresContext, aContent, aParentFrame, aParentFrame, aStyleContext); + aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); // Create an area frame that will format the cell's content nsIFrame* cellBodyFrame; @@ -1334,7 +1328,7 @@ HTMLStyleSheetImpl::ConstructTableCellFrame(nsIPresContext* aPresContext, // Resolve pseudo style and initialize the body cell frame nsIStyleContext* bodyPseudoStyle = aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::cellContentPseudo, aStyleContext); - cellBodyFrame->Init(*aPresContext, aContent, aNewFrame, aNewFrame, bodyPseudoStyle); + cellBodyFrame->Init(*aPresContext, aContent, aNewFrame, bodyPseudoStyle); NS_RELEASE(bodyPseudoStyle); // Process children and set the body cell frame's initial child list @@ -1369,13 +1363,11 @@ HTMLStyleSheetImpl::ConstructDocElementFrame(nsIPresContext* aPresContext, // the root frame. // XXX We only need the scroll frame if it's print preview... NS_NewScrollFrame(scrollFrame); - scrollFrame->Init(*aPresContext, nsnull, aRootFrame, aRootFrame, - aRootStyleContext); + scrollFrame->Init(*aPresContext, nsnull, aRootFrame, aRootStyleContext); // The page sequence frame needs a view, because it's a scrolled frame NS_NewSimplePageSequenceFrame(pageSequenceFrame); - pageSequenceFrame->Init(*aPresContext, nsnull, scrollFrame, scrollFrame, - aRootStyleContext); + pageSequenceFrame->Init(*aPresContext, nsnull, scrollFrame, aRootStyleContext); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageSequenceFrame, aRootStyleContext, PR_TRUE); @@ -1386,8 +1378,7 @@ HTMLStyleSheetImpl::ConstructDocElementFrame(nsIPresContext* aPresContext, // Initialize the page and force it to have a view. This makes printing of // the pages easier and faster. // XXX Use a PAGE style context... - pageFrame->Init(*aPresContext, nsnull, pageSequenceFrame, pageSequenceFrame, - aRootStyleContext); + pageFrame->Init(*aPresContext, nsnull, pageSequenceFrame, aRootStyleContext); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageFrame, aRootStyleContext, PR_TRUE); @@ -1399,7 +1390,7 @@ HTMLStyleSheetImpl::ConstructDocElementFrame(nsIPresContext* aPresContext, nsIFrame* areaFrame; NS_NewAreaFrame(areaFrame, 0); - areaFrame->Init(*aPresContext, aDocElement, pageFrame, pageFrame, styleContext); + areaFrame->Init(*aPresContext, aDocElement, pageFrame, styleContext); NS_RELEASE(styleContext); // The area frame is the "initial containing block" @@ -1457,8 +1448,7 @@ HTMLStyleSheetImpl::ConstructDocElementFrame(nsIPresContext* aPresContext, if (NS_STYLE_OVERFLOW_HIDDEN != scrolling) { NS_NewScrollFrame(scrollFrame); - scrollFrame->Init(*aPresContext, aDocElement, aRootFrame, aRootFrame, - styleContext); + scrollFrame->Init(*aPresContext, aDocElement, aRootFrame, styleContext); // The scrolled frame gets a pseudo element style context nsIStyleContext* scrolledPseudoStyle = @@ -1477,8 +1467,7 @@ HTMLStyleSheetImpl::ConstructDocElementFrame(nsIPresContext* aPresContext, // flag that says that this is the body... NS_NewAreaFrame(areaFrame, NS_BLOCK_DOCUMENT_ROOT|NS_BLOCK_MARGIN_ROOT); nsIFrame* parentFrame = scrollFrame ? scrollFrame : aRootFrame; - areaFrame->Init(*aPresContext, aDocElement, parentFrame, parentFrame, - styleContext); + areaFrame->Init(*aPresContext, aDocElement, parentFrame, styleContext); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, areaFrame, styleContext, PR_FALSE); NS_RELEASE(styleContext); @@ -1536,7 +1525,7 @@ HTMLStyleSheetImpl::ConstructRootFrame(nsIPresContext* aPresContext, nsHTMLAtoms::rootPseudo, nsnull); // Initialize the root frame. It has a NULL content object - rootFrame->Init(*aPresContext, nsnull, nsnull, nsnull, rootPseudoStyle); + rootFrame->Init(*aPresContext, nsnull, nsnull, rootPseudoStyle); // Bind the root frame to the root view nsIPresShell* presShell = aPresContext->GetShell(); @@ -1580,7 +1569,7 @@ HTMLStyleSheetImpl::CreatePlaceholderFrameFor(nsIPresContext* aPresContext, aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::placeholderPseudo, aStyleContext); placeholderFrame->Init(*aPresContext, aContent, aParentFrame, - aParentFrame, placeholderPseudoStyle); + placeholderPseudoStyle); NS_RELEASE(placeholderPseudoStyle); // Add mapping from absolutely positioned frame to its placeholder frame @@ -1669,8 +1658,7 @@ HTMLStyleSheetImpl::ConstructFrameByTag(nsIPresContext* aPresContext, //rv = NS_NewObjectFrame(aContent, aParentFrame, aNewFrame); nsIFrame *blockFrame; NS_NewBlockFrame(blockFrame, 0); - blockFrame->Init(*aPresContext, aContent, aNewFrame, aNewFrame, - aStyleContext); + blockFrame->Init(*aPresContext, aContent, aNewFrame, aStyleContext); aNewFrame = blockFrame; processChildren = PR_TRUE; } @@ -1704,8 +1692,7 @@ HTMLStyleSheetImpl::ConstructFrameByTag(nsIPresContext* aPresContext, if (NS_SUCCEEDED(rv) && (nsnull != aNewFrame)) { nsIFrame* geometricParent = isAbsolutelyPositioned ? aAbsoluteItems.containingBlock : aParentFrame; - aNewFrame->Init(*aPresContext, aContent, geometricParent, aParentFrame, - aStyleContext); + aNewFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext); // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewFrame, @@ -1784,8 +1771,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte // Initialize it nsIFrame* geometricParent = isAbsolutelyPositioned ? aAbsoluteItems.containingBlock : aParentFrame; - scrollFrame->Init(*aPresContext, aContent, geometricParent, aParentFrame, - aStyleContext); + scrollFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext); // The scroll frame gets the original style context, and the scrolled // frame gets a SCROLLED-CONTENT pseudo element style context that @@ -1798,8 +1784,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte NS_NewAreaFrame(scrolledFrame, NS_BLOCK_SHRINK_WRAP); // Initialize the frame and force it to have a view - scrolledFrame->Init(*aPresContext, aContent, scrollFrame, scrollFrame, - scrolledPseudoStyle); + scrolledFrame->Init(*aPresContext, aContent, scrollFrame, scrolledPseudoStyle); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, scrolledFrame, scrolledPseudoStyle, PR_TRUE); NS_RELEASE(scrolledPseudoStyle); @@ -1842,7 +1827,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte // Create an area frame NS_NewAreaFrame(aNewFrame, 0); aNewFrame->Init(*aPresContext, aContent, aAbsoluteItems.containingBlock, - aParentFrame, aStyleContext); + aStyleContext); // Create a view nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewFrame, @@ -1871,8 +1856,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte NS_NewAreaFrame(aNewFrame, NS_BLOCK_SHRINK_WRAP); // Initialize the frame - aNewFrame->Init(*aPresContext, aContent, aParentFrame, aParentFrame, - aStyleContext); + aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); // See if we need to create a view nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewFrame, @@ -1908,8 +1892,8 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte isAbsolutelyPositioned = NS_STYLE_POSITION_ABSOLUTE == position->mPosition; nsIFrame* geometricParent = isAbsolutelyPositioned ? aAbsoluteItems.containingBlock : aParentFrame; - rv = ConstructTableFrame(aPresContext, aContent, geometricParent, aParentFrame, - aStyleContext, aAbsoluteItems, aNewFrame); + rv = ConstructTableFrame(aPresContext, aContent, geometricParent, aStyleContext, + aAbsoluteItems, aNewFrame); // Note: table construction function takes care of initializing the frame, // processing children, and setting the initial child list if (isAbsolutelyPositioned) { @@ -1993,8 +1977,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte // If we succeeded in creating a frame then initialize the frame and // process children if requested if (NS_SUCCEEDED(rv) && (nsnull != aNewFrame)) { - aNewFrame->Init(*aPresContext, aContent, aParentFrame, aParentFrame, - aStyleContext); + aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewFrame, @@ -2278,7 +2261,7 @@ HTMLStyleSheetImpl::GetAbsoluteContainingBlock(nsIPresContext* aPresContext, } // Continue walking up the hierarchy - containingBlock->GetGeometricParent(containingBlock); + containingBlock->GetParent(containingBlock); } // If we didn't find an absolutely positioned containing block, then use the @@ -2483,13 +2466,11 @@ HTMLStyleSheetImpl::ContentInserted(nsIPresContext* aPresContext, shell->GetPrimaryFrameFor(aContainer, parentFrame); } else { - // Use the prev sibling if we have it; otherwise use the next sibling. - // Note that we use the content parent, and not the geometric parent, - // in case the frame has been moved out of the flow... + // Use the prev sibling if we have it; otherwise use the next sibling if (nsnull != prevSibling) { - prevSibling->GetContentParent(parentFrame); + prevSibling->GetParent(parentFrame); } else { - nextSibling->GetContentParent(parentFrame); + nextSibling->GetParent(parentFrame); } } @@ -2581,7 +2562,7 @@ HTMLStyleSheetImpl::ContentRemoved(nsIPresContext* aPresContext, // Generate two reflow commands. First for the absolutely positioned // frame and then for its placeholder frame nsIFrame* parentFrame; - childFrame->GetGeometricParent(parentFrame); + childFrame->GetParent(parentFrame); // Notify the parent frame with a reflow command. nsIReflowCommand* reflowCmd; @@ -2599,7 +2580,7 @@ HTMLStyleSheetImpl::ContentRemoved(nsIPresContext* aPresContext, shell->GetPlaceholderFrameFor(childFrame, placeholderFrame); if (nsnull != placeholderFrame) { - placeholderFrame->GetGeometricParent(parentFrame); + placeholderFrame->GetParent(parentFrame); rv = NS_NewHTMLReflowCommand(&reflowCmd, parentFrame, nsIReflowCommand::FrameRemoved, placeholderFrame); @@ -2614,7 +2595,7 @@ HTMLStyleSheetImpl::ContentRemoved(nsIPresContext* aPresContext, // Note that we use the content parent, and not the geometric parent, // in case the frame has been moved out of the flow... nsIFrame* parentFrame; - childFrame->GetContentParent(parentFrame); + childFrame->GetParent(parentFrame); NS_ASSERTION(nsnull != parentFrame, "null content parent frame"); // Notify the parent frame with a reflow command. diff --git a/mozilla/layout/base/public/nsIFrame.h b/mozilla/layout/base/public/nsIFrame.h index c008fede516..2a1135614ce 100644 --- a/mozilla/layout/base/public/nsIFrame.h +++ b/mozilla/layout/base/public/nsIFrame.h @@ -158,8 +158,7 @@ public: */ NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aContext) = 0; /** @@ -230,12 +229,10 @@ public: nsIStyleContext* aParentContext) = 0; /** - * Accessor functions for geometric and content parent. + * Accessor functions for geometric parent */ - NS_IMETHOD GetContentParent(nsIFrame*& aParent) const = 0; - NS_IMETHOD SetContentParent(const nsIFrame* aParent) = 0; - NS_IMETHOD GetGeometricParent(nsIFrame*& aParent) const = 0; - NS_IMETHOD SetGeometricParent(const nsIFrame* aParent) = 0; + NS_IMETHOD GetParent(nsIFrame*& aParent) const = 0; + NS_IMETHOD SetParent(const nsIFrame* aParent) = 0; /** * Bounding rect of the frame. The values are in twips, and the origin is diff --git a/mozilla/layout/base/src/nsStyleContext.cpp b/mozilla/layout/base/src/nsStyleContext.cpp index d1200c9093d..8e359a36646 100644 --- a/mozilla/layout/base/src/nsStyleContext.cpp +++ b/mozilla/layout/base/src/nsStyleContext.cpp @@ -137,7 +137,7 @@ static nscoord CalcSideFor(const nsIFrame* aFrame, const nsStyleCoord& aCoord, case eStyleUnit_Inherit: nsIFrame* parentFrame; - aFrame->GetGeometricParent(parentFrame); // XXX may not be direct parent... + aFrame->GetParent(parentFrame); // XXX may not be direct parent... if (nsnull != parentFrame) { nsIStyleContext* parentContext; parentFrame->GetStyleContext(parentContext); @@ -168,7 +168,7 @@ static nscoord CalcSideFor(const nsIFrame* aFrame, const nsStyleCoord& aCoord, nscoord baseWidth = 0; PRBool isBase = PR_FALSE; nsIFrame* frame; - aFrame->GetGeometricParent(frame); + aFrame->GetParent(frame); while (nsnull != frame) { frame->IsPercentageBase(isBase); if (isBase) { @@ -177,7 +177,7 @@ static nscoord CalcSideFor(const nsIFrame* aFrame, const nsStyleCoord& aCoord, baseWidth = size.width; // not really width, need to subtract out padding... break; } - frame->GetGeometricParent(frame); + frame->GetParent(frame); } result = (nscoord)((float)baseWidth * aCoord.GetPercentValue()); } diff --git a/mozilla/layout/forms/nsFieldSetFrame.cpp b/mozilla/layout/forms/nsFieldSetFrame.cpp index 3d9d26b4d97..f38d3f84793 100644 --- a/mozilla/layout/forms/nsFieldSetFrame.cpp +++ b/mozilla/layout/forms/nsFieldSetFrame.cpp @@ -131,7 +131,7 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext, nsIStyleContext* styleContext = aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::fieldsetContentPseudo, mStyleContext); - mFirstChild->Init(aPresContext, mContent, this, this, styleContext); + mFirstChild->Init(aPresContext, mContent, this, styleContext); NS_RELEASE(styleContext); nsIFrame* newChildList = aChildList; @@ -151,15 +151,13 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext, } else { newChildList = nextFrame; } - frame->SetGeometricParent(this); - frame->SetContentParent(this); + frame->SetParent(this); mFirstChild->SetNextSibling(frame); mLegendFrame = frame; mLegendFrame->SetNextSibling(nsnull); frame = nextFrame; } else { - frame->SetGeometricParent(mFirstChild); - frame->SetContentParent(mFirstChild); + frame->SetParent(mFirstChild); frame->GetNextSibling(frame); } lastFrame = frame; diff --git a/mozilla/layout/forms/nsFileControlFrame.cpp b/mozilla/layout/forms/nsFileControlFrame.cpp index 6926c1ab383..3480dbb6b15 100644 --- a/mozilla/layout/forms/nsFileControlFrame.cpp +++ b/mozilla/layout/forms/nsFileControlFrame.cpp @@ -197,7 +197,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext, text->SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::disabled, nsAutoString("1"), PR_FALSE); // XXX this should use an "empty" bool value } NS_NewTextControlFrame(childFrame); - childFrame->Init(aPresContext, text, this, this, mStyleContext); + childFrame->Init(aPresContext, text, this, mStyleContext); mTextFrame = (nsTextControlFrame*)childFrame; mFirstChild = childFrame; @@ -211,7 +211,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext, NS_NewButtonControlFrame(childFrame); ((nsButtonControlFrame*)childFrame)->SetFileControlFrame(this); mBrowseFrame = (nsButtonControlFrame*)childFrame; - childFrame->Init(aPresContext, browse, this, this, mStyleContext); + childFrame->Init(aPresContext, browse, this, mStyleContext); mFirstChild->SetNextSibling(childFrame); diff --git a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp index 9b764e3c4cc..8dccecdeb53 100644 --- a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp @@ -512,13 +512,12 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext& aPresContext, // Resolve style and initialize the frame nsIStyleContext* styleContext = aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::buttonContentPseudo, mStyleContext); - mFirstChild->Init(aPresContext, mContent, this, this, styleContext); + mFirstChild->Init(aPresContext, mContent, this, styleContext); NS_RELEASE(styleContext); - // Set the geometric and content parent for each of the child frames + // Set the parent for each of the child frames for (nsIFrame* frame = aChildList; nsnull != frame; frame->GetNextSibling(frame)) { - frame->SetGeometricParent(mFirstChild); - frame->SetContentParent(mFirstChild); + frame->SetParent(mFirstChild); } // Queue up the frames for the inline frame diff --git a/mozilla/layout/forms/nsLegendFrame.cpp b/mozilla/layout/forms/nsLegendFrame.cpp index ab99e596650..9d4c4b95af2 100644 --- a/mozilla/layout/forms/nsLegendFrame.cpp +++ b/mozilla/layout/forms/nsLegendFrame.cpp @@ -95,13 +95,12 @@ nsLegendFrame::SetInitialChildList(nsIPresContext& aPresContext, // Resolve style and initialize the frame nsIStyleContext* styleContext = aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::legendContentPseudo, mStyleContext); - mFirstChild->Init(aPresContext, mContent, this, this, styleContext); + mFirstChild->Init(aPresContext, mContent, this, styleContext); NS_RELEASE(styleContext); - // Set the geometric and content parent for each of the child frames + // Set the parent for each of the child frames for (nsIFrame* frame = aChildList; nsnull != frame; frame->GetNextSibling(frame)) { - frame->SetGeometricParent(mFirstChild); - frame->SetContentParent(mFirstChild); + frame->SetParent(mFirstChild); } // Queue up the frames for the inline frame diff --git a/mozilla/layout/generic/nsAreaFrame.cpp b/mozilla/layout/generic/nsAreaFrame.cpp index b915867a1ff..64de9d7a233 100644 --- a/mozilla/layout/generic/nsAreaFrame.cpp +++ b/mozilla/layout/generic/nsAreaFrame.cpp @@ -460,7 +460,7 @@ nsAreaFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->SetFlags(mFlags); cf->AppendToFlow(this); aContinuingFrame = cf; @@ -593,13 +593,13 @@ void nsAreaFrame::TranslatePoint(nsIFrame* aFrameFrom, nsPoint& aPoint) const { nsIFrame* parent; - aFrameFrom->GetGeometricParent(parent); + aFrameFrom->GetParent(parent); while ((nsnull != parent) && (parent != (nsIFrame*)this)) { nsPoint origin; parent->GetOrigin(origin); aPoint += origin; - parent->GetGeometricParent(parent); + parent->GetParent(parent); } } diff --git a/mozilla/layout/generic/nsBlockBandData.cpp b/mozilla/layout/generic/nsBlockBandData.cpp index acf739e3a7c..6c0d041d2e1 100644 --- a/mozilla/layout/generic/nsBlockBandData.cpp +++ b/mozilla/layout/generic/nsBlockBandData.cpp @@ -237,7 +237,7 @@ nsBlockBandData::GetFrameYMost(nsIFrame* aFrame) aFrame->GetRect(r); nscoord y = r.y; nsIFrame* parent; - aFrame->GetGeometricParent(parent); + aFrame->GetParent(parent); PRBool done = PR_FALSE; while (!done && (parent != spaceFrame)) { // If parent has a prev-in-flow, check there for equality first @@ -255,7 +255,7 @@ nsBlockBandData::GetFrameYMost(nsIFrame* aFrame) if (!done) { parent->GetOrigin(p); y += p.y; - parent->GetGeometricParent(parent); + parent->GetParent(parent); } } diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index 13788aebf41..64dab7bba15 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -1383,14 +1383,7 @@ nsBaseIBFrame::ReflowDirtyLines(nsBlockReflowState& aState) nsIFrame* lastFrame = nsnull; PRInt32 n = line->ChildCount(); while (--n >= 0) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); lastFrame = frame; frame->GetNextSibling(frame); } @@ -1768,14 +1761,7 @@ nsBaseIBFrame::PullFrame(nsBlockReflowState& aState, // Change geometric parents if (aUpdateGeometricParent) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); // The frame is being pulled from a next-in-flow; therefore we // need to add it to our sibling list. @@ -2880,14 +2866,7 @@ nsBaseIBFrame::DrainOverflowLines() nsIFrame* lastFrame = nsnull; nsIFrame* frame = line->mFirstChild; while (nsnull != frame) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); lastFrame = frame; frame->GetNextSibling(frame); } @@ -3263,7 +3242,7 @@ nsBaseIBFrame::DoRemoveFrame(nsBlockReflowState& aState, while ((nsnull != line) && (nsnull != aDeletedFrame)) { #ifdef NS_DEBUG nsIFrame* parent; - aDeletedFrame->GetGeometricParent(parent); + aDeletedFrame->GetParent(parent); NS_ASSERTION(flow == parent, "messed up delete code"); #endif NS_FRAME_TRACE(NS_FRAME_TRACE_CHILD_REFLOW, @@ -3346,9 +3325,9 @@ nsBaseIBFrame::DoRemoveFrame(nsBlockReflowState& aState, // continuation is in a different parent. So break out of // the loop so that we advance to the next parent. #ifdef NS_DEBUG - nsIFrame* contParent; - aDeletedFrame->GetContentParent(contParent); - NS_ASSERTION(contParent != flow, "strange continuation"); + nsIFrame* parent; + aDeletedFrame->GetParent(parent); + NS_ASSERTION(parent != flow, "strange continuation"); #endif break; } @@ -3481,7 +3460,7 @@ nsBaseIBFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, aChild->GetNextInFlow(nextInFlow); NS_PRECONDITION(nsnull != nextInFlow, "null next-in-flow"); - nextInFlow->GetGeometricParent((nsIFrame*&)parent); + nextInFlow->GetParent((nsIFrame*&)parent); // If the next-in-flow has a next-in-flow then delete it, too (and // delete it first). @@ -3642,7 +3621,7 @@ nsBlockReflowState::InitFloater(nsPlaceholderFrame* aPlaceholder) { // Set the geometric parent of the floater nsIFrame* floater = aPlaceholder->GetAnchoredItem(); - floater->SetGeometricParent(mBlock); + floater->SetParent(mBlock); // Then add the floater to the current line and place it when // appropriate @@ -3732,7 +3711,7 @@ nsBlockReflowState::IsLeftMostChild(nsIFrame* aFrame) { for (;;) { nsIFrame* parent; - aFrame->GetGeometricParent(parent); + aFrame->GetParent(parent); if (parent == mBlock) { nsIFrame* child = mCurrentLine->mFirstChild; PRInt32 n = mCurrentLine->ChildCount(); @@ -4104,7 +4083,7 @@ PRBool nsBaseIBFrame::IsChild(nsIFrame* aFrame) { nsIFrame* parent; - aFrame->GetGeometricParent(parent); + aFrame->GetParent(parent); if (parent != (nsIFrame*)this) { return PR_FALSE; } @@ -4290,7 +4269,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext, NS_RELEASE(kidSC); return NS_ERROR_OUT_OF_MEMORY; } - mBullet->Init(aPresContext, mContent, this, this, kidSC); + mBullet->Init(aPresContext, mContent, this, kidSC); NS_RELEASE(kidSC); // If the list bullet frame should be positioned inside then add @@ -4453,7 +4432,7 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->SetFlags(mFlags); cf->AppendToFlow(this); aContinuingFrame = cf; @@ -4805,14 +4784,7 @@ nsBlockFrame::TakeRunInFrames(nsBlockFrame* aRunInFrame) nsIFrame* lastFrame = nsnull; nsIFrame* frame = line->mFirstChild; while (nsnull != frame) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); lastFrame = frame; frame->GetNextSibling(frame); } diff --git a/mozilla/layout/generic/nsBlockReflowContext.cpp b/mozilla/layout/generic/nsBlockReflowContext.cpp index 8903633df77..e8733c5568b 100644 --- a/mozilla/layout/generic/nsBlockReflowContext.cpp +++ b/mozilla/layout/generic/nsBlockReflowContext.cpp @@ -183,7 +183,7 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, // parent is not this because we are executing pullup code) /* XXX promote DeleteChildsNextInFlow to nsIFrame to elminate this cast */ nsHTMLContainerFrame* parent; - aFrame->GetGeometricParent((nsIFrame*&) parent); + aFrame->GetParent((nsIFrame*&) parent); parent->DeleteChildsNextInFlow(mPresContext, aFrame); } } diff --git a/mozilla/layout/generic/nsBlockReflowState.cpp b/mozilla/layout/generic/nsBlockReflowState.cpp index 13788aebf41..64dab7bba15 100644 --- a/mozilla/layout/generic/nsBlockReflowState.cpp +++ b/mozilla/layout/generic/nsBlockReflowState.cpp @@ -1383,14 +1383,7 @@ nsBaseIBFrame::ReflowDirtyLines(nsBlockReflowState& aState) nsIFrame* lastFrame = nsnull; PRInt32 n = line->ChildCount(); while (--n >= 0) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); lastFrame = frame; frame->GetNextSibling(frame); } @@ -1768,14 +1761,7 @@ nsBaseIBFrame::PullFrame(nsBlockReflowState& aState, // Change geometric parents if (aUpdateGeometricParent) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); // The frame is being pulled from a next-in-flow; therefore we // need to add it to our sibling list. @@ -2880,14 +2866,7 @@ nsBaseIBFrame::DrainOverflowLines() nsIFrame* lastFrame = nsnull; nsIFrame* frame = line->mFirstChild; while (nsnull != frame) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); lastFrame = frame; frame->GetNextSibling(frame); } @@ -3263,7 +3242,7 @@ nsBaseIBFrame::DoRemoveFrame(nsBlockReflowState& aState, while ((nsnull != line) && (nsnull != aDeletedFrame)) { #ifdef NS_DEBUG nsIFrame* parent; - aDeletedFrame->GetGeometricParent(parent); + aDeletedFrame->GetParent(parent); NS_ASSERTION(flow == parent, "messed up delete code"); #endif NS_FRAME_TRACE(NS_FRAME_TRACE_CHILD_REFLOW, @@ -3346,9 +3325,9 @@ nsBaseIBFrame::DoRemoveFrame(nsBlockReflowState& aState, // continuation is in a different parent. So break out of // the loop so that we advance to the next parent. #ifdef NS_DEBUG - nsIFrame* contParent; - aDeletedFrame->GetContentParent(contParent); - NS_ASSERTION(contParent != flow, "strange continuation"); + nsIFrame* parent; + aDeletedFrame->GetParent(parent); + NS_ASSERTION(parent != flow, "strange continuation"); #endif break; } @@ -3481,7 +3460,7 @@ nsBaseIBFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, aChild->GetNextInFlow(nextInFlow); NS_PRECONDITION(nsnull != nextInFlow, "null next-in-flow"); - nextInFlow->GetGeometricParent((nsIFrame*&)parent); + nextInFlow->GetParent((nsIFrame*&)parent); // If the next-in-flow has a next-in-flow then delete it, too (and // delete it first). @@ -3642,7 +3621,7 @@ nsBlockReflowState::InitFloater(nsPlaceholderFrame* aPlaceholder) { // Set the geometric parent of the floater nsIFrame* floater = aPlaceholder->GetAnchoredItem(); - floater->SetGeometricParent(mBlock); + floater->SetParent(mBlock); // Then add the floater to the current line and place it when // appropriate @@ -3732,7 +3711,7 @@ nsBlockReflowState::IsLeftMostChild(nsIFrame* aFrame) { for (;;) { nsIFrame* parent; - aFrame->GetGeometricParent(parent); + aFrame->GetParent(parent); if (parent == mBlock) { nsIFrame* child = mCurrentLine->mFirstChild; PRInt32 n = mCurrentLine->ChildCount(); @@ -4104,7 +4083,7 @@ PRBool nsBaseIBFrame::IsChild(nsIFrame* aFrame) { nsIFrame* parent; - aFrame->GetGeometricParent(parent); + aFrame->GetParent(parent); if (parent != (nsIFrame*)this) { return PR_FALSE; } @@ -4290,7 +4269,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext, NS_RELEASE(kidSC); return NS_ERROR_OUT_OF_MEMORY; } - mBullet->Init(aPresContext, mContent, this, this, kidSC); + mBullet->Init(aPresContext, mContent, this, kidSC); NS_RELEASE(kidSC); // If the list bullet frame should be positioned inside then add @@ -4453,7 +4432,7 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->SetFlags(mFlags); cf->AppendToFlow(this); aContinuingFrame = cf; @@ -4805,14 +4784,7 @@ nsBlockFrame::TakeRunInFrames(nsBlockFrame* aRunInFrame) nsIFrame* lastFrame = nsnull; nsIFrame* frame = line->mFirstChild; while (nsnull != frame) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); lastFrame = frame; frame->GetNextSibling(frame); } diff --git a/mozilla/layout/generic/nsBlockReflowState.h b/mozilla/layout/generic/nsBlockReflowState.h index 13788aebf41..64dab7bba15 100644 --- a/mozilla/layout/generic/nsBlockReflowState.h +++ b/mozilla/layout/generic/nsBlockReflowState.h @@ -1383,14 +1383,7 @@ nsBaseIBFrame::ReflowDirtyLines(nsBlockReflowState& aState) nsIFrame* lastFrame = nsnull; PRInt32 n = line->ChildCount(); while (--n >= 0) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); lastFrame = frame; frame->GetNextSibling(frame); } @@ -1768,14 +1761,7 @@ nsBaseIBFrame::PullFrame(nsBlockReflowState& aState, // Change geometric parents if (aUpdateGeometricParent) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); // The frame is being pulled from a next-in-flow; therefore we // need to add it to our sibling list. @@ -2880,14 +2866,7 @@ nsBaseIBFrame::DrainOverflowLines() nsIFrame* lastFrame = nsnull; nsIFrame* frame = line->mFirstChild; while (nsnull != frame) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); lastFrame = frame; frame->GetNextSibling(frame); } @@ -3263,7 +3242,7 @@ nsBaseIBFrame::DoRemoveFrame(nsBlockReflowState& aState, while ((nsnull != line) && (nsnull != aDeletedFrame)) { #ifdef NS_DEBUG nsIFrame* parent; - aDeletedFrame->GetGeometricParent(parent); + aDeletedFrame->GetParent(parent); NS_ASSERTION(flow == parent, "messed up delete code"); #endif NS_FRAME_TRACE(NS_FRAME_TRACE_CHILD_REFLOW, @@ -3346,9 +3325,9 @@ nsBaseIBFrame::DoRemoveFrame(nsBlockReflowState& aState, // continuation is in a different parent. So break out of // the loop so that we advance to the next parent. #ifdef NS_DEBUG - nsIFrame* contParent; - aDeletedFrame->GetContentParent(contParent); - NS_ASSERTION(contParent != flow, "strange continuation"); + nsIFrame* parent; + aDeletedFrame->GetParent(parent); + NS_ASSERTION(parent != flow, "strange continuation"); #endif break; } @@ -3481,7 +3460,7 @@ nsBaseIBFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, aChild->GetNextInFlow(nextInFlow); NS_PRECONDITION(nsnull != nextInFlow, "null next-in-flow"); - nextInFlow->GetGeometricParent((nsIFrame*&)parent); + nextInFlow->GetParent((nsIFrame*&)parent); // If the next-in-flow has a next-in-flow then delete it, too (and // delete it first). @@ -3642,7 +3621,7 @@ nsBlockReflowState::InitFloater(nsPlaceholderFrame* aPlaceholder) { // Set the geometric parent of the floater nsIFrame* floater = aPlaceholder->GetAnchoredItem(); - floater->SetGeometricParent(mBlock); + floater->SetParent(mBlock); // Then add the floater to the current line and place it when // appropriate @@ -3732,7 +3711,7 @@ nsBlockReflowState::IsLeftMostChild(nsIFrame* aFrame) { for (;;) { nsIFrame* parent; - aFrame->GetGeometricParent(parent); + aFrame->GetParent(parent); if (parent == mBlock) { nsIFrame* child = mCurrentLine->mFirstChild; PRInt32 n = mCurrentLine->ChildCount(); @@ -4104,7 +4083,7 @@ PRBool nsBaseIBFrame::IsChild(nsIFrame* aFrame) { nsIFrame* parent; - aFrame->GetGeometricParent(parent); + aFrame->GetParent(parent); if (parent != (nsIFrame*)this) { return PR_FALSE; } @@ -4290,7 +4269,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext, NS_RELEASE(kidSC); return NS_ERROR_OUT_OF_MEMORY; } - mBullet->Init(aPresContext, mContent, this, this, kidSC); + mBullet->Init(aPresContext, mContent, this, kidSC); NS_RELEASE(kidSC); // If the list bullet frame should be positioned inside then add @@ -4453,7 +4432,7 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->SetFlags(mFlags); cf->AppendToFlow(this); aContinuingFrame = cf; @@ -4805,14 +4784,7 @@ nsBlockFrame::TakeRunInFrames(nsBlockFrame* aRunInFrame) nsIFrame* lastFrame = nsnull; nsIFrame* frame = line->mFirstChild; while (nsnull != frame) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); lastFrame = frame; frame->GetNextSibling(frame); } diff --git a/mozilla/layout/generic/nsBulletFrame.cpp b/mozilla/layout/generic/nsBulletFrame.cpp index 0e6076c804a..51d37ffa483 100644 --- a/mozilla/layout/generic/nsBulletFrame.cpp +++ b/mozilla/layout/generic/nsBulletFrame.cpp @@ -167,7 +167,7 @@ nsBulletFrame::SetListItemOrdinal(PRInt32 aNextOrdinal) // because our parent is the list-item. nsHTMLValue value; nsIContent* parentContent; - mContentParent->GetContent(parentContent); + mParent->GetContent(parentContent); nsIHTMLContent* hc; if (NS_OK == parentContent->QueryInterface(kIHTMLContentIID, (void**) &hc)) { if (NS_CONTENT_ATTR_HAS_VALUE == diff --git a/mozilla/layout/generic/nsContainerFrame.cpp b/mozilla/layout/generic/nsContainerFrame.cpp index 622274b7f8e..46eea193ec6 100644 --- a/mozilla/layout/generic/nsContainerFrame.cpp +++ b/mozilla/layout/generic/nsContainerFrame.cpp @@ -405,7 +405,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, // the right parent to do the removal (it's possible that the // parent is not this because we are executing pullup code) nsIFrame* parent; - aKidFrame->GetGeometricParent(parent); + aKidFrame->GetParent(parent); ((nsContainerFrame*)parent)->DeleteChildsNextInFlow(aPresContext, aKidFrame); } } @@ -433,7 +433,7 @@ nsContainerFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, nsIFrame* aChild->GetNextInFlow(nextInFlow); NS_PRECONDITION(nsnull != nextInFlow, "null next-in-flow"); - nextInFlow->GetGeometricParent((nsIFrame*&)parent); + nextInFlow->GetParent((nsIFrame*&)parent); // If the next-in-flow has a next-in-flow then delete it, too (and // delete it first). @@ -455,7 +455,7 @@ nsContainerFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, nsIFrame* nsIFrame* top = nextInFlow; for (;;) { nsIFrame* parent; - top->GetGeometricParent(parent); + top->GetParent(parent); if (nsnull == parent) { break; } @@ -549,14 +549,7 @@ void nsContainerFrame::PushChildren(nsIFrame* aFromChild, nsIFrame* aPrevSibling printf("\n"); #endif lastChild = f; - f->SetGeometricParent(nextInFlow); - - nsIFrame* contentParent; - - f->GetContentParent(contentParent); - if (this == contentParent) { - f->SetContentParent(nextInFlow); - } + f->SetParent(nextInFlow); } NS_ASSERTION(numChildren > 0, "no children to push"); @@ -637,15 +630,7 @@ void nsContainerFrame::AppendChildren(nsIFrame* aChild, PRBool aSetParent) // Reset the geometric parent if requested if (aSetParent) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - - f->GetGeometricParent(geometricParent); - f->GetContentParent(contentParent); - if (contentParent == geometricParent) { - f->SetContentParent(this); - } - f->SetGeometricParent(this); + f->SetParent(this); } } } @@ -772,7 +757,7 @@ PRBool nsContainerFrame::IsChild(const nsIFrame* aChild) const // Check the geometric parent nsIFrame* parent; - aChild->GetGeometricParent(parent); + aChild->GetParent(parent); if (parent != (nsIFrame*)this) { return PR_FALSE; } diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index efbb40eceb3..4bfe8908c74 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -272,14 +272,12 @@ nsrefcnt nsFrame::Release(void) NS_IMETHODIMP nsFrame::Init(nsIPresContext& aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aContext) { mContent = aContent; NS_IF_ADDREF(mContent); - mGeometricParent = aGeometricParent; - mContentParent = aContentParent; + mParent = aParent; return SetStyleContext(&aPresContext, aContext); } @@ -418,29 +416,17 @@ NS_IMETHODIMP nsFrame::ReResolveStyleContext(nsIPresContext* aPresContext, return NS_OK; } -// Geometric and content parent member functions +// Geometric parent member functions -NS_IMETHODIMP nsFrame::GetContentParent(nsIFrame*& aParent) const +NS_IMETHODIMP nsFrame::GetParent(nsIFrame*& aParent) const { - aParent = mContentParent; + aParent = mParent; return NS_OK; } -NS_IMETHODIMP nsFrame::SetContentParent(const nsIFrame* aParent) +NS_IMETHODIMP nsFrame::SetParent(const nsIFrame* aParent) { - mContentParent = (nsIFrame*)aParent; - return NS_OK; -} - -NS_IMETHODIMP nsFrame::GetGeometricParent(nsIFrame*& aParent) const -{ - aParent = mGeometricParent; - return NS_OK; -} - -NS_IMETHODIMP nsFrame::SetGeometricParent(const nsIFrame* aParent) -{ - mGeometricParent = (nsIFrame*)aParent; + mParent = (nsIFrame*)aParent; return NS_OK; } @@ -1169,8 +1155,8 @@ nsFrame::GetCursor(nsIPresContext& aPresContext, GetStyleData(eStyleStruct_Color, (const nsStyleStruct*&)styleColor); aCursor = styleColor->mCursor; - if ((NS_STYLE_CURSOR_AUTO == aCursor) && (nsnull != mContentParent)) { - mContentParent->GetCursor(aPresContext, aPoint, aCursor); + if ((NS_STYLE_CURSOR_AUTO == aCursor) && (nsnull != mParent)) { + mParent->GetCursor(aPresContext, aPoint, aCursor); } return NS_OK; @@ -1398,7 +1384,7 @@ NS_IMETHODIMP nsFrame::SetView(nsIView* aView) // Find the first geometric parent that has a view NS_IMETHODIMP nsFrame::GetParentWithView(nsIFrame*& aParent) const { - aParent = mGeometricParent; + aParent = mParent; while (nsnull != aParent) { nsIView* parView; @@ -1407,7 +1393,7 @@ NS_IMETHODIMP nsFrame::GetParentWithView(nsIFrame*& aParent) const if (nsnull != parView) { break; } - aParent->GetGeometricParent(aParent); + aParent->GetParent(aParent); } return NS_OK; @@ -1426,7 +1412,7 @@ NS_IMETHODIMP nsFrame::GetOffsetFromView(nsPoint& aOffset, nsIView*& aView) cons frame->GetOrigin(origin); aOffset += origin; - frame->GetGeometricParent(frame); + frame->GetParent(frame); if (nsnull != frame) { frame->GetView(aView); } @@ -1678,14 +1664,9 @@ nsFrame::DumpBaseRegressionData(FILE* out, PRInt32 aIndent) IndentBy(out, aIndent); fprintf(out, "\n", this); - if (mContentParent != mGeometricParent) { + if (nsnull != mParent) { IndentBy(out, aIndent); - fprintf(out, "\n", mContentParent); - } - - if (nsnull != mGeometricParent) { - IndentBy(out, aIndent); - fprintf(out, "\n", mGeometricParent); + fprintf(out, "\n", mParent); } if (nsnull != mNextSibling) { diff --git a/mozilla/layout/generic/nsFrame.h b/mozilla/layout/generic/nsFrame.h index 3705640c65a..a958dfa6418 100644 --- a/mozilla/layout/generic/nsFrame.h +++ b/mozilla/layout/generic/nsFrame.h @@ -113,8 +113,7 @@ public: // nsIFrame NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aContext); NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext, nsIAtom* aListName, @@ -129,10 +128,8 @@ public: const nsStyleStruct*& aStyleStruct) const; NS_IMETHOD ReResolveStyleContext(nsIPresContext* aPresContext, nsIStyleContext* aParentContext); - NS_IMETHOD GetContentParent(nsIFrame*& aParent) const; - NS_IMETHOD SetContentParent(const nsIFrame* aParent); - NS_IMETHOD GetGeometricParent(nsIFrame*& aParent) const; - NS_IMETHOD SetGeometricParent(const nsIFrame* aParent); + NS_IMETHOD GetParent(nsIFrame*& aParent) const; + NS_IMETHOD SetParent(const nsIFrame* aParent); NS_IMETHOD GetRect(nsRect& aRect) const; NS_IMETHOD GetOrigin(nsPoint& aPoint) const; NS_IMETHOD GetSize(nsSize& aSize) const; @@ -345,8 +342,7 @@ protected: nsRect mRect; nsIContent* mContent; nsIStyleContext* mStyleContext; - nsIFrame* mContentParent; - nsIFrame* mGeometricParent; + nsIFrame* mParent; nsIFrame* mNextSibling; // singly linked list of frames nsFrameState mState; PRBool mSelected; diff --git a/mozilla/layout/generic/nsFrameFrame.cpp b/mozilla/layout/generic/nsFrameFrame.cpp index dea766c777c..4fb2fab9bb6 100644 --- a/mozilla/layout/generic/nsFrameFrame.cpp +++ b/mozilla/layout/generic/nsFrameFrame.cpp @@ -319,7 +319,7 @@ nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext, if (nsnull == mFirstChild) { mFirstChild = new nsHTMLFrameInnerFrame; // XXX temporary! use style system to get correct style! - mFirstChild->Init(aPresContext, mContent, this, this, mStyleContext); + mFirstChild->Init(aPresContext, mContent, this, mStyleContext); } // nsContainerFrame::PaintBorder has some problems, kludge it here @@ -597,7 +597,7 @@ NS_IMETHODIMP nsHTMLFrameInnerFrame::GetParentContent(nsIContent*& aContent) { nsHTMLFrameOuterFrame* parent; - GetGeometricParent((nsIFrame*&)parent); + GetParent((nsIFrame*&)parent); return parent->GetContent((nsIContent*&)aContent); } diff --git a/mozilla/layout/generic/nsFrameSetFrame.cpp b/mozilla/layout/generic/nsFrameSetFrame.cpp index ab8e53631dc..2231798136c 100644 --- a/mozilla/layout/generic/nsFrameSetFrame.cpp +++ b/mozilla/layout/generic/nsFrameSetFrame.cpp @@ -381,7 +381,7 @@ nsHTMLFramesetFrame* nsHTMLFramesetFrame::GetFramesetParent(nsIFrame* aChild) nsIAtom* tag; contentParent2->GetTag(tag); if (nsHTMLAtoms::frameset == tag) { - aChild->GetGeometricParent((nsIFrame*&)parent); + aChild->GetParent((nsIFrame*&)parent); } NS_IF_RELEASE(tag); NS_RELEASE(contentParent2); @@ -936,7 +936,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, if (nsHTMLAtoms::frameset == tag) { result = NS_NewHTMLFramesetFrame(frame); - frame->Init(aPresContext, child, this, this, kidSC); + frame->Init(aPresContext, child, this, kidSC); childTypes[mChildCount] = FRAMESET; nsHTMLFramesetFrame* childFrame = (nsHTMLFramesetFrame*)frame; @@ -946,7 +946,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, childBorderColors[mChildCount].Set(childFrame->GetBorderColor()); } else { // frame result = NS_NewHTMLFrameOuterFrame(frame); - frame->Init(aPresContext, child, this, this, kidSC); + frame->Init(aPresContext, child, this, kidSC); childTypes[mChildCount] = FRAME; // @@ -979,7 +979,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, nsHTMLFramesetBlankFrame* blankFrame = new nsHTMLFramesetBlankFrame; nsIStyleContext* pseudoStyleContext = aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::framesetBlankPseudo, mStyleContext); - blankFrame->Init(aPresContext, mContent, this, this, pseudoStyleContext); + blankFrame->Init(aPresContext, mContent, this, pseudoStyleContext); NS_RELEASE(pseudoStyleContext); if (nsnull == lastChild) { @@ -1017,7 +1017,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, borderFrame = new nsHTMLFramesetBorderFrame(borderWidth, PR_FALSE, PR_FALSE); nsIStyleContext* pseudoStyleContext = aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::horizontalFramesetBorderPseudo, mStyleContext); - borderFrame->Init(aPresContext, mContent, this, this, pseudoStyleContext); + borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext); NS_RELEASE(pseudoStyleContext); mChildCount++; @@ -1042,7 +1042,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, borderFrame = new nsHTMLFramesetBorderFrame(borderWidth, PR_TRUE, PR_FALSE); nsIStyleContext* pseudoStyleContext = aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::verticalFramesetBorderPseudo, mStyleContext); - borderFrame->Init(aPresContext, mContent, this, this, pseudoStyleContext); + borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext); NS_RELEASE(pseudoStyleContext); mChildCount++; @@ -1590,7 +1590,7 @@ nsHTMLFramesetBorderFrame::HandleEvent(nsIPresContext& aPresContext, switch (aEvent->message) { case NS_MOUSE_LEFT_BUTTON_DOWN: nsHTMLFramesetFrame* parentFrame = nsnull; - GetGeometricParent((nsIFrame*&)parentFrame); + GetParent((nsIFrame*&)parentFrame); parentFrame->StartMouseDrag(aPresContext, this, aEvent); aEventStatus = nsEventStatus_eConsumeNoDefault; break; diff --git a/mozilla/layout/generic/nsHTMLContainerFrame.cpp b/mozilla/layout/generic/nsHTMLContainerFrame.cpp index f232fda4ac3..49c872208ed 100644 --- a/mozilla/layout/generic/nsHTMLContainerFrame.cpp +++ b/mozilla/layout/generic/nsHTMLContainerFrame.cpp @@ -93,7 +93,7 @@ nsHTMLContainerFrame::CreatePlaceholderFrame(nsIPresContext& aPresContext, aPresContext.ResolvePseudoStyleContextFor(content, nsHTMLAtoms::placeholderPseudo, kidSC); NS_RELEASE(kidSC); - placeholder->Init(aPresContext, content, this, this, placeholderPseudoStyle); + placeholder->Init(aPresContext, content, this, placeholderPseudoStyle); NS_RELEASE(placeholderPseudoStyle); NS_IF_RELEASE(content); diff --git a/mozilla/layout/generic/nsHTMLReflowCommand.cpp b/mozilla/layout/generic/nsHTMLReflowCommand.cpp index 8c99e4559b7..647a777e268 100644 --- a/mozilla/layout/generic/nsHTMLReflowCommand.cpp +++ b/mozilla/layout/generic/nsHTMLReflowCommand.cpp @@ -102,7 +102,7 @@ NS_IMPL_ISUPPORTS(nsHTMLReflowCommand, kIReflowCommandIID); nsIFrame* nsHTMLReflowCommand::GetContainingBlock(nsIFrame* aFloater) { nsIFrame* containingBlock; - aFloater->GetGeometricParent(containingBlock); + aFloater->GetParent(containingBlock); return containingBlock; } @@ -117,14 +117,12 @@ void nsHTMLReflowCommand::BuildPath() if (NS_STYLE_FLOAT_NONE != display->mFloats) { mPath.AppendElement((void*)mTargetFrame); - for (nsIFrame* f = GetContainingBlock(mTargetFrame); - nsnull != f; - f->GetGeometricParent(f)) { + for (nsIFrame* f = GetContainingBlock(mTargetFrame); nsnull != f; f->GetParent(f)) { mPath.AppendElement((void*)f); } } else { - for (nsIFrame* f = mTargetFrame; nsnull != f; f->GetGeometricParent(f)) { + for (nsIFrame* f = mTargetFrame; nsnull != f; f->GetParent(f)) { mPath.AppendElement((void*)f); } } diff --git a/mozilla/layout/generic/nsHTMLReflowState.cpp b/mozilla/layout/generic/nsHTMLReflowState.cpp index bd884b5e225..36e225cc321 100644 --- a/mozilla/layout/generic/nsHTMLReflowState.cpp +++ b/mozilla/layout/generic/nsHTMLReflowState.cpp @@ -244,13 +244,13 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, placeholderFrame->GetOrigin(placeholderOffset); nsIFrame* parent; - placeholderFrame->GetGeometricParent(parent); + placeholderFrame->GetParent(parent); while ((nsnull != parent) && (parent != cbrs->frame)) { nsPoint origin; parent->GetOrigin(origin); placeholderOffset += origin; - parent->GetGeometricParent(parent); + parent->GetParent(parent); } } } diff --git a/mozilla/layout/generic/nsIFrame.h b/mozilla/layout/generic/nsIFrame.h index c008fede516..2a1135614ce 100644 --- a/mozilla/layout/generic/nsIFrame.h +++ b/mozilla/layout/generic/nsIFrame.h @@ -158,8 +158,7 @@ public: */ NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aContext) = 0; /** @@ -230,12 +229,10 @@ public: nsIStyleContext* aParentContext) = 0; /** - * Accessor functions for geometric and content parent. + * Accessor functions for geometric parent */ - NS_IMETHOD GetContentParent(nsIFrame*& aParent) const = 0; - NS_IMETHOD SetContentParent(const nsIFrame* aParent) = 0; - NS_IMETHOD GetGeometricParent(nsIFrame*& aParent) const = 0; - NS_IMETHOD SetGeometricParent(const nsIFrame* aParent) = 0; + NS_IMETHOD GetParent(nsIFrame*& aParent) const = 0; + NS_IMETHOD SetParent(const nsIFrame* aParent) = 0; /** * Bounding rect of the frame. The values are in twips, and the origin is diff --git a/mozilla/layout/generic/nsImageFrame.cpp b/mozilla/layout/generic/nsImageFrame.cpp index 2fe7f4629f9..9d637056953 100644 --- a/mozilla/layout/generic/nsImageFrame.cpp +++ b/mozilla/layout/generic/nsImageFrame.cpp @@ -345,12 +345,10 @@ nsImageFrame::DeleteFrame(nsIPresContext& aPresContext) NS_IMETHODIMP nsImageFrame::Init(nsIPresContext& aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aContext) { - nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aGeometricParent, - aContentParent, aContext); + nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aParent, aContext); // Set the image loader's source URL and base URL nsAutoString src, base; diff --git a/mozilla/layout/generic/nsInlineFrame.cpp b/mozilla/layout/generic/nsInlineFrame.cpp index f1a6d484845..4a363be284d 100644 --- a/mozilla/layout/generic/nsInlineFrame.cpp +++ b/mozilla/layout/generic/nsInlineFrame.cpp @@ -276,7 +276,7 @@ nsInlineFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->SetFlags(mFlags); cf->AppendToFlow(this); aContinuingFrame = cf; diff --git a/mozilla/layout/generic/nsPageFrame.cpp b/mozilla/layout/generic/nsPageFrame.cpp index e8b23b90181..68da48b3a64 100644 --- a/mozilla/layout/generic/nsPageFrame.cpp +++ b/mozilla/layout/generic/nsPageFrame.cpp @@ -133,7 +133,7 @@ nsPageFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->AppendToFlow(this); aContinuingFrame = cf; return NS_OK; diff --git a/mozilla/layout/generic/nsTextFrame.cpp b/mozilla/layout/generic/nsTextFrame.cpp index dde903c1acd..0b64c5ba5d0 100644 --- a/mozilla/layout/generic/nsTextFrame.cpp +++ b/mozilla/layout/generic/nsTextFrame.cpp @@ -453,8 +453,8 @@ TextFrame::GetCursor(nsIPresContext& aPresContext, GetStyleData(eStyleStruct_Color, (const nsStyleStruct*&)styleColor); aCursor = styleColor->mCursor; - if (NS_STYLE_CURSOR_AUTO == aCursor && nsnull != mGeometricParent) { - mGeometricParent->GetCursor(aPresContext, aPoint, aCursor); + if (NS_STYLE_CURSOR_AUTO == aCursor && nsnull != mParent) { + mParent->GetCursor(aPresContext, aPoint, aCursor); if (NS_STYLE_CURSOR_AUTO == aCursor) { aCursor = NS_STYLE_CURSOR_TEXT; } @@ -472,7 +472,7 @@ TextFrame::CreateContinuingFrame(nsIPresContext& aCX, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aCX, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aCX, mContent, aParent, aStyleContext); cf->AppendToFlow(this); aContinuingFrame = cf; return NS_OK; diff --git a/mozilla/layout/html/base/src/nsAreaFrame.cpp b/mozilla/layout/html/base/src/nsAreaFrame.cpp index b915867a1ff..64de9d7a233 100644 --- a/mozilla/layout/html/base/src/nsAreaFrame.cpp +++ b/mozilla/layout/html/base/src/nsAreaFrame.cpp @@ -460,7 +460,7 @@ nsAreaFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->SetFlags(mFlags); cf->AppendToFlow(this); aContinuingFrame = cf; @@ -593,13 +593,13 @@ void nsAreaFrame::TranslatePoint(nsIFrame* aFrameFrom, nsPoint& aPoint) const { nsIFrame* parent; - aFrameFrom->GetGeometricParent(parent); + aFrameFrom->GetParent(parent); while ((nsnull != parent) && (parent != (nsIFrame*)this)) { nsPoint origin; parent->GetOrigin(origin); aPoint += origin; - parent->GetGeometricParent(parent); + parent->GetParent(parent); } } diff --git a/mozilla/layout/html/base/src/nsBlockBandData.cpp b/mozilla/layout/html/base/src/nsBlockBandData.cpp index acf739e3a7c..6c0d041d2e1 100644 --- a/mozilla/layout/html/base/src/nsBlockBandData.cpp +++ b/mozilla/layout/html/base/src/nsBlockBandData.cpp @@ -237,7 +237,7 @@ nsBlockBandData::GetFrameYMost(nsIFrame* aFrame) aFrame->GetRect(r); nscoord y = r.y; nsIFrame* parent; - aFrame->GetGeometricParent(parent); + aFrame->GetParent(parent); PRBool done = PR_FALSE; while (!done && (parent != spaceFrame)) { // If parent has a prev-in-flow, check there for equality first @@ -255,7 +255,7 @@ nsBlockBandData::GetFrameYMost(nsIFrame* aFrame) if (!done) { parent->GetOrigin(p); y += p.y; - parent->GetGeometricParent(parent); + parent->GetParent(parent); } } diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index 13788aebf41..64dab7bba15 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -1383,14 +1383,7 @@ nsBaseIBFrame::ReflowDirtyLines(nsBlockReflowState& aState) nsIFrame* lastFrame = nsnull; PRInt32 n = line->ChildCount(); while (--n >= 0) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); lastFrame = frame; frame->GetNextSibling(frame); } @@ -1768,14 +1761,7 @@ nsBaseIBFrame::PullFrame(nsBlockReflowState& aState, // Change geometric parents if (aUpdateGeometricParent) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); // The frame is being pulled from a next-in-flow; therefore we // need to add it to our sibling list. @@ -2880,14 +2866,7 @@ nsBaseIBFrame::DrainOverflowLines() nsIFrame* lastFrame = nsnull; nsIFrame* frame = line->mFirstChild; while (nsnull != frame) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); lastFrame = frame; frame->GetNextSibling(frame); } @@ -3263,7 +3242,7 @@ nsBaseIBFrame::DoRemoveFrame(nsBlockReflowState& aState, while ((nsnull != line) && (nsnull != aDeletedFrame)) { #ifdef NS_DEBUG nsIFrame* parent; - aDeletedFrame->GetGeometricParent(parent); + aDeletedFrame->GetParent(parent); NS_ASSERTION(flow == parent, "messed up delete code"); #endif NS_FRAME_TRACE(NS_FRAME_TRACE_CHILD_REFLOW, @@ -3346,9 +3325,9 @@ nsBaseIBFrame::DoRemoveFrame(nsBlockReflowState& aState, // continuation is in a different parent. So break out of // the loop so that we advance to the next parent. #ifdef NS_DEBUG - nsIFrame* contParent; - aDeletedFrame->GetContentParent(contParent); - NS_ASSERTION(contParent != flow, "strange continuation"); + nsIFrame* parent; + aDeletedFrame->GetParent(parent); + NS_ASSERTION(parent != flow, "strange continuation"); #endif break; } @@ -3481,7 +3460,7 @@ nsBaseIBFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, aChild->GetNextInFlow(nextInFlow); NS_PRECONDITION(nsnull != nextInFlow, "null next-in-flow"); - nextInFlow->GetGeometricParent((nsIFrame*&)parent); + nextInFlow->GetParent((nsIFrame*&)parent); // If the next-in-flow has a next-in-flow then delete it, too (and // delete it first). @@ -3642,7 +3621,7 @@ nsBlockReflowState::InitFloater(nsPlaceholderFrame* aPlaceholder) { // Set the geometric parent of the floater nsIFrame* floater = aPlaceholder->GetAnchoredItem(); - floater->SetGeometricParent(mBlock); + floater->SetParent(mBlock); // Then add the floater to the current line and place it when // appropriate @@ -3732,7 +3711,7 @@ nsBlockReflowState::IsLeftMostChild(nsIFrame* aFrame) { for (;;) { nsIFrame* parent; - aFrame->GetGeometricParent(parent); + aFrame->GetParent(parent); if (parent == mBlock) { nsIFrame* child = mCurrentLine->mFirstChild; PRInt32 n = mCurrentLine->ChildCount(); @@ -4104,7 +4083,7 @@ PRBool nsBaseIBFrame::IsChild(nsIFrame* aFrame) { nsIFrame* parent; - aFrame->GetGeometricParent(parent); + aFrame->GetParent(parent); if (parent != (nsIFrame*)this) { return PR_FALSE; } @@ -4290,7 +4269,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext, NS_RELEASE(kidSC); return NS_ERROR_OUT_OF_MEMORY; } - mBullet->Init(aPresContext, mContent, this, this, kidSC); + mBullet->Init(aPresContext, mContent, this, kidSC); NS_RELEASE(kidSC); // If the list bullet frame should be positioned inside then add @@ -4453,7 +4432,7 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->SetFlags(mFlags); cf->AppendToFlow(this); aContinuingFrame = cf; @@ -4805,14 +4784,7 @@ nsBlockFrame::TakeRunInFrames(nsBlockFrame* aRunInFrame) nsIFrame* lastFrame = nsnull; nsIFrame* frame = line->mFirstChild; while (nsnull != frame) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); lastFrame = frame; frame->GetNextSibling(frame); } diff --git a/mozilla/layout/html/base/src/nsBlockReflowContext.cpp b/mozilla/layout/html/base/src/nsBlockReflowContext.cpp index 8903633df77..e8733c5568b 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowContext.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowContext.cpp @@ -183,7 +183,7 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, // parent is not this because we are executing pullup code) /* XXX promote DeleteChildsNextInFlow to nsIFrame to elminate this cast */ nsHTMLContainerFrame* parent; - aFrame->GetGeometricParent((nsIFrame*&) parent); + aFrame->GetParent((nsIFrame*&) parent); parent->DeleteChildsNextInFlow(mPresContext, aFrame); } } diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.cpp b/mozilla/layout/html/base/src/nsBlockReflowState.cpp index 13788aebf41..64dab7bba15 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowState.cpp @@ -1383,14 +1383,7 @@ nsBaseIBFrame::ReflowDirtyLines(nsBlockReflowState& aState) nsIFrame* lastFrame = nsnull; PRInt32 n = line->ChildCount(); while (--n >= 0) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); lastFrame = frame; frame->GetNextSibling(frame); } @@ -1768,14 +1761,7 @@ nsBaseIBFrame::PullFrame(nsBlockReflowState& aState, // Change geometric parents if (aUpdateGeometricParent) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); // The frame is being pulled from a next-in-flow; therefore we // need to add it to our sibling list. @@ -2880,14 +2866,7 @@ nsBaseIBFrame::DrainOverflowLines() nsIFrame* lastFrame = nsnull; nsIFrame* frame = line->mFirstChild; while (nsnull != frame) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); lastFrame = frame; frame->GetNextSibling(frame); } @@ -3263,7 +3242,7 @@ nsBaseIBFrame::DoRemoveFrame(nsBlockReflowState& aState, while ((nsnull != line) && (nsnull != aDeletedFrame)) { #ifdef NS_DEBUG nsIFrame* parent; - aDeletedFrame->GetGeometricParent(parent); + aDeletedFrame->GetParent(parent); NS_ASSERTION(flow == parent, "messed up delete code"); #endif NS_FRAME_TRACE(NS_FRAME_TRACE_CHILD_REFLOW, @@ -3346,9 +3325,9 @@ nsBaseIBFrame::DoRemoveFrame(nsBlockReflowState& aState, // continuation is in a different parent. So break out of // the loop so that we advance to the next parent. #ifdef NS_DEBUG - nsIFrame* contParent; - aDeletedFrame->GetContentParent(contParent); - NS_ASSERTION(contParent != flow, "strange continuation"); + nsIFrame* parent; + aDeletedFrame->GetParent(parent); + NS_ASSERTION(parent != flow, "strange continuation"); #endif break; } @@ -3481,7 +3460,7 @@ nsBaseIBFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, aChild->GetNextInFlow(nextInFlow); NS_PRECONDITION(nsnull != nextInFlow, "null next-in-flow"); - nextInFlow->GetGeometricParent((nsIFrame*&)parent); + nextInFlow->GetParent((nsIFrame*&)parent); // If the next-in-flow has a next-in-flow then delete it, too (and // delete it first). @@ -3642,7 +3621,7 @@ nsBlockReflowState::InitFloater(nsPlaceholderFrame* aPlaceholder) { // Set the geometric parent of the floater nsIFrame* floater = aPlaceholder->GetAnchoredItem(); - floater->SetGeometricParent(mBlock); + floater->SetParent(mBlock); // Then add the floater to the current line and place it when // appropriate @@ -3732,7 +3711,7 @@ nsBlockReflowState::IsLeftMostChild(nsIFrame* aFrame) { for (;;) { nsIFrame* parent; - aFrame->GetGeometricParent(parent); + aFrame->GetParent(parent); if (parent == mBlock) { nsIFrame* child = mCurrentLine->mFirstChild; PRInt32 n = mCurrentLine->ChildCount(); @@ -4104,7 +4083,7 @@ PRBool nsBaseIBFrame::IsChild(nsIFrame* aFrame) { nsIFrame* parent; - aFrame->GetGeometricParent(parent); + aFrame->GetParent(parent); if (parent != (nsIFrame*)this) { return PR_FALSE; } @@ -4290,7 +4269,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext, NS_RELEASE(kidSC); return NS_ERROR_OUT_OF_MEMORY; } - mBullet->Init(aPresContext, mContent, this, this, kidSC); + mBullet->Init(aPresContext, mContent, this, kidSC); NS_RELEASE(kidSC); // If the list bullet frame should be positioned inside then add @@ -4453,7 +4432,7 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->SetFlags(mFlags); cf->AppendToFlow(this); aContinuingFrame = cf; @@ -4805,14 +4784,7 @@ nsBlockFrame::TakeRunInFrames(nsBlockFrame* aRunInFrame) nsIFrame* lastFrame = nsnull; nsIFrame* frame = line->mFirstChild; while (nsnull != frame) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); lastFrame = frame; frame->GetNextSibling(frame); } diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.h b/mozilla/layout/html/base/src/nsBlockReflowState.h index 13788aebf41..64dab7bba15 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.h +++ b/mozilla/layout/html/base/src/nsBlockReflowState.h @@ -1383,14 +1383,7 @@ nsBaseIBFrame::ReflowDirtyLines(nsBlockReflowState& aState) nsIFrame* lastFrame = nsnull; PRInt32 n = line->ChildCount(); while (--n >= 0) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); lastFrame = frame; frame->GetNextSibling(frame); } @@ -1768,14 +1761,7 @@ nsBaseIBFrame::PullFrame(nsBlockReflowState& aState, // Change geometric parents if (aUpdateGeometricParent) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); // The frame is being pulled from a next-in-flow; therefore we // need to add it to our sibling list. @@ -2880,14 +2866,7 @@ nsBaseIBFrame::DrainOverflowLines() nsIFrame* lastFrame = nsnull; nsIFrame* frame = line->mFirstChild; while (nsnull != frame) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); lastFrame = frame; frame->GetNextSibling(frame); } @@ -3263,7 +3242,7 @@ nsBaseIBFrame::DoRemoveFrame(nsBlockReflowState& aState, while ((nsnull != line) && (nsnull != aDeletedFrame)) { #ifdef NS_DEBUG nsIFrame* parent; - aDeletedFrame->GetGeometricParent(parent); + aDeletedFrame->GetParent(parent); NS_ASSERTION(flow == parent, "messed up delete code"); #endif NS_FRAME_TRACE(NS_FRAME_TRACE_CHILD_REFLOW, @@ -3346,9 +3325,9 @@ nsBaseIBFrame::DoRemoveFrame(nsBlockReflowState& aState, // continuation is in a different parent. So break out of // the loop so that we advance to the next parent. #ifdef NS_DEBUG - nsIFrame* contParent; - aDeletedFrame->GetContentParent(contParent); - NS_ASSERTION(contParent != flow, "strange continuation"); + nsIFrame* parent; + aDeletedFrame->GetParent(parent); + NS_ASSERTION(parent != flow, "strange continuation"); #endif break; } @@ -3481,7 +3460,7 @@ nsBaseIBFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, aChild->GetNextInFlow(nextInFlow); NS_PRECONDITION(nsnull != nextInFlow, "null next-in-flow"); - nextInFlow->GetGeometricParent((nsIFrame*&)parent); + nextInFlow->GetParent((nsIFrame*&)parent); // If the next-in-flow has a next-in-flow then delete it, too (and // delete it first). @@ -3642,7 +3621,7 @@ nsBlockReflowState::InitFloater(nsPlaceholderFrame* aPlaceholder) { // Set the geometric parent of the floater nsIFrame* floater = aPlaceholder->GetAnchoredItem(); - floater->SetGeometricParent(mBlock); + floater->SetParent(mBlock); // Then add the floater to the current line and place it when // appropriate @@ -3732,7 +3711,7 @@ nsBlockReflowState::IsLeftMostChild(nsIFrame* aFrame) { for (;;) { nsIFrame* parent; - aFrame->GetGeometricParent(parent); + aFrame->GetParent(parent); if (parent == mBlock) { nsIFrame* child = mCurrentLine->mFirstChild; PRInt32 n = mCurrentLine->ChildCount(); @@ -4104,7 +4083,7 @@ PRBool nsBaseIBFrame::IsChild(nsIFrame* aFrame) { nsIFrame* parent; - aFrame->GetGeometricParent(parent); + aFrame->GetParent(parent); if (parent != (nsIFrame*)this) { return PR_FALSE; } @@ -4290,7 +4269,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext, NS_RELEASE(kidSC); return NS_ERROR_OUT_OF_MEMORY; } - mBullet->Init(aPresContext, mContent, this, this, kidSC); + mBullet->Init(aPresContext, mContent, this, kidSC); NS_RELEASE(kidSC); // If the list bullet frame should be positioned inside then add @@ -4453,7 +4432,7 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->SetFlags(mFlags); cf->AppendToFlow(this); aContinuingFrame = cf; @@ -4805,14 +4784,7 @@ nsBlockFrame::TakeRunInFrames(nsBlockFrame* aRunInFrame) nsIFrame* lastFrame = nsnull; nsIFrame* frame = line->mFirstChild; while (nsnull != frame) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - frame->GetGeometricParent(geometricParent); - frame->GetContentParent(contentParent); - if (contentParent == geometricParent) { - frame->SetContentParent(this); - } - frame->SetGeometricParent(this); + frame->SetParent(this); lastFrame = frame; frame->GetNextSibling(frame); } diff --git a/mozilla/layout/html/base/src/nsBulletFrame.cpp b/mozilla/layout/html/base/src/nsBulletFrame.cpp index 0e6076c804a..51d37ffa483 100644 --- a/mozilla/layout/html/base/src/nsBulletFrame.cpp +++ b/mozilla/layout/html/base/src/nsBulletFrame.cpp @@ -167,7 +167,7 @@ nsBulletFrame::SetListItemOrdinal(PRInt32 aNextOrdinal) // because our parent is the list-item. nsHTMLValue value; nsIContent* parentContent; - mContentParent->GetContent(parentContent); + mParent->GetContent(parentContent); nsIHTMLContent* hc; if (NS_OK == parentContent->QueryInterface(kIHTMLContentIID, (void**) &hc)) { if (NS_CONTENT_ATTR_HAS_VALUE == diff --git a/mozilla/layout/html/base/src/nsContainerFrame.cpp b/mozilla/layout/html/base/src/nsContainerFrame.cpp index 622274b7f8e..46eea193ec6 100644 --- a/mozilla/layout/html/base/src/nsContainerFrame.cpp +++ b/mozilla/layout/html/base/src/nsContainerFrame.cpp @@ -405,7 +405,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, // the right parent to do the removal (it's possible that the // parent is not this because we are executing pullup code) nsIFrame* parent; - aKidFrame->GetGeometricParent(parent); + aKidFrame->GetParent(parent); ((nsContainerFrame*)parent)->DeleteChildsNextInFlow(aPresContext, aKidFrame); } } @@ -433,7 +433,7 @@ nsContainerFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, nsIFrame* aChild->GetNextInFlow(nextInFlow); NS_PRECONDITION(nsnull != nextInFlow, "null next-in-flow"); - nextInFlow->GetGeometricParent((nsIFrame*&)parent); + nextInFlow->GetParent((nsIFrame*&)parent); // If the next-in-flow has a next-in-flow then delete it, too (and // delete it first). @@ -455,7 +455,7 @@ nsContainerFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, nsIFrame* nsIFrame* top = nextInFlow; for (;;) { nsIFrame* parent; - top->GetGeometricParent(parent); + top->GetParent(parent); if (nsnull == parent) { break; } @@ -549,14 +549,7 @@ void nsContainerFrame::PushChildren(nsIFrame* aFromChild, nsIFrame* aPrevSibling printf("\n"); #endif lastChild = f; - f->SetGeometricParent(nextInFlow); - - nsIFrame* contentParent; - - f->GetContentParent(contentParent); - if (this == contentParent) { - f->SetContentParent(nextInFlow); - } + f->SetParent(nextInFlow); } NS_ASSERTION(numChildren > 0, "no children to push"); @@ -637,15 +630,7 @@ void nsContainerFrame::AppendChildren(nsIFrame* aChild, PRBool aSetParent) // Reset the geometric parent if requested if (aSetParent) { - nsIFrame* geometricParent; - nsIFrame* contentParent; - - f->GetGeometricParent(geometricParent); - f->GetContentParent(contentParent); - if (contentParent == geometricParent) { - f->SetContentParent(this); - } - f->SetGeometricParent(this); + f->SetParent(this); } } } @@ -772,7 +757,7 @@ PRBool nsContainerFrame::IsChild(const nsIFrame* aChild) const // Check the geometric parent nsIFrame* parent; - aChild->GetGeometricParent(parent); + aChild->GetParent(parent); if (parent != (nsIFrame*)this) { return PR_FALSE; } diff --git a/mozilla/layout/html/base/src/nsFrame.cpp b/mozilla/layout/html/base/src/nsFrame.cpp index efbb40eceb3..4bfe8908c74 100644 --- a/mozilla/layout/html/base/src/nsFrame.cpp +++ b/mozilla/layout/html/base/src/nsFrame.cpp @@ -272,14 +272,12 @@ nsrefcnt nsFrame::Release(void) NS_IMETHODIMP nsFrame::Init(nsIPresContext& aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aContext) { mContent = aContent; NS_IF_ADDREF(mContent); - mGeometricParent = aGeometricParent; - mContentParent = aContentParent; + mParent = aParent; return SetStyleContext(&aPresContext, aContext); } @@ -418,29 +416,17 @@ NS_IMETHODIMP nsFrame::ReResolveStyleContext(nsIPresContext* aPresContext, return NS_OK; } -// Geometric and content parent member functions +// Geometric parent member functions -NS_IMETHODIMP nsFrame::GetContentParent(nsIFrame*& aParent) const +NS_IMETHODIMP nsFrame::GetParent(nsIFrame*& aParent) const { - aParent = mContentParent; + aParent = mParent; return NS_OK; } -NS_IMETHODIMP nsFrame::SetContentParent(const nsIFrame* aParent) +NS_IMETHODIMP nsFrame::SetParent(const nsIFrame* aParent) { - mContentParent = (nsIFrame*)aParent; - return NS_OK; -} - -NS_IMETHODIMP nsFrame::GetGeometricParent(nsIFrame*& aParent) const -{ - aParent = mGeometricParent; - return NS_OK; -} - -NS_IMETHODIMP nsFrame::SetGeometricParent(const nsIFrame* aParent) -{ - mGeometricParent = (nsIFrame*)aParent; + mParent = (nsIFrame*)aParent; return NS_OK; } @@ -1169,8 +1155,8 @@ nsFrame::GetCursor(nsIPresContext& aPresContext, GetStyleData(eStyleStruct_Color, (const nsStyleStruct*&)styleColor); aCursor = styleColor->mCursor; - if ((NS_STYLE_CURSOR_AUTO == aCursor) && (nsnull != mContentParent)) { - mContentParent->GetCursor(aPresContext, aPoint, aCursor); + if ((NS_STYLE_CURSOR_AUTO == aCursor) && (nsnull != mParent)) { + mParent->GetCursor(aPresContext, aPoint, aCursor); } return NS_OK; @@ -1398,7 +1384,7 @@ NS_IMETHODIMP nsFrame::SetView(nsIView* aView) // Find the first geometric parent that has a view NS_IMETHODIMP nsFrame::GetParentWithView(nsIFrame*& aParent) const { - aParent = mGeometricParent; + aParent = mParent; while (nsnull != aParent) { nsIView* parView; @@ -1407,7 +1393,7 @@ NS_IMETHODIMP nsFrame::GetParentWithView(nsIFrame*& aParent) const if (nsnull != parView) { break; } - aParent->GetGeometricParent(aParent); + aParent->GetParent(aParent); } return NS_OK; @@ -1426,7 +1412,7 @@ NS_IMETHODIMP nsFrame::GetOffsetFromView(nsPoint& aOffset, nsIView*& aView) cons frame->GetOrigin(origin); aOffset += origin; - frame->GetGeometricParent(frame); + frame->GetParent(frame); if (nsnull != frame) { frame->GetView(aView); } @@ -1678,14 +1664,9 @@ nsFrame::DumpBaseRegressionData(FILE* out, PRInt32 aIndent) IndentBy(out, aIndent); fprintf(out, "\n", this); - if (mContentParent != mGeometricParent) { + if (nsnull != mParent) { IndentBy(out, aIndent); - fprintf(out, "\n", mContentParent); - } - - if (nsnull != mGeometricParent) { - IndentBy(out, aIndent); - fprintf(out, "\n", mGeometricParent); + fprintf(out, "\n", mParent); } if (nsnull != mNextSibling) { diff --git a/mozilla/layout/html/base/src/nsFrame.h b/mozilla/layout/html/base/src/nsFrame.h index 3705640c65a..a958dfa6418 100644 --- a/mozilla/layout/html/base/src/nsFrame.h +++ b/mozilla/layout/html/base/src/nsFrame.h @@ -113,8 +113,7 @@ public: // nsIFrame NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aContext); NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext, nsIAtom* aListName, @@ -129,10 +128,8 @@ public: const nsStyleStruct*& aStyleStruct) const; NS_IMETHOD ReResolveStyleContext(nsIPresContext* aPresContext, nsIStyleContext* aParentContext); - NS_IMETHOD GetContentParent(nsIFrame*& aParent) const; - NS_IMETHOD SetContentParent(const nsIFrame* aParent); - NS_IMETHOD GetGeometricParent(nsIFrame*& aParent) const; - NS_IMETHOD SetGeometricParent(const nsIFrame* aParent); + NS_IMETHOD GetParent(nsIFrame*& aParent) const; + NS_IMETHOD SetParent(const nsIFrame* aParent); NS_IMETHOD GetRect(nsRect& aRect) const; NS_IMETHOD GetOrigin(nsPoint& aPoint) const; NS_IMETHOD GetSize(nsSize& aSize) const; @@ -345,8 +342,7 @@ protected: nsRect mRect; nsIContent* mContent; nsIStyleContext* mStyleContext; - nsIFrame* mContentParent; - nsIFrame* mGeometricParent; + nsIFrame* mParent; nsIFrame* mNextSibling; // singly linked list of frames nsFrameState mState; PRBool mSelected; diff --git a/mozilla/layout/html/base/src/nsHRFrame.cpp b/mozilla/layout/html/base/src/nsHRFrame.cpp index 2ddef50a286..50fae44cfe4 100644 --- a/mozilla/layout/html/base/src/nsHRFrame.cpp +++ b/mozilla/layout/html/base/src/nsHRFrame.cpp @@ -158,21 +158,24 @@ HRuleFrame::Paint(nsIPresContext& aPresContext, { // Get correct color by finding the first parent that actually // specifies a color. - nsIFrame* frame = this; - while (nsnull != frame) { + nsIStyleContext* styleContext = mStyleContext; + NS_ADDREF(styleContext); + while (nsnull != styleContext) { const nsStyleColor* color; - nsresult rv = frame->GetStyleData(eStyleStruct_Color, - (const nsStyleStruct*&) color); - if (NS_SUCCEEDED(rv) && (nsnull != color)) { + color = (const nsStyleColor*)styleContext->GetStyleData(eStyleStruct_Color); + + if (nsnull != color) { if (0 == (NS_STYLE_BG_COLOR_TRANSPARENT & color->mBackgroundFlags)) { NS_Get3DColors(colors, color->mBackgroundColor); break; } } - // Try next parent (use content parent so that style is - // inherited properly!) - frame->GetContentParent(frame); + // Try parent style context + nsIStyleContext* lastStyleContext = styleContext; + styleContext = styleContext->GetParent(); + NS_RELEASE(lastStyleContext); } + NS_IF_RELEASE(styleContext); } // Draw a "shadowed" box around the rule area diff --git a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp b/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp index f232fda4ac3..49c872208ed 100644 --- a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp +++ b/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp @@ -93,7 +93,7 @@ nsHTMLContainerFrame::CreatePlaceholderFrame(nsIPresContext& aPresContext, aPresContext.ResolvePseudoStyleContextFor(content, nsHTMLAtoms::placeholderPseudo, kidSC); NS_RELEASE(kidSC); - placeholder->Init(aPresContext, content, this, this, placeholderPseudoStyle); + placeholder->Init(aPresContext, content, this, placeholderPseudoStyle); NS_RELEASE(placeholderPseudoStyle); NS_IF_RELEASE(content); diff --git a/mozilla/layout/html/base/src/nsHTMLImage.h b/mozilla/layout/html/base/src/nsHTMLImage.h index d80672039b6..8131ee9933f 100644 --- a/mozilla/layout/html/base/src/nsHTMLImage.h +++ b/mozilla/layout/html/base/src/nsHTMLImage.h @@ -104,8 +104,7 @@ public: NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext); NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aContext); NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler) const; NS_IMETHOD Paint(nsIPresContext& aPresContext, diff --git a/mozilla/layout/html/base/src/nsHTMLReflowCommand.cpp b/mozilla/layout/html/base/src/nsHTMLReflowCommand.cpp index 8c99e4559b7..647a777e268 100644 --- a/mozilla/layout/html/base/src/nsHTMLReflowCommand.cpp +++ b/mozilla/layout/html/base/src/nsHTMLReflowCommand.cpp @@ -102,7 +102,7 @@ NS_IMPL_ISUPPORTS(nsHTMLReflowCommand, kIReflowCommandIID); nsIFrame* nsHTMLReflowCommand::GetContainingBlock(nsIFrame* aFloater) { nsIFrame* containingBlock; - aFloater->GetGeometricParent(containingBlock); + aFloater->GetParent(containingBlock); return containingBlock; } @@ -117,14 +117,12 @@ void nsHTMLReflowCommand::BuildPath() if (NS_STYLE_FLOAT_NONE != display->mFloats) { mPath.AppendElement((void*)mTargetFrame); - for (nsIFrame* f = GetContainingBlock(mTargetFrame); - nsnull != f; - f->GetGeometricParent(f)) { + for (nsIFrame* f = GetContainingBlock(mTargetFrame); nsnull != f; f->GetParent(f)) { mPath.AppendElement((void*)f); } } else { - for (nsIFrame* f = mTargetFrame; nsnull != f; f->GetGeometricParent(f)) { + for (nsIFrame* f = mTargetFrame; nsnull != f; f->GetParent(f)) { mPath.AppendElement((void*)f); } } diff --git a/mozilla/layout/html/base/src/nsHTMLReflowState.cpp b/mozilla/layout/html/base/src/nsHTMLReflowState.cpp index bd884b5e225..36e225cc321 100644 --- a/mozilla/layout/html/base/src/nsHTMLReflowState.cpp +++ b/mozilla/layout/html/base/src/nsHTMLReflowState.cpp @@ -244,13 +244,13 @@ nsHTMLReflowState::InitAbsoluteConstraints(nsIPresContext& aPresContext, placeholderFrame->GetOrigin(placeholderOffset); nsIFrame* parent; - placeholderFrame->GetGeometricParent(parent); + placeholderFrame->GetParent(parent); while ((nsnull != parent) && (parent != cbrs->frame)) { nsPoint origin; parent->GetOrigin(origin); placeholderOffset += origin; - parent->GetGeometricParent(parent); + parent->GetParent(parent); } } } diff --git a/mozilla/layout/html/base/src/nsImageFrame.cpp b/mozilla/layout/html/base/src/nsImageFrame.cpp index 2fe7f4629f9..9d637056953 100644 --- a/mozilla/layout/html/base/src/nsImageFrame.cpp +++ b/mozilla/layout/html/base/src/nsImageFrame.cpp @@ -345,12 +345,10 @@ nsImageFrame::DeleteFrame(nsIPresContext& aPresContext) NS_IMETHODIMP nsImageFrame::Init(nsIPresContext& aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aContext) { - nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aGeometricParent, - aContentParent, aContext); + nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aParent, aContext); // Set the image loader's source URL and base URL nsAutoString src, base; diff --git a/mozilla/layout/html/base/src/nsInlineFrame.cpp b/mozilla/layout/html/base/src/nsInlineFrame.cpp index f1a6d484845..4a363be284d 100644 --- a/mozilla/layout/html/base/src/nsInlineFrame.cpp +++ b/mozilla/layout/html/base/src/nsInlineFrame.cpp @@ -276,7 +276,7 @@ nsInlineFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->SetFlags(mFlags); cf->AppendToFlow(this); aContinuingFrame = cf; diff --git a/mozilla/layout/html/base/src/nsInlineReflow.cpp b/mozilla/layout/html/base/src/nsInlineReflow.cpp index b8cf1b050fc..bbca030ac91 100644 --- a/mozilla/layout/html/base/src/nsInlineReflow.cpp +++ b/mozilla/layout/html/base/src/nsInlineReflow.cpp @@ -480,7 +480,7 @@ nsInlineReflow::ReflowFrame(PRBool aIsAdjacentWithTop, // the right parent to do the removal (it's possible that the // parent is not this because we are executing pullup code) nsHTMLContainerFrame* parent; - frame->GetGeometricParent((nsIFrame*&) parent); + frame->GetParent((nsIFrame*&) parent); parent->DeleteChildsNextInFlow(mPresContext, frame); } } diff --git a/mozilla/layout/html/base/src/nsPageFrame.cpp b/mozilla/layout/html/base/src/nsPageFrame.cpp index e8b23b90181..68da48b3a64 100644 --- a/mozilla/layout/html/base/src/nsPageFrame.cpp +++ b/mozilla/layout/html/base/src/nsPageFrame.cpp @@ -133,7 +133,7 @@ nsPageFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->AppendToFlow(this); aContinuingFrame = cf; return NS_OK; diff --git a/mozilla/layout/html/base/src/nsScrollFrame.cpp b/mozilla/layout/html/base/src/nsScrollFrame.cpp index e8af94d4121..0f2c9a6a2ed 100644 --- a/mozilla/layout/html/base/src/nsScrollFrame.cpp +++ b/mozilla/layout/html/base/src/nsScrollFrame.cpp @@ -48,8 +48,7 @@ class nsScrollFrame : public nsHTMLContainerFrame { public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aContext); NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext, @@ -81,13 +80,11 @@ private: NS_IMETHODIMP nsScrollFrame::Init(nsIPresContext& aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aStyleContext) { nsresult rv = nsHTMLContainerFrame::Init(aPresContext, aContent, - aGeometricParent, aContentParent, - aStyleContext); + aParent, aStyleContext); // Create the scrolling view CreateScrollingView(); diff --git a/mozilla/layout/html/base/src/nsTextFrame.cpp b/mozilla/layout/html/base/src/nsTextFrame.cpp index dde903c1acd..0b64c5ba5d0 100644 --- a/mozilla/layout/html/base/src/nsTextFrame.cpp +++ b/mozilla/layout/html/base/src/nsTextFrame.cpp @@ -453,8 +453,8 @@ TextFrame::GetCursor(nsIPresContext& aPresContext, GetStyleData(eStyleStruct_Color, (const nsStyleStruct*&)styleColor); aCursor = styleColor->mCursor; - if (NS_STYLE_CURSOR_AUTO == aCursor && nsnull != mGeometricParent) { - mGeometricParent->GetCursor(aPresContext, aPoint, aCursor); + if (NS_STYLE_CURSOR_AUTO == aCursor && nsnull != mParent) { + mParent->GetCursor(aPresContext, aPoint, aCursor); if (NS_STYLE_CURSOR_AUTO == aCursor) { aCursor = NS_STYLE_CURSOR_TEXT; } @@ -472,7 +472,7 @@ TextFrame::CreateContinuingFrame(nsIPresContext& aCX, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aCX, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aCX, mContent, aParent, aStyleContext); cf->AppendToFlow(this); aContinuingFrame = cf; return NS_OK; diff --git a/mozilla/layout/html/document/src/nsFrameFrame.cpp b/mozilla/layout/html/document/src/nsFrameFrame.cpp index dea766c777c..4fb2fab9bb6 100644 --- a/mozilla/layout/html/document/src/nsFrameFrame.cpp +++ b/mozilla/layout/html/document/src/nsFrameFrame.cpp @@ -319,7 +319,7 @@ nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext, if (nsnull == mFirstChild) { mFirstChild = new nsHTMLFrameInnerFrame; // XXX temporary! use style system to get correct style! - mFirstChild->Init(aPresContext, mContent, this, this, mStyleContext); + mFirstChild->Init(aPresContext, mContent, this, mStyleContext); } // nsContainerFrame::PaintBorder has some problems, kludge it here @@ -597,7 +597,7 @@ NS_IMETHODIMP nsHTMLFrameInnerFrame::GetParentContent(nsIContent*& aContent) { nsHTMLFrameOuterFrame* parent; - GetGeometricParent((nsIFrame*&)parent); + GetParent((nsIFrame*&)parent); return parent->GetContent((nsIContent*&)aContent); } diff --git a/mozilla/layout/html/document/src/nsFrameSetFrame.cpp b/mozilla/layout/html/document/src/nsFrameSetFrame.cpp index ab8e53631dc..2231798136c 100644 --- a/mozilla/layout/html/document/src/nsFrameSetFrame.cpp +++ b/mozilla/layout/html/document/src/nsFrameSetFrame.cpp @@ -381,7 +381,7 @@ nsHTMLFramesetFrame* nsHTMLFramesetFrame::GetFramesetParent(nsIFrame* aChild) nsIAtom* tag; contentParent2->GetTag(tag); if (nsHTMLAtoms::frameset == tag) { - aChild->GetGeometricParent((nsIFrame*&)parent); + aChild->GetParent((nsIFrame*&)parent); } NS_IF_RELEASE(tag); NS_RELEASE(contentParent2); @@ -936,7 +936,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, if (nsHTMLAtoms::frameset == tag) { result = NS_NewHTMLFramesetFrame(frame); - frame->Init(aPresContext, child, this, this, kidSC); + frame->Init(aPresContext, child, this, kidSC); childTypes[mChildCount] = FRAMESET; nsHTMLFramesetFrame* childFrame = (nsHTMLFramesetFrame*)frame; @@ -946,7 +946,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, childBorderColors[mChildCount].Set(childFrame->GetBorderColor()); } else { // frame result = NS_NewHTMLFrameOuterFrame(frame); - frame->Init(aPresContext, child, this, this, kidSC); + frame->Init(aPresContext, child, this, kidSC); childTypes[mChildCount] = FRAME; // @@ -979,7 +979,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, nsHTMLFramesetBlankFrame* blankFrame = new nsHTMLFramesetBlankFrame; nsIStyleContext* pseudoStyleContext = aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::framesetBlankPseudo, mStyleContext); - blankFrame->Init(aPresContext, mContent, this, this, pseudoStyleContext); + blankFrame->Init(aPresContext, mContent, this, pseudoStyleContext); NS_RELEASE(pseudoStyleContext); if (nsnull == lastChild) { @@ -1017,7 +1017,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, borderFrame = new nsHTMLFramesetBorderFrame(borderWidth, PR_FALSE, PR_FALSE); nsIStyleContext* pseudoStyleContext = aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::horizontalFramesetBorderPseudo, mStyleContext); - borderFrame->Init(aPresContext, mContent, this, this, pseudoStyleContext); + borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext); NS_RELEASE(pseudoStyleContext); mChildCount++; @@ -1042,7 +1042,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext, borderFrame = new nsHTMLFramesetBorderFrame(borderWidth, PR_TRUE, PR_FALSE); nsIStyleContext* pseudoStyleContext = aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::verticalFramesetBorderPseudo, mStyleContext); - borderFrame->Init(aPresContext, mContent, this, this, pseudoStyleContext); + borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext); NS_RELEASE(pseudoStyleContext); mChildCount++; @@ -1590,7 +1590,7 @@ nsHTMLFramesetBorderFrame::HandleEvent(nsIPresContext& aPresContext, switch (aEvent->message) { case NS_MOUSE_LEFT_BUTTON_DOWN: nsHTMLFramesetFrame* parentFrame = nsnull; - GetGeometricParent((nsIFrame*&)parentFrame); + GetParent((nsIFrame*&)parentFrame); parentFrame->StartMouseDrag(aPresContext, this, aEvent); aEventStatus = nsEventStatus_eConsumeNoDefault; break; diff --git a/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp b/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp index 3d9d26b4d97..f38d3f84793 100644 --- a/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp @@ -131,7 +131,7 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext, nsIStyleContext* styleContext = aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::fieldsetContentPseudo, mStyleContext); - mFirstChild->Init(aPresContext, mContent, this, this, styleContext); + mFirstChild->Init(aPresContext, mContent, this, styleContext); NS_RELEASE(styleContext); nsIFrame* newChildList = aChildList; @@ -151,15 +151,13 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext, } else { newChildList = nextFrame; } - frame->SetGeometricParent(this); - frame->SetContentParent(this); + frame->SetParent(this); mFirstChild->SetNextSibling(frame); mLegendFrame = frame; mLegendFrame->SetNextSibling(nsnull); frame = nextFrame; } else { - frame->SetGeometricParent(mFirstChild); - frame->SetContentParent(mFirstChild); + frame->SetParent(mFirstChild); frame->GetNextSibling(frame); } lastFrame = frame; diff --git a/mozilla/layout/html/forms/src/nsFileControlFrame.cpp b/mozilla/layout/html/forms/src/nsFileControlFrame.cpp index 6926c1ab383..3480dbb6b15 100644 --- a/mozilla/layout/html/forms/src/nsFileControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFileControlFrame.cpp @@ -197,7 +197,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext, text->SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::disabled, nsAutoString("1"), PR_FALSE); // XXX this should use an "empty" bool value } NS_NewTextControlFrame(childFrame); - childFrame->Init(aPresContext, text, this, this, mStyleContext); + childFrame->Init(aPresContext, text, this, mStyleContext); mTextFrame = (nsTextControlFrame*)childFrame; mFirstChild = childFrame; @@ -211,7 +211,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext, NS_NewButtonControlFrame(childFrame); ((nsButtonControlFrame*)childFrame)->SetFileControlFrame(this); mBrowseFrame = (nsButtonControlFrame*)childFrame; - childFrame->Init(aPresContext, browse, this, this, mStyleContext); + childFrame->Init(aPresContext, browse, this, mStyleContext); mFirstChild->SetNextSibling(childFrame); diff --git a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp index 9b764e3c4cc..8dccecdeb53 100644 --- a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp @@ -512,13 +512,12 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext& aPresContext, // Resolve style and initialize the frame nsIStyleContext* styleContext = aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::buttonContentPseudo, mStyleContext); - mFirstChild->Init(aPresContext, mContent, this, this, styleContext); + mFirstChild->Init(aPresContext, mContent, this, styleContext); NS_RELEASE(styleContext); - // Set the geometric and content parent for each of the child frames + // Set the parent for each of the child frames for (nsIFrame* frame = aChildList; nsnull != frame; frame->GetNextSibling(frame)) { - frame->SetGeometricParent(mFirstChild); - frame->SetContentParent(mFirstChild); + frame->SetParent(mFirstChild); } // Queue up the frames for the inline frame diff --git a/mozilla/layout/html/forms/src/nsLabelFrame.cpp b/mozilla/layout/html/forms/src/nsLabelFrame.cpp index 501005af419..9b3e0598d37 100644 --- a/mozilla/layout/html/forms/src/nsLabelFrame.cpp +++ b/mozilla/layout/html/forms/src/nsLabelFrame.cpp @@ -361,13 +361,12 @@ nsLabelFrame::SetInitialChildList(nsIPresContext& aPresContext, // Resolve style and initialize the frame nsIStyleContext* styleContext = aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::labelContentPseudo, mStyleContext); - mFirstChild->Init(aPresContext, mContent, this, this, styleContext); + mFirstChild->Init(aPresContext, mContent, this, styleContext); NS_RELEASE(styleContext); // Set the geometric and content parent for each of the child frames for (nsIFrame* frame = aChildList; nsnull != frame; frame->GetNextSibling(frame)) { - frame->SetGeometricParent(mFirstChild); - frame->SetContentParent(mFirstChild); + frame->SetParent(mFirstChild); } // Queue up the frames for the body frame diff --git a/mozilla/layout/html/forms/src/nsLegendFrame.cpp b/mozilla/layout/html/forms/src/nsLegendFrame.cpp index ab99e596650..9d4c4b95af2 100644 --- a/mozilla/layout/html/forms/src/nsLegendFrame.cpp +++ b/mozilla/layout/html/forms/src/nsLegendFrame.cpp @@ -95,13 +95,12 @@ nsLegendFrame::SetInitialChildList(nsIPresContext& aPresContext, // Resolve style and initialize the frame nsIStyleContext* styleContext = aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::legendContentPseudo, mStyleContext); - mFirstChild->Init(aPresContext, mContent, this, this, styleContext); + mFirstChild->Init(aPresContext, mContent, this, styleContext); NS_RELEASE(styleContext); - // Set the geometric and content parent for each of the child frames + // Set the parent for each of the child frames for (nsIFrame* frame = aChildList; nsnull != frame; frame->GetNextSibling(frame)) { - frame->SetGeometricParent(mFirstChild); - frame->SetContentParent(mFirstChild); + frame->SetParent(mFirstChild); } // Queue up the frames for the inline frame diff --git a/mozilla/layout/html/style/src/nsHTMLStyleSheet.cpp b/mozilla/layout/html/style/src/nsHTMLStyleSheet.cpp index 1dcb5bea3cd..0e5d7719b4a 100644 --- a/mozilla/layout/html/style/src/nsHTMLStyleSheet.cpp +++ b/mozilla/layout/html/style/src/nsHTMLStyleSheet.cpp @@ -231,7 +231,7 @@ nsAbsoluteItems::AddAbsolutelyPositionedChild(nsIFrame* aChildFrame) { #ifdef NS_DEBUG nsIFrame* parent; - aChildFrame->GetGeometricParent(parent); + aChildFrame->GetParent(parent); NS_PRECONDITION(parent == containingBlock, "bad geometric parent"); #endif @@ -390,8 +390,7 @@ protected: nsresult ConstructTableFrame(nsIPresContext* aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aStyleContext, nsAbsoluteItems& aAboluteItems, nsIFrame*& aNewFrame); @@ -1097,8 +1096,7 @@ HTMLStyleSheetImpl::CreateInputFrame(nsIContent* aContent, nsIFrame*& aFrame) nsresult HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aStyleContext, nsAbsoluteItems& aAbsoluteItems, nsIFrame*& aNewFrame) @@ -1114,8 +1112,7 @@ HTMLStyleSheetImpl::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, aGeometricParent, aContentParent, - aStyleContext); + aNewFrame->Init(*aPresContext, aContent, aParent, aStyleContext); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewFrame, aStyleContext, PR_FALSE); @@ -1130,7 +1127,7 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, nsHTMLAtoms::tablePseudo, aStyleContext); */ - innerFrame->Init(*aPresContext, aContent, aNewFrame, aNewFrame, aStyleContext); + innerFrame->Init(*aPresContext, aContent, aNewFrame, aStyleContext); // this should be "innerTableStyleContext" but I haven't tested that thoroughly yet // Iterate the child content @@ -1158,8 +1155,7 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, // Have we already created a caption? If so, ignore this caption if (nsnull == captionFrame) { NS_NewAreaFrame(captionFrame, 0); - captionFrame->Init(*aPresContext, childContent, aNewFrame, - aNewFrame, childStyleContext); + captionFrame->Init(*aPresContext, childContent, aNewFrame, childStyleContext); // Process the caption's child content and set the initial child list nsIFrame* captionChildList; ProcessChildren(aPresContext, childContent, captionFrame, @@ -1175,8 +1171,7 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, case NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP: case NS_STYLE_DISPLAY_TABLE_ROW_GROUP: NS_NewTableRowGroupFrame(frame); - frame->Init(*aPresContext, childContent, innerFrame, innerFrame, - childStyleContext); + frame->Init(*aPresContext, childContent, innerFrame, childStyleContext); break; case NS_STYLE_DISPLAY_TABLE_ROW: @@ -1193,13 +1188,12 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, NS_NewTableRowGroupFrame(frame); NS_RELEASE(childStyleContext); // we can't use this resolved style, so get rid of it childStyleContext = rowGroupStyleContext; // the row group style context will get set to childStyleContext after the switch ends. - frame->Init(*aPresContext, childContent, innerFrame, - innerFrame, childStyleContext); + frame->Init(*aPresContext, childContent, innerFrame, childStyleContext); // need to resolve the style context for the column again to be sure it's a child of the colgroup style context rowStyleContext = aPresContext->ResolveStyleContextFor(childContent, rowGroupStyleContext); nsIFrame *rowFrame; NS_NewTableRowFrame(rowFrame); - rowFrame->Init(*aPresContext, childContent, frame, frame, rowStyleContext); + rowFrame->Init(*aPresContext, childContent, frame, rowStyleContext); rowFrame->SetInitialChildList(*aPresContext, nsnull, nsnull); grandChildList = rowFrame; break; @@ -1245,12 +1239,12 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, NS_NewTableColGroupFrame(frame); NS_RELEASE(childStyleContext); // we can't use this resolved style, so get rid of it childStyleContext = colGroupStyleContext; // the col group style context will get set to childStyleContext after the switch ends. - frame->Init(*aPresContext, childContent, innerFrame, innerFrame, childStyleContext); + frame->Init(*aPresContext, childContent, innerFrame, childStyleContext); // need to resolve the style context for the column again to be sure it's a child of the colgroup style context colStyleContext = aPresContext->ResolveStyleContextFor(childContent, colGroupStyleContext); nsIFrame *colFrame; NS_NewTableColFrame(colFrame); - colFrame->Init(*aPresContext, childContent, frame, frame, colStyleContext); + colFrame->Init(*aPresContext, childContent, frame, colStyleContext); colFrame->SetInitialChildList(*aPresContext, nsnull, nsnull); grandChildList = colFrame; break; @@ -1258,7 +1252,7 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, case NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP: NS_NewTableColGroupFrame(frame); - frame->Init(*aPresContext, childContent, innerFrame, innerFrame, childStyleContext); + frame->Init(*aPresContext, childContent, innerFrame, childStyleContext); break; default: @@ -1319,7 +1313,7 @@ HTMLStyleSheetImpl::ConstructTableCellFrame(nsIPresContext* aPresContext, rv = NS_NewTableCellFrame(aNewFrame); if (NS_SUCCEEDED(rv)) { // Initialize the table cell frame - aNewFrame->Init(*aPresContext, aContent, aParentFrame, aParentFrame, aStyleContext); + aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); // Create an area frame that will format the cell's content nsIFrame* cellBodyFrame; @@ -1334,7 +1328,7 @@ HTMLStyleSheetImpl::ConstructTableCellFrame(nsIPresContext* aPresContext, // Resolve pseudo style and initialize the body cell frame nsIStyleContext* bodyPseudoStyle = aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::cellContentPseudo, aStyleContext); - cellBodyFrame->Init(*aPresContext, aContent, aNewFrame, aNewFrame, bodyPseudoStyle); + cellBodyFrame->Init(*aPresContext, aContent, aNewFrame, bodyPseudoStyle); NS_RELEASE(bodyPseudoStyle); // Process children and set the body cell frame's initial child list @@ -1369,13 +1363,11 @@ HTMLStyleSheetImpl::ConstructDocElementFrame(nsIPresContext* aPresContext, // the root frame. // XXX We only need the scroll frame if it's print preview... NS_NewScrollFrame(scrollFrame); - scrollFrame->Init(*aPresContext, nsnull, aRootFrame, aRootFrame, - aRootStyleContext); + scrollFrame->Init(*aPresContext, nsnull, aRootFrame, aRootStyleContext); // The page sequence frame needs a view, because it's a scrolled frame NS_NewSimplePageSequenceFrame(pageSequenceFrame); - pageSequenceFrame->Init(*aPresContext, nsnull, scrollFrame, scrollFrame, - aRootStyleContext); + pageSequenceFrame->Init(*aPresContext, nsnull, scrollFrame, aRootStyleContext); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageSequenceFrame, aRootStyleContext, PR_TRUE); @@ -1386,8 +1378,7 @@ HTMLStyleSheetImpl::ConstructDocElementFrame(nsIPresContext* aPresContext, // Initialize the page and force it to have a view. This makes printing of // the pages easier and faster. // XXX Use a PAGE style context... - pageFrame->Init(*aPresContext, nsnull, pageSequenceFrame, pageSequenceFrame, - aRootStyleContext); + pageFrame->Init(*aPresContext, nsnull, pageSequenceFrame, aRootStyleContext); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageFrame, aRootStyleContext, PR_TRUE); @@ -1399,7 +1390,7 @@ HTMLStyleSheetImpl::ConstructDocElementFrame(nsIPresContext* aPresContext, nsIFrame* areaFrame; NS_NewAreaFrame(areaFrame, 0); - areaFrame->Init(*aPresContext, aDocElement, pageFrame, pageFrame, styleContext); + areaFrame->Init(*aPresContext, aDocElement, pageFrame, styleContext); NS_RELEASE(styleContext); // The area frame is the "initial containing block" @@ -1457,8 +1448,7 @@ HTMLStyleSheetImpl::ConstructDocElementFrame(nsIPresContext* aPresContext, if (NS_STYLE_OVERFLOW_HIDDEN != scrolling) { NS_NewScrollFrame(scrollFrame); - scrollFrame->Init(*aPresContext, aDocElement, aRootFrame, aRootFrame, - styleContext); + scrollFrame->Init(*aPresContext, aDocElement, aRootFrame, styleContext); // The scrolled frame gets a pseudo element style context nsIStyleContext* scrolledPseudoStyle = @@ -1477,8 +1467,7 @@ HTMLStyleSheetImpl::ConstructDocElementFrame(nsIPresContext* aPresContext, // flag that says that this is the body... NS_NewAreaFrame(areaFrame, NS_BLOCK_DOCUMENT_ROOT|NS_BLOCK_MARGIN_ROOT); nsIFrame* parentFrame = scrollFrame ? scrollFrame : aRootFrame; - areaFrame->Init(*aPresContext, aDocElement, parentFrame, parentFrame, - styleContext); + areaFrame->Init(*aPresContext, aDocElement, parentFrame, styleContext); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, areaFrame, styleContext, PR_FALSE); NS_RELEASE(styleContext); @@ -1536,7 +1525,7 @@ HTMLStyleSheetImpl::ConstructRootFrame(nsIPresContext* aPresContext, nsHTMLAtoms::rootPseudo, nsnull); // Initialize the root frame. It has a NULL content object - rootFrame->Init(*aPresContext, nsnull, nsnull, nsnull, rootPseudoStyle); + rootFrame->Init(*aPresContext, nsnull, nsnull, rootPseudoStyle); // Bind the root frame to the root view nsIPresShell* presShell = aPresContext->GetShell(); @@ -1580,7 +1569,7 @@ HTMLStyleSheetImpl::CreatePlaceholderFrameFor(nsIPresContext* aPresContext, aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::placeholderPseudo, aStyleContext); placeholderFrame->Init(*aPresContext, aContent, aParentFrame, - aParentFrame, placeholderPseudoStyle); + placeholderPseudoStyle); NS_RELEASE(placeholderPseudoStyle); // Add mapping from absolutely positioned frame to its placeholder frame @@ -1669,8 +1658,7 @@ HTMLStyleSheetImpl::ConstructFrameByTag(nsIPresContext* aPresContext, //rv = NS_NewObjectFrame(aContent, aParentFrame, aNewFrame); nsIFrame *blockFrame; NS_NewBlockFrame(blockFrame, 0); - blockFrame->Init(*aPresContext, aContent, aNewFrame, aNewFrame, - aStyleContext); + blockFrame->Init(*aPresContext, aContent, aNewFrame, aStyleContext); aNewFrame = blockFrame; processChildren = PR_TRUE; } @@ -1704,8 +1692,7 @@ HTMLStyleSheetImpl::ConstructFrameByTag(nsIPresContext* aPresContext, if (NS_SUCCEEDED(rv) && (nsnull != aNewFrame)) { nsIFrame* geometricParent = isAbsolutelyPositioned ? aAbsoluteItems.containingBlock : aParentFrame; - aNewFrame->Init(*aPresContext, aContent, geometricParent, aParentFrame, - aStyleContext); + aNewFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext); // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewFrame, @@ -1784,8 +1771,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte // Initialize it nsIFrame* geometricParent = isAbsolutelyPositioned ? aAbsoluteItems.containingBlock : aParentFrame; - scrollFrame->Init(*aPresContext, aContent, geometricParent, aParentFrame, - aStyleContext); + scrollFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext); // The scroll frame gets the original style context, and the scrolled // frame gets a SCROLLED-CONTENT pseudo element style context that @@ -1798,8 +1784,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte NS_NewAreaFrame(scrolledFrame, NS_BLOCK_SHRINK_WRAP); // Initialize the frame and force it to have a view - scrolledFrame->Init(*aPresContext, aContent, scrollFrame, scrollFrame, - scrolledPseudoStyle); + scrolledFrame->Init(*aPresContext, aContent, scrollFrame, scrolledPseudoStyle); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, scrolledFrame, scrolledPseudoStyle, PR_TRUE); NS_RELEASE(scrolledPseudoStyle); @@ -1842,7 +1827,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte // Create an area frame NS_NewAreaFrame(aNewFrame, 0); aNewFrame->Init(*aPresContext, aContent, aAbsoluteItems.containingBlock, - aParentFrame, aStyleContext); + aStyleContext); // Create a view nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewFrame, @@ -1871,8 +1856,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte NS_NewAreaFrame(aNewFrame, NS_BLOCK_SHRINK_WRAP); // Initialize the frame - aNewFrame->Init(*aPresContext, aContent, aParentFrame, aParentFrame, - aStyleContext); + aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); // See if we need to create a view nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewFrame, @@ -1908,8 +1892,8 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte isAbsolutelyPositioned = NS_STYLE_POSITION_ABSOLUTE == position->mPosition; nsIFrame* geometricParent = isAbsolutelyPositioned ? aAbsoluteItems.containingBlock : aParentFrame; - rv = ConstructTableFrame(aPresContext, aContent, geometricParent, aParentFrame, - aStyleContext, aAbsoluteItems, aNewFrame); + rv = ConstructTableFrame(aPresContext, aContent, geometricParent, aStyleContext, + aAbsoluteItems, aNewFrame); // Note: table construction function takes care of initializing the frame, // processing children, and setting the initial child list if (isAbsolutelyPositioned) { @@ -1993,8 +1977,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte // If we succeeded in creating a frame then initialize the frame and // process children if requested if (NS_SUCCEEDED(rv) && (nsnull != aNewFrame)) { - aNewFrame->Init(*aPresContext, aContent, aParentFrame, aParentFrame, - aStyleContext); + aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewFrame, @@ -2278,7 +2261,7 @@ HTMLStyleSheetImpl::GetAbsoluteContainingBlock(nsIPresContext* aPresContext, } // Continue walking up the hierarchy - containingBlock->GetGeometricParent(containingBlock); + containingBlock->GetParent(containingBlock); } // If we didn't find an absolutely positioned containing block, then use the @@ -2483,13 +2466,11 @@ HTMLStyleSheetImpl::ContentInserted(nsIPresContext* aPresContext, shell->GetPrimaryFrameFor(aContainer, parentFrame); } else { - // Use the prev sibling if we have it; otherwise use the next sibling. - // Note that we use the content parent, and not the geometric parent, - // in case the frame has been moved out of the flow... + // Use the prev sibling if we have it; otherwise use the next sibling if (nsnull != prevSibling) { - prevSibling->GetContentParent(parentFrame); + prevSibling->GetParent(parentFrame); } else { - nextSibling->GetContentParent(parentFrame); + nextSibling->GetParent(parentFrame); } } @@ -2581,7 +2562,7 @@ HTMLStyleSheetImpl::ContentRemoved(nsIPresContext* aPresContext, // Generate two reflow commands. First for the absolutely positioned // frame and then for its placeholder frame nsIFrame* parentFrame; - childFrame->GetGeometricParent(parentFrame); + childFrame->GetParent(parentFrame); // Notify the parent frame with a reflow command. nsIReflowCommand* reflowCmd; @@ -2599,7 +2580,7 @@ HTMLStyleSheetImpl::ContentRemoved(nsIPresContext* aPresContext, shell->GetPlaceholderFrameFor(childFrame, placeholderFrame); if (nsnull != placeholderFrame) { - placeholderFrame->GetGeometricParent(parentFrame); + placeholderFrame->GetParent(parentFrame); rv = NS_NewHTMLReflowCommand(&reflowCmd, parentFrame, nsIReflowCommand::FrameRemoved, placeholderFrame); @@ -2614,7 +2595,7 @@ HTMLStyleSheetImpl::ContentRemoved(nsIPresContext* aPresContext, // Note that we use the content parent, and not the geometric parent, // in case the frame has been moved out of the flow... nsIFrame* parentFrame; - childFrame->GetContentParent(parentFrame); + childFrame->GetParent(parentFrame); NS_ASSERTION(nsnull != parentFrame, "null content parent frame"); // Notify the parent frame with a reflow command. diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.cpp b/mozilla/layout/html/table/src/nsTableCellFrame.cpp index a30e255f889..d2cfebf2e2a 100644 --- a/mozilla/layout/html/table/src/nsTableCellFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableCellFrame.cpp @@ -564,7 +564,7 @@ nsTableCellFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->AppendToFlow(this); cf->InitCellFrame(GetColIndex()); aContinuingFrame = cf; diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.h b/mozilla/layout/html/table/src/nsTableCellFrame.h index f0ffd28e6dc..2e48b46c737 100644 --- a/mozilla/layout/html/table/src/nsTableCellFrame.h +++ b/mozilla/layout/html/table/src/nsTableCellFrame.h @@ -216,7 +216,7 @@ public: inline PRInt32 nsTableCellFrame::GetRowIndex() { nsTableRowFrame * row; - GetContentParent((nsIFrame *&)row); + GetParent((nsIFrame *&)row); if (nsnull!=row) return row->GetRowIndex(); else diff --git a/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp b/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp index f7f394cd2f7..badeeaa814f 100644 --- a/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp @@ -90,7 +90,7 @@ nsTableColGroupFrame::InitNewFrames(nsIPresContext& aPresContext, nsIFrame* aChi // Set its style context nsIStyleContextPtr colStyleContext = aPresContext.ResolveStyleContextFor(col, mStyleContext, PR_TRUE); - colFrame->Init(aPresContext, col, this, this, colStyleContext); + colFrame->Init(aPresContext, col, this, colStyleContext); colFrame->SetInitialChildList(aPresContext, nsnull, nsnull); // Set nsColFrame-specific information diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index 56e1a888d5c..4445e3077ea 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -284,8 +284,7 @@ nsTableFrame::nsTableFrame() NS_IMETHODIMP nsTableFrame::Init(nsIPresContext& aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aContext) { float p2t = aPresContext.GetPixelsToTwips(); @@ -293,8 +292,7 @@ nsTableFrame::Init(nsIPresContext& aPresContext, mDefaultCellSpacingY = NSIntPixelsToTwips(2, p2t); mDefaultCellPadding = NSIntPixelsToTwips(1, p2t); - return nsHTMLContainerFrame::Init(aPresContext, aContent, aGeometricParent, - aContentParent, aContext); + return nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext); } @@ -707,12 +705,12 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext) // first, need to get the nearest containing content object GetContent(lastColGroupElement); // ADDREF a: lastColGroupElement++ (either here or in the loop below) nsIFrame *parentFrame; - GetContentParent(parentFrame); + GetParent(parentFrame); while (nsnull==lastColGroupElement) { parentFrame->GetContent(lastColGroupElement); if (nsnull==lastColGroupElement) - parentFrame->GetContentParent(parentFrame); + parentFrame->GetParent(parentFrame); } // now we have a ref-counted "lastColGroupElement" content object nsIStyleContext* colGroupStyleContext = @@ -722,7 +720,7 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext) // Create a col group frame nsIFrame* newFrame; NS_NewTableColGroupFrame(newFrame); - newFrame->Init(aPresContext, lastColGroupElement, this, this, colGroupStyleContext); + newFrame->Init(aPresContext, lastColGroupElement, this, colGroupStyleContext); lastColGroupFrame = (nsTableColGroupFrame*)newFrame; NS_RELEASE(colGroupStyleContext); // kidStyleContenxt: REFCNT-- @@ -755,7 +753,7 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext) PR_TRUE); // colStyleContext: REFCNT++ NS_NewTableColFrame(colFrame); colFrame->Init(aPresContext, lastColGroupElement, lastColGroupFrame, - lastColGroupFrame, colStyleContext); + colStyleContext); NS_RELEASE(colStyleContext); colFrame->SetInitialChildList(aPresContext, nsnull, nsnull); @@ -969,7 +967,7 @@ void nsTableFrame::DumpCellMap () { nsTableCellFrame *cell = cd->mRealCell->mCell; nsTableRowFrame *row; - cell->GetGeometricParent((nsIFrame *&)row); + cell->GetParent((nsIFrame *&)row); int rr = row->GetRowIndex (); int cc = cell->GetColIndex (); printf("S%d,%d ", rr, cc); @@ -977,7 +975,7 @@ void nsTableFrame::DumpCellMap () { cell = cd->mOverlap->mCell; nsTableRowFrame* row2; - cell->GetGeometricParent((nsIFrame *&)row2); + cell->GetParent((nsIFrame *&)row2); rr = row2->GetRowIndex (); cc = cell->GetColIndex (); printf("O%d,%c ", rr, cc); @@ -1187,7 +1185,7 @@ void nsTableFrame::DidComputeHorizontalCollapsingBorders(nsIPresContext& aPresCo if (nsnull!=cellFrame) { nsIFrame *rowFrame; - cellFrame->GetContentParent(rowFrame); + cellFrame->GetParent(rowFrame); rowFrame->GetRect(rowRect); nsBorderEdge *leftBorder = (nsBorderEdge *)(mBorderEdges.mEdges[NS_SIDE_LEFT].ElementAt(0)); nsBorderEdge *rightBorder = (nsBorderEdge *)(mBorderEdges.mEdges[NS_SIDE_RIGHT].ElementAt(0)); @@ -1211,7 +1209,7 @@ void nsTableFrame::DidComputeHorizontalCollapsingBorders(nsIPresContext& aPresCo if (nsnull!=cellFrame) { nsIFrame *rowFrame; - cellFrame->GetContentParent(rowFrame); + cellFrame->GetParent(rowFrame); rowFrame->GetRect(rowRect); nsBorderEdge *leftBorder = (nsBorderEdge *)(mBorderEdges.mEdges[NS_SIDE_LEFT].ElementAt(lastRowIndex)); nsBorderEdge *rightBorder = (nsBorderEdge *)(mBorderEdges.mEdges[NS_SIDE_RIGHT].ElementAt(lastRowIndex)); @@ -1329,7 +1327,7 @@ void nsTableFrame::ComputeLeftBorderForEdgeAt(nsIPresContext& aPresContext, // 2. colgroup nsTableColFrame *colFrame = mCellMap->GetColumnFrame(aColIndex); nsIFrame *colGroupFrame; - colFrame->GetContentParent(colGroupFrame); + colFrame->GetParent(colGroupFrame); colGroupFrame->GetStyleData(eStyleStruct_Spacing, ((const nsStyleStruct *&)spacing)); styles.AppendElement((void*)spacing); // 3. col @@ -1347,10 +1345,10 @@ void nsTableFrame::ComputeLeftBorderForEdgeAt(nsIPresContext& aPresContext, if (nsnull!=cellFrame) { nsIFrame *rowFrame; - cellFrame->GetContentParent(rowFrame); + cellFrame->GetParent(rowFrame); rowFrame->GetRect(rowRect); nsIFrame *rowGroupFrame; - rowFrame->GetContentParent(rowGroupFrame); + rowFrame->GetParent(rowGroupFrame); rowGroupFrame->GetStyleData(eStyleStruct_Spacing, ((const nsStyleStruct *&)spacing)); styles.AppendElement((void*)spacing); // 5. row @@ -1443,7 +1441,7 @@ void nsTableFrame::ComputeRightBorderForEdgeAt(nsIPresContext& aPresContext, // 2. colgroup //XXX: need to test if we're really on a colgroup border nsTableColFrame *colFrame = mCellMap->GetColumnFrame(aColIndex); nsIFrame *colGroupFrame; - colFrame->GetContentParent(colGroupFrame); + colFrame->GetParent(colGroupFrame); colGroupFrame->GetStyleData(eStyleStruct_Spacing, ((const nsStyleStruct *&)spacing)); styles.AppendElement((void*)spacing); // 3. col @@ -1461,10 +1459,10 @@ void nsTableFrame::ComputeRightBorderForEdgeAt(nsIPresContext& aPresContext, if (nsnull!=cellFrame) { nsIFrame *rowFrame; - cellFrame->GetContentParent(rowFrame); + cellFrame->GetParent(rowFrame); rowFrame->GetRect(rowRect); nsIFrame *rowGroupFrame; - rowFrame->GetContentParent(rowGroupFrame); + rowFrame->GetParent(rowGroupFrame); if (nsnull==rightNeighborFrame) { // if rightNeighborFrame is null, our right neighbor is the table so we include the rowgroup and row rowGroupFrame->GetStyleData(eStyleStruct_Spacing, ((const nsStyleStruct *&)spacing)); @@ -1542,7 +1540,7 @@ void nsTableFrame::ComputeTopBorderForEdgeAt(nsIPresContext& aPresContext, // 2. colgroup nsTableColFrame *colFrame = mCellMap->GetColumnFrame(aColIndex); nsIFrame *colGroupFrame; - colFrame->GetContentParent(colGroupFrame); + colFrame->GetParent(colGroupFrame); colGroupFrame->GetStyleData(eStyleStruct_Spacing, ((const nsStyleStruct *&)spacing)); styles.AppendElement((void*)spacing); // 3. col @@ -1559,9 +1557,9 @@ void nsTableFrame::ComputeTopBorderForEdgeAt(nsIPresContext& aPresContext, if (nsnull!=cellFrame) { nsIFrame *rowFrame; - cellFrame->GetContentParent(rowFrame); + cellFrame->GetParent(rowFrame); nsIFrame *rowGroupFrame; - rowFrame->GetContentParent(rowGroupFrame); + rowFrame->GetParent(rowGroupFrame); rowGroupFrame->GetStyleData(eStyleStruct_Spacing, ((const nsStyleStruct *&)spacing)); styles.AppendElement((void*)spacing); // 5. row @@ -1661,7 +1659,7 @@ void nsTableFrame::ComputeBottomBorderForEdgeAt(nsIPresContext& aPresContext, // 2. colgroup // XXX: need to deterine if we're on a colgroup boundary nsTableColFrame *colFrame = mCellMap->GetColumnFrame(aColIndex); nsIFrame *colGroupFrame; - colFrame->GetContentParent(colGroupFrame); + colFrame->GetParent(colGroupFrame); colGroupFrame->GetStyleData(eStyleStruct_Spacing, ((const nsStyleStruct *&)spacing)); styles.AppendElement((void*)spacing); // 3. col @@ -1680,10 +1678,10 @@ void nsTableFrame::ComputeBottomBorderForEdgeAt(nsIPresContext& aPresContext, if (nsnull!=cellFrame) { nsIFrame *rowFrame; - cellFrame->GetContentParent(rowFrame); + cellFrame->GetParent(rowFrame); rowFrame->GetRect(rowRect); nsIFrame *rowGroupFrame; - rowFrame->GetContentParent(rowGroupFrame); + rowFrame->GetParent(rowGroupFrame); rowGroupFrame->GetStyleData(eStyleStruct_Spacing, ((const nsStyleStruct *&)spacing)); styles.AppendElement((void*)spacing); // 5. row @@ -2462,7 +2460,7 @@ NS_METHOD nsTableFrame::ResizeReflowPass1(nsIPresContext& aPresContext, PRBool aDoSiblingFrames) { NS_PRECONDITION(aReflowState.frame == this, "bad reflow state"); - NS_PRECONDITION(aReflowState.parentReflowState->frame == mGeometricParent, + NS_PRECONDITION(aReflowState.parentReflowState->frame == mParent, "bad parent reflow state"); NS_ASSERTION(nsnull==mPrevInFlow, "illegal call, cannot call pass 1 on a continuing frame."); NS_ASSERTION(nsnull != mContent, "null content"); @@ -2572,7 +2570,7 @@ NS_METHOD nsTableFrame::ResizeReflowPass2(nsIPresContext& aPresContext, nsReflowStatus& aStatus) { NS_PRECONDITION(aReflowState.frame == this, "bad reflow state"); - NS_PRECONDITION(aReflowState.parentReflowState->frame == mGeometricParent, + NS_PRECONDITION(aReflowState.parentReflowState->frame == mParent, "bad parent reflow state"); if (PR_TRUE==gsDebugNT) printf("%p nsTableFrame::ResizeReflow Pass2: maxSize=%d,%d\n", @@ -2663,7 +2661,7 @@ NS_METHOD nsTableFrame::IncrementalReflow(nsIPresContext& aPresContext, { // this is the target if target is either this or the outer table frame containing this inner frame nsIFrame *outerTableFrame=nsnull; - GetGeometricParent(outerTableFrame); + GetParent(outerTableFrame); if ((this==target) || (outerTableFrame==target)) rv = IR_TargetIsMe(aPresContext, aDesiredSize, state, aStatus); else @@ -3436,13 +3434,8 @@ NS_METHOD nsTableFrame::PullUpChildren(nsIPresContext& aPresContext, kidFrame->GetNextSibling(nextInFlow->mFirstChild); // Link the frame into our list of children - kidFrame->SetGeometricParent(this); - nsIFrame* contentParent; + kidFrame->SetParent(this); - kidFrame->GetContentParent(contentParent); - if (nextInFlow == contentParent) { - kidFrame->SetContentParent(this); - } if (nsnull == prevKidFrame) { mFirstChild = kidFrame; } else { @@ -4151,7 +4144,7 @@ nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->AppendToFlow(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 @@ -4183,7 +4176,7 @@ nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext, nsIFrame* duplicateFrame; NS_NewTableRowGroupFrame(duplicateFrame); - duplicateFrame->Init(aPresContext, content, cf, cf, kidStyleContext); + duplicateFrame->Init(aPresContext, content, cf, kidStyleContext); NS_RELEASE(kidStyleContext); // kidStyleContenxt: REFCNT-- if (nsnull==lastSib) @@ -4560,7 +4553,7 @@ NS_METHOD nsTableFrame::GetTableFrame(nsIFrame *aSourceFrame, nsTableFrame *& aT if (nsnull!=aSourceFrame) { // "result" is the result of intermediate calls, not the result we return from this method - nsresult result = aSourceFrame->GetContentParent((nsIFrame *&)parentFrame); + nsresult result = aSourceFrame->GetParent((nsIFrame *&)parentFrame); while ((NS_OK==result) && (nsnull!=parentFrame)) { const nsStyleDisplay *display; @@ -4571,7 +4564,7 @@ NS_METHOD nsTableFrame::GetTableFrame(nsIFrame *aSourceFrame, nsTableFrame *& aT rv = NS_OK; // only set if we found the table frame break; } - result = parentFrame->GetContentParent((nsIFrame *&)parentFrame); + result = parentFrame->GetParent((nsIFrame *&)parentFrame); } } NS_POSTCONDITION(nsnull!=aTableFrame, "unable to find table parent. aTableFrame null."); @@ -4704,7 +4697,7 @@ nscoord nsTableFrame::GetTableContainerWidth(const nsHTMLReflowState& aReflowSta // we only want to do this for inner table frames, so check the frame's parent to make sure it is an outer table frame // we know that if both the frame and it's parent map to NS_STYLE_DISPLAY_TABLE, then we have an inner table frame nsIFrame * tableFrameParent; - rs->frame->GetGeometricParent(tableFrameParent); + rs->frame->GetParent(tableFrameParent); tableFrameParent->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display); if (NS_STYLE_DISPLAY_TABLE==display->mDisplay) { @@ -4875,7 +4868,7 @@ PRBool nsTableFrame::TableIsAutoWidth(nsTableFrame *aTableFrame, nscoord nsTableFrame::GetMinCaptionWidth() { nsIFrame *outerTableFrame=nsnull; - GetContentParent(outerTableFrame); + GetParent(outerTableFrame); return (((nsTableOuterFrame *)outerTableFrame)->GetMinCaptionWidth()); } diff --git a/mozilla/layout/html/table/src/nsTableFrame.h b/mozilla/layout/html/table/src/nsTableFrame.h index bf03e06fb45..e8dd1322f4d 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.h +++ b/mozilla/layout/html/table/src/nsTableFrame.h @@ -80,8 +80,7 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aContext); diff --git a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp index ec79de2db05..48d04877f32 100644 --- a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp @@ -1141,7 +1141,7 @@ nsTableOuterFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->AppendToFlow(this); if (PR_TRUE==gsDebug) printf("nsTableOuterFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf); @@ -1190,7 +1190,7 @@ PRBool nsTableOuterFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, n NS_PRECONDITION(nsnull != nextInFlow, "null next-in-flow"); nsTableOuterFrame* parent; - nextInFlow->GetGeometricParent((nsIFrame*&)parent); + nextInFlow->GetParent((nsIFrame*&)parent); // If the next-in-flow has a next-in-flow then delete it too (and // delete it first). diff --git a/mozilla/layout/html/table/src/nsTableRowFrame.cpp b/mozilla/layout/html/table/src/nsTableRowFrame.cpp index f5f0d64af8f..c400fea3a38 100644 --- a/mozilla/layout/html/table/src/nsTableRowFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableRowFrame.cpp @@ -1448,7 +1448,7 @@ nsTableRowFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->AppendToFlow(this); cf->SetRowIndex(GetRowIndex()); diff --git a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp index 7923b004a12..5e224421b22 100644 --- a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp @@ -551,13 +551,8 @@ NS_METHOD nsTableRowGroupFrame::PullUpChildren(nsIPresContext& aPresContext kidFrame->GetNextSibling(nextInFlow->mFirstChild); // Link the frame into our list of children - kidFrame->SetGeometricParent(this); - nsIFrame* kidContentParent; + kidFrame->SetParent(this); - kidFrame->GetContentParent(kidContentParent); - if (nextInFlow == kidContentParent) { - kidFrame->SetContentParent(this); - } if (nsnull == prevKidFrame) { mFirstChild = kidFrame; } else { @@ -1334,7 +1329,7 @@ nsTableRowGroupFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->AppendToFlow(this); if (PR_TRUE==gsDebug) printf("nsTableRowGroupFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf); aContinuingFrame = cf; diff --git a/mozilla/layout/style/nsHTMLStyleSheet.cpp b/mozilla/layout/style/nsHTMLStyleSheet.cpp index 1dcb5bea3cd..0e5d7719b4a 100644 --- a/mozilla/layout/style/nsHTMLStyleSheet.cpp +++ b/mozilla/layout/style/nsHTMLStyleSheet.cpp @@ -231,7 +231,7 @@ nsAbsoluteItems::AddAbsolutelyPositionedChild(nsIFrame* aChildFrame) { #ifdef NS_DEBUG nsIFrame* parent; - aChildFrame->GetGeometricParent(parent); + aChildFrame->GetParent(parent); NS_PRECONDITION(parent == containingBlock, "bad geometric parent"); #endif @@ -390,8 +390,7 @@ protected: nsresult ConstructTableFrame(nsIPresContext* aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aStyleContext, nsAbsoluteItems& aAboluteItems, nsIFrame*& aNewFrame); @@ -1097,8 +1096,7 @@ HTMLStyleSheetImpl::CreateInputFrame(nsIContent* aContent, nsIFrame*& aFrame) nsresult HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aStyleContext, nsAbsoluteItems& aAbsoluteItems, nsIFrame*& aNewFrame) @@ -1114,8 +1112,7 @@ HTMLStyleSheetImpl::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, aGeometricParent, aContentParent, - aStyleContext); + aNewFrame->Init(*aPresContext, aContent, aParent, aStyleContext); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewFrame, aStyleContext, PR_FALSE); @@ -1130,7 +1127,7 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, nsHTMLAtoms::tablePseudo, aStyleContext); */ - innerFrame->Init(*aPresContext, aContent, aNewFrame, aNewFrame, aStyleContext); + innerFrame->Init(*aPresContext, aContent, aNewFrame, aStyleContext); // this should be "innerTableStyleContext" but I haven't tested that thoroughly yet // Iterate the child content @@ -1158,8 +1155,7 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, // Have we already created a caption? If so, ignore this caption if (nsnull == captionFrame) { NS_NewAreaFrame(captionFrame, 0); - captionFrame->Init(*aPresContext, childContent, aNewFrame, - aNewFrame, childStyleContext); + captionFrame->Init(*aPresContext, childContent, aNewFrame, childStyleContext); // Process the caption's child content and set the initial child list nsIFrame* captionChildList; ProcessChildren(aPresContext, childContent, captionFrame, @@ -1175,8 +1171,7 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, case NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP: case NS_STYLE_DISPLAY_TABLE_ROW_GROUP: NS_NewTableRowGroupFrame(frame); - frame->Init(*aPresContext, childContent, innerFrame, innerFrame, - childStyleContext); + frame->Init(*aPresContext, childContent, innerFrame, childStyleContext); break; case NS_STYLE_DISPLAY_TABLE_ROW: @@ -1193,13 +1188,12 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, NS_NewTableRowGroupFrame(frame); NS_RELEASE(childStyleContext); // we can't use this resolved style, so get rid of it childStyleContext = rowGroupStyleContext; // the row group style context will get set to childStyleContext after the switch ends. - frame->Init(*aPresContext, childContent, innerFrame, - innerFrame, childStyleContext); + frame->Init(*aPresContext, childContent, innerFrame, childStyleContext); // need to resolve the style context for the column again to be sure it's a child of the colgroup style context rowStyleContext = aPresContext->ResolveStyleContextFor(childContent, rowGroupStyleContext); nsIFrame *rowFrame; NS_NewTableRowFrame(rowFrame); - rowFrame->Init(*aPresContext, childContent, frame, frame, rowStyleContext); + rowFrame->Init(*aPresContext, childContent, frame, rowStyleContext); rowFrame->SetInitialChildList(*aPresContext, nsnull, nsnull); grandChildList = rowFrame; break; @@ -1245,12 +1239,12 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, NS_NewTableColGroupFrame(frame); NS_RELEASE(childStyleContext); // we can't use this resolved style, so get rid of it childStyleContext = colGroupStyleContext; // the col group style context will get set to childStyleContext after the switch ends. - frame->Init(*aPresContext, childContent, innerFrame, innerFrame, childStyleContext); + frame->Init(*aPresContext, childContent, innerFrame, childStyleContext); // need to resolve the style context for the column again to be sure it's a child of the colgroup style context colStyleContext = aPresContext->ResolveStyleContextFor(childContent, colGroupStyleContext); nsIFrame *colFrame; NS_NewTableColFrame(colFrame); - colFrame->Init(*aPresContext, childContent, frame, frame, colStyleContext); + colFrame->Init(*aPresContext, childContent, frame, colStyleContext); colFrame->SetInitialChildList(*aPresContext, nsnull, nsnull); grandChildList = colFrame; break; @@ -1258,7 +1252,7 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext, case NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP: NS_NewTableColGroupFrame(frame); - frame->Init(*aPresContext, childContent, innerFrame, innerFrame, childStyleContext); + frame->Init(*aPresContext, childContent, innerFrame, childStyleContext); break; default: @@ -1319,7 +1313,7 @@ HTMLStyleSheetImpl::ConstructTableCellFrame(nsIPresContext* aPresContext, rv = NS_NewTableCellFrame(aNewFrame); if (NS_SUCCEEDED(rv)) { // Initialize the table cell frame - aNewFrame->Init(*aPresContext, aContent, aParentFrame, aParentFrame, aStyleContext); + aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); // Create an area frame that will format the cell's content nsIFrame* cellBodyFrame; @@ -1334,7 +1328,7 @@ HTMLStyleSheetImpl::ConstructTableCellFrame(nsIPresContext* aPresContext, // Resolve pseudo style and initialize the body cell frame nsIStyleContext* bodyPseudoStyle = aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::cellContentPseudo, aStyleContext); - cellBodyFrame->Init(*aPresContext, aContent, aNewFrame, aNewFrame, bodyPseudoStyle); + cellBodyFrame->Init(*aPresContext, aContent, aNewFrame, bodyPseudoStyle); NS_RELEASE(bodyPseudoStyle); // Process children and set the body cell frame's initial child list @@ -1369,13 +1363,11 @@ HTMLStyleSheetImpl::ConstructDocElementFrame(nsIPresContext* aPresContext, // the root frame. // XXX We only need the scroll frame if it's print preview... NS_NewScrollFrame(scrollFrame); - scrollFrame->Init(*aPresContext, nsnull, aRootFrame, aRootFrame, - aRootStyleContext); + scrollFrame->Init(*aPresContext, nsnull, aRootFrame, aRootStyleContext); // The page sequence frame needs a view, because it's a scrolled frame NS_NewSimplePageSequenceFrame(pageSequenceFrame); - pageSequenceFrame->Init(*aPresContext, nsnull, scrollFrame, scrollFrame, - aRootStyleContext); + pageSequenceFrame->Init(*aPresContext, nsnull, scrollFrame, aRootStyleContext); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageSequenceFrame, aRootStyleContext, PR_TRUE); @@ -1386,8 +1378,7 @@ HTMLStyleSheetImpl::ConstructDocElementFrame(nsIPresContext* aPresContext, // Initialize the page and force it to have a view. This makes printing of // the pages easier and faster. // XXX Use a PAGE style context... - pageFrame->Init(*aPresContext, nsnull, pageSequenceFrame, pageSequenceFrame, - aRootStyleContext); + pageFrame->Init(*aPresContext, nsnull, pageSequenceFrame, aRootStyleContext); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageFrame, aRootStyleContext, PR_TRUE); @@ -1399,7 +1390,7 @@ HTMLStyleSheetImpl::ConstructDocElementFrame(nsIPresContext* aPresContext, nsIFrame* areaFrame; NS_NewAreaFrame(areaFrame, 0); - areaFrame->Init(*aPresContext, aDocElement, pageFrame, pageFrame, styleContext); + areaFrame->Init(*aPresContext, aDocElement, pageFrame, styleContext); NS_RELEASE(styleContext); // The area frame is the "initial containing block" @@ -1457,8 +1448,7 @@ HTMLStyleSheetImpl::ConstructDocElementFrame(nsIPresContext* aPresContext, if (NS_STYLE_OVERFLOW_HIDDEN != scrolling) { NS_NewScrollFrame(scrollFrame); - scrollFrame->Init(*aPresContext, aDocElement, aRootFrame, aRootFrame, - styleContext); + scrollFrame->Init(*aPresContext, aDocElement, aRootFrame, styleContext); // The scrolled frame gets a pseudo element style context nsIStyleContext* scrolledPseudoStyle = @@ -1477,8 +1467,7 @@ HTMLStyleSheetImpl::ConstructDocElementFrame(nsIPresContext* aPresContext, // flag that says that this is the body... NS_NewAreaFrame(areaFrame, NS_BLOCK_DOCUMENT_ROOT|NS_BLOCK_MARGIN_ROOT); nsIFrame* parentFrame = scrollFrame ? scrollFrame : aRootFrame; - areaFrame->Init(*aPresContext, aDocElement, parentFrame, parentFrame, - styleContext); + areaFrame->Init(*aPresContext, aDocElement, parentFrame, styleContext); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, areaFrame, styleContext, PR_FALSE); NS_RELEASE(styleContext); @@ -1536,7 +1525,7 @@ HTMLStyleSheetImpl::ConstructRootFrame(nsIPresContext* aPresContext, nsHTMLAtoms::rootPseudo, nsnull); // Initialize the root frame. It has a NULL content object - rootFrame->Init(*aPresContext, nsnull, nsnull, nsnull, rootPseudoStyle); + rootFrame->Init(*aPresContext, nsnull, nsnull, rootPseudoStyle); // Bind the root frame to the root view nsIPresShell* presShell = aPresContext->GetShell(); @@ -1580,7 +1569,7 @@ HTMLStyleSheetImpl::CreatePlaceholderFrameFor(nsIPresContext* aPresContext, aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::placeholderPseudo, aStyleContext); placeholderFrame->Init(*aPresContext, aContent, aParentFrame, - aParentFrame, placeholderPseudoStyle); + placeholderPseudoStyle); NS_RELEASE(placeholderPseudoStyle); // Add mapping from absolutely positioned frame to its placeholder frame @@ -1669,8 +1658,7 @@ HTMLStyleSheetImpl::ConstructFrameByTag(nsIPresContext* aPresContext, //rv = NS_NewObjectFrame(aContent, aParentFrame, aNewFrame); nsIFrame *blockFrame; NS_NewBlockFrame(blockFrame, 0); - blockFrame->Init(*aPresContext, aContent, aNewFrame, aNewFrame, - aStyleContext); + blockFrame->Init(*aPresContext, aContent, aNewFrame, aStyleContext); aNewFrame = blockFrame; processChildren = PR_TRUE; } @@ -1704,8 +1692,7 @@ HTMLStyleSheetImpl::ConstructFrameByTag(nsIPresContext* aPresContext, if (NS_SUCCEEDED(rv) && (nsnull != aNewFrame)) { nsIFrame* geometricParent = isAbsolutelyPositioned ? aAbsoluteItems.containingBlock : aParentFrame; - aNewFrame->Init(*aPresContext, aContent, geometricParent, aParentFrame, - aStyleContext); + aNewFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext); // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewFrame, @@ -1784,8 +1771,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte // Initialize it nsIFrame* geometricParent = isAbsolutelyPositioned ? aAbsoluteItems.containingBlock : aParentFrame; - scrollFrame->Init(*aPresContext, aContent, geometricParent, aParentFrame, - aStyleContext); + scrollFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext); // The scroll frame gets the original style context, and the scrolled // frame gets a SCROLLED-CONTENT pseudo element style context that @@ -1798,8 +1784,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte NS_NewAreaFrame(scrolledFrame, NS_BLOCK_SHRINK_WRAP); // Initialize the frame and force it to have a view - scrolledFrame->Init(*aPresContext, aContent, scrollFrame, scrollFrame, - scrolledPseudoStyle); + scrolledFrame->Init(*aPresContext, aContent, scrollFrame, scrolledPseudoStyle); nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, scrolledFrame, scrolledPseudoStyle, PR_TRUE); NS_RELEASE(scrolledPseudoStyle); @@ -1842,7 +1827,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte // Create an area frame NS_NewAreaFrame(aNewFrame, 0); aNewFrame->Init(*aPresContext, aContent, aAbsoluteItems.containingBlock, - aParentFrame, aStyleContext); + aStyleContext); // Create a view nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewFrame, @@ -1871,8 +1856,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte NS_NewAreaFrame(aNewFrame, NS_BLOCK_SHRINK_WRAP); // Initialize the frame - aNewFrame->Init(*aPresContext, aContent, aParentFrame, aParentFrame, - aStyleContext); + aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); // See if we need to create a view nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewFrame, @@ -1908,8 +1892,8 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte isAbsolutelyPositioned = NS_STYLE_POSITION_ABSOLUTE == position->mPosition; nsIFrame* geometricParent = isAbsolutelyPositioned ? aAbsoluteItems.containingBlock : aParentFrame; - rv = ConstructTableFrame(aPresContext, aContent, geometricParent, aParentFrame, - aStyleContext, aAbsoluteItems, aNewFrame); + rv = ConstructTableFrame(aPresContext, aContent, geometricParent, aStyleContext, + aAbsoluteItems, aNewFrame); // Note: table construction function takes care of initializing the frame, // processing children, and setting the initial child list if (isAbsolutelyPositioned) { @@ -1993,8 +1977,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte // If we succeeded in creating a frame then initialize the frame and // process children if requested if (NS_SUCCEEDED(rv) && (nsnull != aNewFrame)) { - aNewFrame->Init(*aPresContext, aContent, aParentFrame, aParentFrame, - aStyleContext); + aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext); // See if we need to create a view, e.g. the frame is absolutely positioned nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewFrame, @@ -2278,7 +2261,7 @@ HTMLStyleSheetImpl::GetAbsoluteContainingBlock(nsIPresContext* aPresContext, } // Continue walking up the hierarchy - containingBlock->GetGeometricParent(containingBlock); + containingBlock->GetParent(containingBlock); } // If we didn't find an absolutely positioned containing block, then use the @@ -2483,13 +2466,11 @@ HTMLStyleSheetImpl::ContentInserted(nsIPresContext* aPresContext, shell->GetPrimaryFrameFor(aContainer, parentFrame); } else { - // Use the prev sibling if we have it; otherwise use the next sibling. - // Note that we use the content parent, and not the geometric parent, - // in case the frame has been moved out of the flow... + // Use the prev sibling if we have it; otherwise use the next sibling if (nsnull != prevSibling) { - prevSibling->GetContentParent(parentFrame); + prevSibling->GetParent(parentFrame); } else { - nextSibling->GetContentParent(parentFrame); + nextSibling->GetParent(parentFrame); } } @@ -2581,7 +2562,7 @@ HTMLStyleSheetImpl::ContentRemoved(nsIPresContext* aPresContext, // Generate two reflow commands. First for the absolutely positioned // frame and then for its placeholder frame nsIFrame* parentFrame; - childFrame->GetGeometricParent(parentFrame); + childFrame->GetParent(parentFrame); // Notify the parent frame with a reflow command. nsIReflowCommand* reflowCmd; @@ -2599,7 +2580,7 @@ HTMLStyleSheetImpl::ContentRemoved(nsIPresContext* aPresContext, shell->GetPlaceholderFrameFor(childFrame, placeholderFrame); if (nsnull != placeholderFrame) { - placeholderFrame->GetGeometricParent(parentFrame); + placeholderFrame->GetParent(parentFrame); rv = NS_NewHTMLReflowCommand(&reflowCmd, parentFrame, nsIReflowCommand::FrameRemoved, placeholderFrame); @@ -2614,7 +2595,7 @@ HTMLStyleSheetImpl::ContentRemoved(nsIPresContext* aPresContext, // Note that we use the content parent, and not the geometric parent, // in case the frame has been moved out of the flow... nsIFrame* parentFrame; - childFrame->GetContentParent(parentFrame); + childFrame->GetParent(parentFrame); NS_ASSERTION(nsnull != parentFrame, "null content parent frame"); // Notify the parent frame with a reflow command. diff --git a/mozilla/layout/style/nsStyleContext.cpp b/mozilla/layout/style/nsStyleContext.cpp index d1200c9093d..8e359a36646 100644 --- a/mozilla/layout/style/nsStyleContext.cpp +++ b/mozilla/layout/style/nsStyleContext.cpp @@ -137,7 +137,7 @@ static nscoord CalcSideFor(const nsIFrame* aFrame, const nsStyleCoord& aCoord, case eStyleUnit_Inherit: nsIFrame* parentFrame; - aFrame->GetGeometricParent(parentFrame); // XXX may not be direct parent... + aFrame->GetParent(parentFrame); // XXX may not be direct parent... if (nsnull != parentFrame) { nsIStyleContext* parentContext; parentFrame->GetStyleContext(parentContext); @@ -168,7 +168,7 @@ static nscoord CalcSideFor(const nsIFrame* aFrame, const nsStyleCoord& aCoord, nscoord baseWidth = 0; PRBool isBase = PR_FALSE; nsIFrame* frame; - aFrame->GetGeometricParent(frame); + aFrame->GetParent(frame); while (nsnull != frame) { frame->IsPercentageBase(isBase); if (isBase) { @@ -177,7 +177,7 @@ static nscoord CalcSideFor(const nsIFrame* aFrame, const nsStyleCoord& aCoord, baseWidth = size.width; // not really width, need to subtract out padding... break; } - frame->GetGeometricParent(frame); + frame->GetParent(frame); } result = (nscoord)((float)baseWidth * aCoord.GetPercentValue()); } diff --git a/mozilla/layout/tables/nsTableCellFrame.cpp b/mozilla/layout/tables/nsTableCellFrame.cpp index a30e255f889..d2cfebf2e2a 100644 --- a/mozilla/layout/tables/nsTableCellFrame.cpp +++ b/mozilla/layout/tables/nsTableCellFrame.cpp @@ -564,7 +564,7 @@ nsTableCellFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->AppendToFlow(this); cf->InitCellFrame(GetColIndex()); aContinuingFrame = cf; diff --git a/mozilla/layout/tables/nsTableCellFrame.h b/mozilla/layout/tables/nsTableCellFrame.h index f0ffd28e6dc..2e48b46c737 100644 --- a/mozilla/layout/tables/nsTableCellFrame.h +++ b/mozilla/layout/tables/nsTableCellFrame.h @@ -216,7 +216,7 @@ public: inline PRInt32 nsTableCellFrame::GetRowIndex() { nsTableRowFrame * row; - GetContentParent((nsIFrame *&)row); + GetParent((nsIFrame *&)row); if (nsnull!=row) return row->GetRowIndex(); else diff --git a/mozilla/layout/tables/nsTableColGroupFrame.cpp b/mozilla/layout/tables/nsTableColGroupFrame.cpp index f7f394cd2f7..badeeaa814f 100644 --- a/mozilla/layout/tables/nsTableColGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableColGroupFrame.cpp @@ -90,7 +90,7 @@ nsTableColGroupFrame::InitNewFrames(nsIPresContext& aPresContext, nsIFrame* aChi // Set its style context nsIStyleContextPtr colStyleContext = aPresContext.ResolveStyleContextFor(col, mStyleContext, PR_TRUE); - colFrame->Init(aPresContext, col, this, this, colStyleContext); + colFrame->Init(aPresContext, col, this, colStyleContext); colFrame->SetInitialChildList(aPresContext, nsnull, nsnull); // Set nsColFrame-specific information diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index 56e1a888d5c..4445e3077ea 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -284,8 +284,7 @@ nsTableFrame::nsTableFrame() NS_IMETHODIMP nsTableFrame::Init(nsIPresContext& aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aContext) { float p2t = aPresContext.GetPixelsToTwips(); @@ -293,8 +292,7 @@ nsTableFrame::Init(nsIPresContext& aPresContext, mDefaultCellSpacingY = NSIntPixelsToTwips(2, p2t); mDefaultCellPadding = NSIntPixelsToTwips(1, p2t); - return nsHTMLContainerFrame::Init(aPresContext, aContent, aGeometricParent, - aContentParent, aContext); + return nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext); } @@ -707,12 +705,12 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext) // first, need to get the nearest containing content object GetContent(lastColGroupElement); // ADDREF a: lastColGroupElement++ (either here or in the loop below) nsIFrame *parentFrame; - GetContentParent(parentFrame); + GetParent(parentFrame); while (nsnull==lastColGroupElement) { parentFrame->GetContent(lastColGroupElement); if (nsnull==lastColGroupElement) - parentFrame->GetContentParent(parentFrame); + parentFrame->GetParent(parentFrame); } // now we have a ref-counted "lastColGroupElement" content object nsIStyleContext* colGroupStyleContext = @@ -722,7 +720,7 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext) // Create a col group frame nsIFrame* newFrame; NS_NewTableColGroupFrame(newFrame); - newFrame->Init(aPresContext, lastColGroupElement, this, this, colGroupStyleContext); + newFrame->Init(aPresContext, lastColGroupElement, this, colGroupStyleContext); lastColGroupFrame = (nsTableColGroupFrame*)newFrame; NS_RELEASE(colGroupStyleContext); // kidStyleContenxt: REFCNT-- @@ -755,7 +753,7 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext) PR_TRUE); // colStyleContext: REFCNT++ NS_NewTableColFrame(colFrame); colFrame->Init(aPresContext, lastColGroupElement, lastColGroupFrame, - lastColGroupFrame, colStyleContext); + colStyleContext); NS_RELEASE(colStyleContext); colFrame->SetInitialChildList(aPresContext, nsnull, nsnull); @@ -969,7 +967,7 @@ void nsTableFrame::DumpCellMap () { nsTableCellFrame *cell = cd->mRealCell->mCell; nsTableRowFrame *row; - cell->GetGeometricParent((nsIFrame *&)row); + cell->GetParent((nsIFrame *&)row); int rr = row->GetRowIndex (); int cc = cell->GetColIndex (); printf("S%d,%d ", rr, cc); @@ -977,7 +975,7 @@ void nsTableFrame::DumpCellMap () { cell = cd->mOverlap->mCell; nsTableRowFrame* row2; - cell->GetGeometricParent((nsIFrame *&)row2); + cell->GetParent((nsIFrame *&)row2); rr = row2->GetRowIndex (); cc = cell->GetColIndex (); printf("O%d,%c ", rr, cc); @@ -1187,7 +1185,7 @@ void nsTableFrame::DidComputeHorizontalCollapsingBorders(nsIPresContext& aPresCo if (nsnull!=cellFrame) { nsIFrame *rowFrame; - cellFrame->GetContentParent(rowFrame); + cellFrame->GetParent(rowFrame); rowFrame->GetRect(rowRect); nsBorderEdge *leftBorder = (nsBorderEdge *)(mBorderEdges.mEdges[NS_SIDE_LEFT].ElementAt(0)); nsBorderEdge *rightBorder = (nsBorderEdge *)(mBorderEdges.mEdges[NS_SIDE_RIGHT].ElementAt(0)); @@ -1211,7 +1209,7 @@ void nsTableFrame::DidComputeHorizontalCollapsingBorders(nsIPresContext& aPresCo if (nsnull!=cellFrame) { nsIFrame *rowFrame; - cellFrame->GetContentParent(rowFrame); + cellFrame->GetParent(rowFrame); rowFrame->GetRect(rowRect); nsBorderEdge *leftBorder = (nsBorderEdge *)(mBorderEdges.mEdges[NS_SIDE_LEFT].ElementAt(lastRowIndex)); nsBorderEdge *rightBorder = (nsBorderEdge *)(mBorderEdges.mEdges[NS_SIDE_RIGHT].ElementAt(lastRowIndex)); @@ -1329,7 +1327,7 @@ void nsTableFrame::ComputeLeftBorderForEdgeAt(nsIPresContext& aPresContext, // 2. colgroup nsTableColFrame *colFrame = mCellMap->GetColumnFrame(aColIndex); nsIFrame *colGroupFrame; - colFrame->GetContentParent(colGroupFrame); + colFrame->GetParent(colGroupFrame); colGroupFrame->GetStyleData(eStyleStruct_Spacing, ((const nsStyleStruct *&)spacing)); styles.AppendElement((void*)spacing); // 3. col @@ -1347,10 +1345,10 @@ void nsTableFrame::ComputeLeftBorderForEdgeAt(nsIPresContext& aPresContext, if (nsnull!=cellFrame) { nsIFrame *rowFrame; - cellFrame->GetContentParent(rowFrame); + cellFrame->GetParent(rowFrame); rowFrame->GetRect(rowRect); nsIFrame *rowGroupFrame; - rowFrame->GetContentParent(rowGroupFrame); + rowFrame->GetParent(rowGroupFrame); rowGroupFrame->GetStyleData(eStyleStruct_Spacing, ((const nsStyleStruct *&)spacing)); styles.AppendElement((void*)spacing); // 5. row @@ -1443,7 +1441,7 @@ void nsTableFrame::ComputeRightBorderForEdgeAt(nsIPresContext& aPresContext, // 2. colgroup //XXX: need to test if we're really on a colgroup border nsTableColFrame *colFrame = mCellMap->GetColumnFrame(aColIndex); nsIFrame *colGroupFrame; - colFrame->GetContentParent(colGroupFrame); + colFrame->GetParent(colGroupFrame); colGroupFrame->GetStyleData(eStyleStruct_Spacing, ((const nsStyleStruct *&)spacing)); styles.AppendElement((void*)spacing); // 3. col @@ -1461,10 +1459,10 @@ void nsTableFrame::ComputeRightBorderForEdgeAt(nsIPresContext& aPresContext, if (nsnull!=cellFrame) { nsIFrame *rowFrame; - cellFrame->GetContentParent(rowFrame); + cellFrame->GetParent(rowFrame); rowFrame->GetRect(rowRect); nsIFrame *rowGroupFrame; - rowFrame->GetContentParent(rowGroupFrame); + rowFrame->GetParent(rowGroupFrame); if (nsnull==rightNeighborFrame) { // if rightNeighborFrame is null, our right neighbor is the table so we include the rowgroup and row rowGroupFrame->GetStyleData(eStyleStruct_Spacing, ((const nsStyleStruct *&)spacing)); @@ -1542,7 +1540,7 @@ void nsTableFrame::ComputeTopBorderForEdgeAt(nsIPresContext& aPresContext, // 2. colgroup nsTableColFrame *colFrame = mCellMap->GetColumnFrame(aColIndex); nsIFrame *colGroupFrame; - colFrame->GetContentParent(colGroupFrame); + colFrame->GetParent(colGroupFrame); colGroupFrame->GetStyleData(eStyleStruct_Spacing, ((const nsStyleStruct *&)spacing)); styles.AppendElement((void*)spacing); // 3. col @@ -1559,9 +1557,9 @@ void nsTableFrame::ComputeTopBorderForEdgeAt(nsIPresContext& aPresContext, if (nsnull!=cellFrame) { nsIFrame *rowFrame; - cellFrame->GetContentParent(rowFrame); + cellFrame->GetParent(rowFrame); nsIFrame *rowGroupFrame; - rowFrame->GetContentParent(rowGroupFrame); + rowFrame->GetParent(rowGroupFrame); rowGroupFrame->GetStyleData(eStyleStruct_Spacing, ((const nsStyleStruct *&)spacing)); styles.AppendElement((void*)spacing); // 5. row @@ -1661,7 +1659,7 @@ void nsTableFrame::ComputeBottomBorderForEdgeAt(nsIPresContext& aPresContext, // 2. colgroup // XXX: need to deterine if we're on a colgroup boundary nsTableColFrame *colFrame = mCellMap->GetColumnFrame(aColIndex); nsIFrame *colGroupFrame; - colFrame->GetContentParent(colGroupFrame); + colFrame->GetParent(colGroupFrame); colGroupFrame->GetStyleData(eStyleStruct_Spacing, ((const nsStyleStruct *&)spacing)); styles.AppendElement((void*)spacing); // 3. col @@ -1680,10 +1678,10 @@ void nsTableFrame::ComputeBottomBorderForEdgeAt(nsIPresContext& aPresContext, if (nsnull!=cellFrame) { nsIFrame *rowFrame; - cellFrame->GetContentParent(rowFrame); + cellFrame->GetParent(rowFrame); rowFrame->GetRect(rowRect); nsIFrame *rowGroupFrame; - rowFrame->GetContentParent(rowGroupFrame); + rowFrame->GetParent(rowGroupFrame); rowGroupFrame->GetStyleData(eStyleStruct_Spacing, ((const nsStyleStruct *&)spacing)); styles.AppendElement((void*)spacing); // 5. row @@ -2462,7 +2460,7 @@ NS_METHOD nsTableFrame::ResizeReflowPass1(nsIPresContext& aPresContext, PRBool aDoSiblingFrames) { NS_PRECONDITION(aReflowState.frame == this, "bad reflow state"); - NS_PRECONDITION(aReflowState.parentReflowState->frame == mGeometricParent, + NS_PRECONDITION(aReflowState.parentReflowState->frame == mParent, "bad parent reflow state"); NS_ASSERTION(nsnull==mPrevInFlow, "illegal call, cannot call pass 1 on a continuing frame."); NS_ASSERTION(nsnull != mContent, "null content"); @@ -2572,7 +2570,7 @@ NS_METHOD nsTableFrame::ResizeReflowPass2(nsIPresContext& aPresContext, nsReflowStatus& aStatus) { NS_PRECONDITION(aReflowState.frame == this, "bad reflow state"); - NS_PRECONDITION(aReflowState.parentReflowState->frame == mGeometricParent, + NS_PRECONDITION(aReflowState.parentReflowState->frame == mParent, "bad parent reflow state"); if (PR_TRUE==gsDebugNT) printf("%p nsTableFrame::ResizeReflow Pass2: maxSize=%d,%d\n", @@ -2663,7 +2661,7 @@ NS_METHOD nsTableFrame::IncrementalReflow(nsIPresContext& aPresContext, { // this is the target if target is either this or the outer table frame containing this inner frame nsIFrame *outerTableFrame=nsnull; - GetGeometricParent(outerTableFrame); + GetParent(outerTableFrame); if ((this==target) || (outerTableFrame==target)) rv = IR_TargetIsMe(aPresContext, aDesiredSize, state, aStatus); else @@ -3436,13 +3434,8 @@ NS_METHOD nsTableFrame::PullUpChildren(nsIPresContext& aPresContext, kidFrame->GetNextSibling(nextInFlow->mFirstChild); // Link the frame into our list of children - kidFrame->SetGeometricParent(this); - nsIFrame* contentParent; + kidFrame->SetParent(this); - kidFrame->GetContentParent(contentParent); - if (nextInFlow == contentParent) { - kidFrame->SetContentParent(this); - } if (nsnull == prevKidFrame) { mFirstChild = kidFrame; } else { @@ -4151,7 +4144,7 @@ nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->AppendToFlow(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 @@ -4183,7 +4176,7 @@ nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext, nsIFrame* duplicateFrame; NS_NewTableRowGroupFrame(duplicateFrame); - duplicateFrame->Init(aPresContext, content, cf, cf, kidStyleContext); + duplicateFrame->Init(aPresContext, content, cf, kidStyleContext); NS_RELEASE(kidStyleContext); // kidStyleContenxt: REFCNT-- if (nsnull==lastSib) @@ -4560,7 +4553,7 @@ NS_METHOD nsTableFrame::GetTableFrame(nsIFrame *aSourceFrame, nsTableFrame *& aT if (nsnull!=aSourceFrame) { // "result" is the result of intermediate calls, not the result we return from this method - nsresult result = aSourceFrame->GetContentParent((nsIFrame *&)parentFrame); + nsresult result = aSourceFrame->GetParent((nsIFrame *&)parentFrame); while ((NS_OK==result) && (nsnull!=parentFrame)) { const nsStyleDisplay *display; @@ -4571,7 +4564,7 @@ NS_METHOD nsTableFrame::GetTableFrame(nsIFrame *aSourceFrame, nsTableFrame *& aT rv = NS_OK; // only set if we found the table frame break; } - result = parentFrame->GetContentParent((nsIFrame *&)parentFrame); + result = parentFrame->GetParent((nsIFrame *&)parentFrame); } } NS_POSTCONDITION(nsnull!=aTableFrame, "unable to find table parent. aTableFrame null."); @@ -4704,7 +4697,7 @@ nscoord nsTableFrame::GetTableContainerWidth(const nsHTMLReflowState& aReflowSta // we only want to do this for inner table frames, so check the frame's parent to make sure it is an outer table frame // we know that if both the frame and it's parent map to NS_STYLE_DISPLAY_TABLE, then we have an inner table frame nsIFrame * tableFrameParent; - rs->frame->GetGeometricParent(tableFrameParent); + rs->frame->GetParent(tableFrameParent); tableFrameParent->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display); if (NS_STYLE_DISPLAY_TABLE==display->mDisplay) { @@ -4875,7 +4868,7 @@ PRBool nsTableFrame::TableIsAutoWidth(nsTableFrame *aTableFrame, nscoord nsTableFrame::GetMinCaptionWidth() { nsIFrame *outerTableFrame=nsnull; - GetContentParent(outerTableFrame); + GetParent(outerTableFrame); return (((nsTableOuterFrame *)outerTableFrame)->GetMinCaptionWidth()); } diff --git a/mozilla/layout/tables/nsTableFrame.h b/mozilla/layout/tables/nsTableFrame.h index bf03e06fb45..e8dd1322f4d 100644 --- a/mozilla/layout/tables/nsTableFrame.h +++ b/mozilla/layout/tables/nsTableFrame.h @@ -80,8 +80,7 @@ public: NS_IMETHOD Init(nsIPresContext& aPresContext, nsIContent* aContent, - nsIFrame* aGeometricParent, - nsIFrame* aContentParent, + nsIFrame* aParent, nsIStyleContext* aContext); diff --git a/mozilla/layout/tables/nsTableOuterFrame.cpp b/mozilla/layout/tables/nsTableOuterFrame.cpp index ec79de2db05..48d04877f32 100644 --- a/mozilla/layout/tables/nsTableOuterFrame.cpp +++ b/mozilla/layout/tables/nsTableOuterFrame.cpp @@ -1141,7 +1141,7 @@ nsTableOuterFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->AppendToFlow(this); if (PR_TRUE==gsDebug) printf("nsTableOuterFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf); @@ -1190,7 +1190,7 @@ PRBool nsTableOuterFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, n NS_PRECONDITION(nsnull != nextInFlow, "null next-in-flow"); nsTableOuterFrame* parent; - nextInFlow->GetGeometricParent((nsIFrame*&)parent); + nextInFlow->GetParent((nsIFrame*&)parent); // If the next-in-flow has a next-in-flow then delete it too (and // delete it first). diff --git a/mozilla/layout/tables/nsTableRowFrame.cpp b/mozilla/layout/tables/nsTableRowFrame.cpp index f5f0d64af8f..c400fea3a38 100644 --- a/mozilla/layout/tables/nsTableRowFrame.cpp +++ b/mozilla/layout/tables/nsTableRowFrame.cpp @@ -1448,7 +1448,7 @@ nsTableRowFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->AppendToFlow(this); cf->SetRowIndex(GetRowIndex()); diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.cpp b/mozilla/layout/tables/nsTableRowGroupFrame.cpp index 7923b004a12..5e224421b22 100644 --- a/mozilla/layout/tables/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableRowGroupFrame.cpp @@ -551,13 +551,8 @@ NS_METHOD nsTableRowGroupFrame::PullUpChildren(nsIPresContext& aPresContext kidFrame->GetNextSibling(nextInFlow->mFirstChild); // Link the frame into our list of children - kidFrame->SetGeometricParent(this); - nsIFrame* kidContentParent; + kidFrame->SetParent(this); - kidFrame->GetContentParent(kidContentParent); - if (nextInFlow == kidContentParent) { - kidFrame->SetContentParent(this); - } if (nsnull == prevKidFrame) { mFirstChild = kidFrame; } else { @@ -1334,7 +1329,7 @@ nsTableRowGroupFrame::CreateContinuingFrame(nsIPresContext& aPresContext, if (nsnull == cf) { return NS_ERROR_OUT_OF_MEMORY; } - cf->Init(aPresContext, mContent, aParent, mContentParent, aStyleContext); + cf->Init(aPresContext, mContent, aParent, aStyleContext); cf->AppendToFlow(this); if (PR_TRUE==gsDebug) printf("nsTableRowGroupFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf); aContinuingFrame = cf;