mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 16:22:00 +00:00
Removed some code from nsContainerFrame that is no longer needed now that'
we have nsFrameList
This commit is contained in:
parent
5efdaa4c0c
commit
03e8dd2540
@ -432,7 +432,7 @@ void
|
||||
nsContainerFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext,
|
||||
nsIFrame* aChild)
|
||||
{
|
||||
NS_PRECONDITION(IsChild(aChild), "bad geometric parent");
|
||||
NS_PRECONDITION(mFrames.ContainsFrame(aChild), "bad geometric parent");
|
||||
|
||||
nsIFrame* nextInFlow;
|
||||
nsContainerFrame* parent;
|
||||
@ -570,14 +570,6 @@ nsContainerFrame::AddFrame(const nsHTMLReflowState& aReflowState,
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsContainerFrame::RemoveAFrame(nsIFrame* aRemovedFrame)
|
||||
{
|
||||
PRBool zap = mFrames.RemoveFrame(aRemovedFrame);
|
||||
NS_ASSERTION(zap, "failure to remove a frame");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Debugging
|
||||
|
||||
|
@ -59,13 +59,6 @@ public:
|
||||
return tmp.GetLength();
|
||||
}
|
||||
|
||||
#if XXX
|
||||
static nsIFrame* FrameAt(nsIFrame* aFrameList, PRInt32 aIndex) {
|
||||
nsFrameList tmp(aFrameList);
|
||||
return tmp.FrameAt(aIndex);
|
||||
}
|
||||
#endif
|
||||
|
||||
protected:
|
||||
nsContainerFrame();
|
||||
~nsContainerFrame();
|
||||
@ -124,32 +117,11 @@ protected:
|
||||
*/
|
||||
void PushChildren(nsIFrame* aFromChild, nsIFrame* aPrevSibling);
|
||||
|
||||
/**
|
||||
* Append child list starting at aChild to this frame's child list.
|
||||
*
|
||||
* @param aChild the beginning of the child list
|
||||
* @param aSetParent if true each child's parent is set to this frame.
|
||||
*/
|
||||
void AppendChildren(nsIFrame* aChild, PRBool aSetParent) {
|
||||
mFrames.AppendFrames(aSetParent ? this : nsnull, aChild);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
nsresult AddFrame(const nsHTMLReflowState& aReflowState,
|
||||
nsIFrame * aAddedFrame);
|
||||
|
||||
/**
|
||||
*/
|
||||
nsresult RemoveAFrame(nsIFrame* aRemovedFrame);
|
||||
|
||||
/**
|
||||
* Returns PR_TRUE if aChild is a child of this frame.
|
||||
*/
|
||||
PRBool IsChild(const nsIFrame* aChild) const {
|
||||
return mFrames.ContainsFrame(aChild);
|
||||
}
|
||||
|
||||
nsFrameList mFrames;
|
||||
nsFrameList mOverflowFrames;
|
||||
};
|
||||
|
@ -432,7 +432,7 @@ void
|
||||
nsContainerFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext,
|
||||
nsIFrame* aChild)
|
||||
{
|
||||
NS_PRECONDITION(IsChild(aChild), "bad geometric parent");
|
||||
NS_PRECONDITION(mFrames.ContainsFrame(aChild), "bad geometric parent");
|
||||
|
||||
nsIFrame* nextInFlow;
|
||||
nsContainerFrame* parent;
|
||||
@ -570,14 +570,6 @@ nsContainerFrame::AddFrame(const nsHTMLReflowState& aReflowState,
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsContainerFrame::RemoveAFrame(nsIFrame* aRemovedFrame)
|
||||
{
|
||||
PRBool zap = mFrames.RemoveFrame(aRemovedFrame);
|
||||
NS_ASSERTION(zap, "failure to remove a frame");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Debugging
|
||||
|
||||
|
@ -59,13 +59,6 @@ public:
|
||||
return tmp.GetLength();
|
||||
}
|
||||
|
||||
#if XXX
|
||||
static nsIFrame* FrameAt(nsIFrame* aFrameList, PRInt32 aIndex) {
|
||||
nsFrameList tmp(aFrameList);
|
||||
return tmp.FrameAt(aIndex);
|
||||
}
|
||||
#endif
|
||||
|
||||
protected:
|
||||
nsContainerFrame();
|
||||
~nsContainerFrame();
|
||||
@ -124,32 +117,11 @@ protected:
|
||||
*/
|
||||
void PushChildren(nsIFrame* aFromChild, nsIFrame* aPrevSibling);
|
||||
|
||||
/**
|
||||
* Append child list starting at aChild to this frame's child list.
|
||||
*
|
||||
* @param aChild the beginning of the child list
|
||||
* @param aSetParent if true each child's parent is set to this frame.
|
||||
*/
|
||||
void AppendChildren(nsIFrame* aChild, PRBool aSetParent) {
|
||||
mFrames.AppendFrames(aSetParent ? this : nsnull, aChild);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
nsresult AddFrame(const nsHTMLReflowState& aReflowState,
|
||||
nsIFrame * aAddedFrame);
|
||||
|
||||
/**
|
||||
*/
|
||||
nsresult RemoveAFrame(nsIFrame* aRemovedFrame);
|
||||
|
||||
/**
|
||||
* Returns PR_TRUE if aChild is a child of this frame.
|
||||
*/
|
||||
PRBool IsChild(const nsIFrame* aChild) const {
|
||||
return mFrames.ContainsFrame(aChild);
|
||||
}
|
||||
|
||||
nsFrameList mFrames;
|
||||
nsFrameList mOverflowFrames;
|
||||
};
|
||||
|
@ -288,7 +288,7 @@ NS_METHOD nsTableColGroupFrame::IR_TargetIsMe(nsIPresContext& aPresCont
|
||||
else
|
||||
{
|
||||
|
||||
rv = RemoveAFrame(objectFrame);
|
||||
rv = mFrames.RemoveFrame(objectFrame);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -3163,7 +3163,7 @@ NS_METHOD nsTableFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
|
||||
}
|
||||
else
|
||||
{
|
||||
rv = RemoveAFrame(objectFrame);
|
||||
rv = mFrames.RemoveFrame(objectFrame);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -3453,7 +3453,7 @@ NS_METHOD nsTableFrame::IR_RowGroupRemoved(nsIPresContext& aPresContext,
|
||||
nsTableRowGroupFrame * aDeletedFrame)
|
||||
{
|
||||
if (PR_TRUE==gsDebugIR) printf("TIF IR: IR_RowGroupRemoved for frame %p\n", aDeletedFrame);
|
||||
nsresult rv = RemoveAFrame(aDeletedFrame);
|
||||
nsresult rv = mFrames.RemoveFrame(aDeletedFrame);
|
||||
InvalidateCellMap();
|
||||
InvalidateColumnCache();
|
||||
|
||||
@ -3784,10 +3784,8 @@ NS_METHOD nsTableFrame::PullUpChildren(nsIPresContext& aPresContext,
|
||||
if (nsnull == kidFrame) {
|
||||
// No. Any frames on its overflow list?
|
||||
if (nextInFlow->mOverflowFrames.NotEmpty()) {
|
||||
// XXX use nsFrameList::Join
|
||||
// Move the overflow list to become the child list
|
||||
nextInFlow->AppendChildren(nextInFlow->mOverflowFrames.FirstChild(), PR_TRUE);
|
||||
nextInFlow->mOverflowFrames.SetFrames(nsnull);
|
||||
nextInFlow->mFrames.AppendFrames(nsnull, nextInFlow->mOverflowFrames);
|
||||
kidFrame = nextInFlow->mFrames.FirstChild();
|
||||
} else {
|
||||
// We've pulled up all the children, so move to the next-in-flow.
|
||||
|
@ -1154,7 +1154,7 @@ NS_METHOD nsTableOuterFrame::VerifyTree() const
|
||||
void nsTableOuterFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext,
|
||||
nsIFrame* aChild)
|
||||
{
|
||||
NS_PRECONDITION(IsChild(aChild), "bad geometric parent");
|
||||
NS_PRECONDITION(mFrames.ContainsFrame(aChild), "bad geometric parent");
|
||||
|
||||
nsIFrame* nextInFlow;
|
||||
|
||||
@ -1191,7 +1191,6 @@ void nsTableOuterFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext,
|
||||
// to capture the next-in-flow's next sibling (in case the
|
||||
// next-in-flow is the last next-in-flow for aChild AND the
|
||||
// next-in-flow is not the last child in parent)
|
||||
NS_ASSERTION(parent->IsChild(aChild), "screwy flow");
|
||||
aChild->GetNextSibling(&nextSibling);
|
||||
NS_ASSERTION(nextSibling == nextInFlow, "unexpected sibling");
|
||||
|
||||
|
@ -1044,7 +1044,7 @@ NS_METHOD nsTableRowFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
|
||||
}
|
||||
else
|
||||
{
|
||||
rv = RemoveAFrame(objectFrame);
|
||||
rv = mFrames.RemoveFrame(objectFrame);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1198,7 +1198,7 @@ NS_METHOD nsTableRowFrame::IR_CellRemoved(nsIPresContext& aPresContext,
|
||||
nsTableCellFrame * aDeletedFrame)
|
||||
{
|
||||
if (PR_TRUE==gsDebugIR) printf("\nRow IR: IR_RowRemoved\n");
|
||||
nsresult rv = RemoveAFrame((nsIFrame*)aDeletedFrame);
|
||||
nsresult rv = mFrames.RemoveFrame((nsIFrame*)aDeletedFrame);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
ResetMaxChildHeight();
|
||||
|
@ -1109,7 +1109,7 @@ NS_METHOD nsTableRowGroupFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
|
||||
}
|
||||
else
|
||||
{
|
||||
rv = RemoveAFrame(objectFrame);
|
||||
rv = mFrames.RemoveFrame(objectFrame);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1278,7 +1278,7 @@ NS_METHOD nsTableRowGroupFrame::IR_RowRemoved(nsIPresContext& aPresContext,
|
||||
nsTableRowFrame * aDeletedFrame)
|
||||
{
|
||||
if (PR_TRUE==gsDebugIR) printf("\nTRGF IR: IR_RowRemoved\n");
|
||||
nsresult rv = RemoveAFrame((nsIFrame *)aDeletedFrame);
|
||||
nsresult rv = mFrames.RemoveFrame((nsIFrame *)aDeletedFrame);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
aReflowState.tableFrame->InvalidateCellMap();
|
||||
|
@ -288,7 +288,7 @@ NS_METHOD nsTableColGroupFrame::IR_TargetIsMe(nsIPresContext& aPresCont
|
||||
else
|
||||
{
|
||||
|
||||
rv = RemoveAFrame(objectFrame);
|
||||
rv = mFrames.RemoveFrame(objectFrame);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -3163,7 +3163,7 @@ NS_METHOD nsTableFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
|
||||
}
|
||||
else
|
||||
{
|
||||
rv = RemoveAFrame(objectFrame);
|
||||
rv = mFrames.RemoveFrame(objectFrame);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -3453,7 +3453,7 @@ NS_METHOD nsTableFrame::IR_RowGroupRemoved(nsIPresContext& aPresContext,
|
||||
nsTableRowGroupFrame * aDeletedFrame)
|
||||
{
|
||||
if (PR_TRUE==gsDebugIR) printf("TIF IR: IR_RowGroupRemoved for frame %p\n", aDeletedFrame);
|
||||
nsresult rv = RemoveAFrame(aDeletedFrame);
|
||||
nsresult rv = mFrames.RemoveFrame(aDeletedFrame);
|
||||
InvalidateCellMap();
|
||||
InvalidateColumnCache();
|
||||
|
||||
@ -3784,10 +3784,8 @@ NS_METHOD nsTableFrame::PullUpChildren(nsIPresContext& aPresContext,
|
||||
if (nsnull == kidFrame) {
|
||||
// No. Any frames on its overflow list?
|
||||
if (nextInFlow->mOverflowFrames.NotEmpty()) {
|
||||
// XXX use nsFrameList::Join
|
||||
// Move the overflow list to become the child list
|
||||
nextInFlow->AppendChildren(nextInFlow->mOverflowFrames.FirstChild(), PR_TRUE);
|
||||
nextInFlow->mOverflowFrames.SetFrames(nsnull);
|
||||
nextInFlow->mFrames.AppendFrames(nsnull, nextInFlow->mOverflowFrames);
|
||||
kidFrame = nextInFlow->mFrames.FirstChild();
|
||||
} else {
|
||||
// We've pulled up all the children, so move to the next-in-flow.
|
||||
|
@ -1154,7 +1154,7 @@ NS_METHOD nsTableOuterFrame::VerifyTree() const
|
||||
void nsTableOuterFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext,
|
||||
nsIFrame* aChild)
|
||||
{
|
||||
NS_PRECONDITION(IsChild(aChild), "bad geometric parent");
|
||||
NS_PRECONDITION(mFrames.ContainsFrame(aChild), "bad geometric parent");
|
||||
|
||||
nsIFrame* nextInFlow;
|
||||
|
||||
@ -1191,7 +1191,6 @@ void nsTableOuterFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext,
|
||||
// to capture the next-in-flow's next sibling (in case the
|
||||
// next-in-flow is the last next-in-flow for aChild AND the
|
||||
// next-in-flow is not the last child in parent)
|
||||
NS_ASSERTION(parent->IsChild(aChild), "screwy flow");
|
||||
aChild->GetNextSibling(&nextSibling);
|
||||
NS_ASSERTION(nextSibling == nextInFlow, "unexpected sibling");
|
||||
|
||||
|
@ -1044,7 +1044,7 @@ NS_METHOD nsTableRowFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
|
||||
}
|
||||
else
|
||||
{
|
||||
rv = RemoveAFrame(objectFrame);
|
||||
rv = mFrames.RemoveFrame(objectFrame);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1198,7 +1198,7 @@ NS_METHOD nsTableRowFrame::IR_CellRemoved(nsIPresContext& aPresContext,
|
||||
nsTableCellFrame * aDeletedFrame)
|
||||
{
|
||||
if (PR_TRUE==gsDebugIR) printf("\nRow IR: IR_RowRemoved\n");
|
||||
nsresult rv = RemoveAFrame((nsIFrame*)aDeletedFrame);
|
||||
nsresult rv = mFrames.RemoveFrame((nsIFrame*)aDeletedFrame);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
ResetMaxChildHeight();
|
||||
|
@ -1109,7 +1109,7 @@ NS_METHOD nsTableRowGroupFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
|
||||
}
|
||||
else
|
||||
{
|
||||
rv = RemoveAFrame(objectFrame);
|
||||
rv = mFrames.RemoveFrame(objectFrame);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1278,7 +1278,7 @@ NS_METHOD nsTableRowGroupFrame::IR_RowRemoved(nsIPresContext& aPresContext,
|
||||
nsTableRowFrame * aDeletedFrame)
|
||||
{
|
||||
if (PR_TRUE==gsDebugIR) printf("\nTRGF IR: IR_RowRemoved\n");
|
||||
nsresult rv = RemoveAFrame((nsIFrame *)aDeletedFrame);
|
||||
nsresult rv = mFrames.RemoveFrame((nsIFrame *)aDeletedFrame);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
aReflowState.tableFrame->InvalidateCellMap();
|
||||
|
Loading…
Reference in New Issue
Block a user