Bug 193686. nsContainerFrame needs to report the overflowList as one of its child frame lists. Also, overflow frames should be destroyed when their parent is destroyed. r+sr=dbaron

git-svn-id: svn://10.0.0.236/trunk@143163 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
roc+%cs.cmu.edu 2003-06-02 04:03:07 +00:00
parent d2207213cf
commit 360ffeb90a
6 changed files with 58 additions and 0 deletions

View File

@ -328,6 +328,12 @@ nsBlockFrame::Destroy(nsIPresContext* aPresContext)
nsLineBox::DeleteLineList(aPresContext, mLines);
// destroy overflow lines now
nsLineList* overflowLines = GetOverflowLines(aPresContext, PR_TRUE);
if (overflowLines) {
nsLineBox::DeleteLineList(aPresContext, *overflowLines);
}
return nsBlockFrameSuper::Destroy(aPresContext);
}

View File

@ -138,6 +138,10 @@ nsContainerFrame::Destroy(nsIPresContext* aPresContext)
// Delete the primary child list
mFrames.DestroyFrames(aPresContext);
// Destroy overflow frames now
nsFrameList overflowFrames(GetOverflowFrames(aPresContext, PR_TRUE));
overflowFrames.DestroyFrames(aPresContext);
// Destroy the frame and remove the flow pointers
return nsSplittableFrame::Destroy(aPresContext);
@ -166,6 +170,23 @@ nsContainerFrame::FirstChild(nsIPresContext* aPresContext,
}
}
NS_IMETHODIMP
nsContainerFrame::GetAdditionalChildListName(PRInt32 aIndex,
nsIAtom** aListName) const
{
NS_PRECONDITION(nsnull != aListName, "null OUT parameter pointer");
if (aIndex < 0) {
return NS_ERROR_INVALID_ARG;
}
if (aIndex == 0) {
*aListName = nsLayoutAtoms::overflowList;
NS_ADDREF(*aListName);
} else {
*aListName = nsnull;
}
return NS_OK;
}
/////////////////////////////////////////////////////////////////////////////
// Painting/Events

View File

@ -65,6 +65,8 @@ public:
NS_IMETHOD FirstChild(nsIPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame** aFirstChild) const;
NS_IMETHOD GetAdditionalChildListName(PRInt32 aIndex,
nsIAtom** aListName) const;
NS_IMETHOD Destroy(nsIPresContext* aPresContext);
NS_IMETHOD Paint(nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,

View File

@ -328,6 +328,12 @@ nsBlockFrame::Destroy(nsIPresContext* aPresContext)
nsLineBox::DeleteLineList(aPresContext, mLines);
// destroy overflow lines now
nsLineList* overflowLines = GetOverflowLines(aPresContext, PR_TRUE);
if (overflowLines) {
nsLineBox::DeleteLineList(aPresContext, *overflowLines);
}
return nsBlockFrameSuper::Destroy(aPresContext);
}

View File

@ -138,6 +138,10 @@ nsContainerFrame::Destroy(nsIPresContext* aPresContext)
// Delete the primary child list
mFrames.DestroyFrames(aPresContext);
// Destroy overflow frames now
nsFrameList overflowFrames(GetOverflowFrames(aPresContext, PR_TRUE));
overflowFrames.DestroyFrames(aPresContext);
// Destroy the frame and remove the flow pointers
return nsSplittableFrame::Destroy(aPresContext);
@ -166,6 +170,23 @@ nsContainerFrame::FirstChild(nsIPresContext* aPresContext,
}
}
NS_IMETHODIMP
nsContainerFrame::GetAdditionalChildListName(PRInt32 aIndex,
nsIAtom** aListName) const
{
NS_PRECONDITION(nsnull != aListName, "null OUT parameter pointer");
if (aIndex < 0) {
return NS_ERROR_INVALID_ARG;
}
if (aIndex == 0) {
*aListName = nsLayoutAtoms::overflowList;
NS_ADDREF(*aListName);
} else {
*aListName = nsnull;
}
return NS_OK;
}
/////////////////////////////////////////////////////////////////////////////
// Painting/Events

View File

@ -65,6 +65,8 @@ public:
NS_IMETHOD FirstChild(nsIPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame** aFirstChild) const;
NS_IMETHOD GetAdditionalChildListName(PRInt32 aIndex,
nsIAtom** aListName) const;
NS_IMETHOD Destroy(nsIPresContext* aPresContext);
NS_IMETHOD Paint(nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,