Used revised version of nsContainerFrame that uses an nsFrameList instead of a raw nsIFrame*

git-svn-id: svn://10.0.0.236/trunk@17883 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kipp%netscape.com
1999-01-15 22:52:05 +00:00
parent 478aeecf15
commit c3040176bf
25 changed files with 384 additions and 395 deletions

View File

@@ -507,21 +507,23 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext& aPresContext,
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
PRUint8 flags = (mInline) ? NS_BLOCK_SHRINK_WRAP : 0;
NS_NewAreaFrame(mFirstChild, flags);
nsIFrame* areaFrame;
NS_NewAreaFrame(areaFrame, flags);
mFrames.SetFrames(areaFrame);
// Resolve style and initialize the frame
nsIStyleContext* styleContext =
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::buttonContentPseudo, mStyleContext);
mFirstChild->Init(aPresContext, mContent, this, styleContext);
mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext);
NS_RELEASE(styleContext);
// Set the parent for each of the child frames
for (nsIFrame* frame = aChildList; nsnull != frame; frame->GetNextSibling(frame)) {
frame->SetParent(mFirstChild);
frame->SetParent(mFrames.FirstChild());
}
// Queue up the frames for the inline frame
return mFirstChild->SetInitialChildList(aPresContext, nsnull, aChildList);
return mFrames.FirstChild()->SetInitialChildList(aPresContext, nsnull, aChildList);
}
NS_IMETHODIMP
@@ -604,8 +606,9 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext,
nsSize availSize(aReflowState.availableWidth, aReflowState.availableHeight);
// reflow the child
nsHTMLReflowState reflowState(aPresContext, mFirstChild, aReflowState, availSize);
ReflowChild(mFirstChild, aPresContext, aDesiredSize, reflowState, aStatus);
nsIFrame* firstKid = mFrames.FirstChild();
nsHTMLReflowState reflowState(aPresContext, firstKid, aReflowState, availSize);
ReflowChild(firstKid, aPresContext, aDesiredSize, reflowState, aStatus);
// get border and padding
const nsStyleSpacing* spacing =
@@ -615,7 +618,7 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext,
// Place the child
nsRect rect = nsRect(borderPadding.left, borderPadding.top, aDesiredSize.width, aDesiredSize.height);
mFirstChild->SetRect(rect);
firstKid->SetRect(rect);
// add in our border and padding to the size of the child
aDesiredSize.width += borderPadding.left + borderPadding.right;