Removed the content-parent frame pointer. Now we just have the one geometric

parent
This commit is contained in:
troy%netscape.com 1999-01-14 05:16:23 +00:00
Родитель cc9c6e9338
Коммит 036e6852f2
75 изменённых файлов: 443 добавлений и 794 удалений

Просмотреть файл

@ -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());
}

Просмотреть файл

@ -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.

Просмотреть файл

@ -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

Просмотреть файл

@ -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());
}

Просмотреть файл

@ -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;

Просмотреть файл

@ -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);

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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);
}
}

Просмотреть файл

@ -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);
}
}

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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);
}
}

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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 ==

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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, "<ident addr=\"%p\"/>\n", this);
if (mContentParent != mGeometricParent) {
if (nsnull != mParent) {
IndentBy(out, aIndent);
fprintf(out, "<content-parent addr=\"%p\"/>\n", mContentParent);
}
if (nsnull != mGeometricParent) {
IndentBy(out, aIndent);
fprintf(out, "<geometric-parent addr=\"%p\"/>\n", mGeometricParent);
fprintf(out, "<parent addr=\"%p\"/>\n", mParent);
}
if (nsnull != mNextSibling) {

Просмотреть файл

@ -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;

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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;

Просмотреть файл

@ -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);

Просмотреть файл

@ -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);
}
}

Просмотреть файл

@ -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);
}
}
}

Просмотреть файл

@ -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

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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);
}
}

Просмотреть файл

@ -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);
}
}

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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);
}
}

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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 ==

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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, "<ident addr=\"%p\"/>\n", this);
if (mContentParent != mGeometricParent) {
if (nsnull != mParent) {
IndentBy(out, aIndent);
fprintf(out, "<content-parent addr=\"%p\"/>\n", mContentParent);
}
if (nsnull != mGeometricParent) {
IndentBy(out, aIndent);
fprintf(out, "<geometric-parent addr=\"%p\"/>\n", mGeometricParent);
fprintf(out, "<parent addr=\"%p\"/>\n", mParent);
}
if (nsnull != mNextSibling) {

Просмотреть файл

@ -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;

Просмотреть файл

@ -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

Просмотреть файл

@ -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);

Просмотреть файл

@ -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,

Просмотреть файл

@ -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);
}
}

Просмотреть файл

@ -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);
}
}
}

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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);
}
}

Просмотреть файл

@ -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;

Просмотреть файл

@ -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();

Просмотреть файл

@ -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;

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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);

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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.

Просмотреть файл

@ -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;

Просмотреть файл

@ -216,7 +216,7 @@ public:
inline PRInt32 nsTableCellFrame::GetRowIndex()
{
nsTableRowFrame * row;
GetContentParent((nsIFrame *&)row);
GetParent((nsIFrame *&)row);
if (nsnull!=row)
return row->GetRowIndex();
else

Просмотреть файл

@ -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

Просмотреть файл

@ -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());
}

Просмотреть файл

@ -80,8 +80,7 @@ public:
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aGeometricParent,
nsIFrame* aContentParent,
nsIFrame* aParent,
nsIStyleContext* aContext);

Просмотреть файл

@ -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).

Просмотреть файл

@ -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());

Просмотреть файл

@ -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;

Просмотреть файл

@ -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.

Просмотреть файл

@ -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());
}

Просмотреть файл

@ -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;

Просмотреть файл

@ -216,7 +216,7 @@ public:
inline PRInt32 nsTableCellFrame::GetRowIndex()
{
nsTableRowFrame * row;
GetContentParent((nsIFrame *&)row);
GetParent((nsIFrame *&)row);
if (nsnull!=row)
return row->GetRowIndex();
else

Просмотреть файл

@ -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

Просмотреть файл

@ -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());
}

Просмотреть файл

@ -80,8 +80,7 @@ public:
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aGeometricParent,
nsIFrame* aContentParent,
nsIFrame* aParent,
nsIStyleContext* aContext);

Просмотреть файл

@ -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).

Просмотреть файл

@ -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());

Просмотреть файл

@ -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;