Clean up nsBlockFrame::RemoveFrame and add assertion to nsFrameList. b=114222 r=waterson sr=kin

This commit is contained in:
dbaron%fas.harvard.edu 2002-01-06 18:17:41 +00:00
parent a293c9dc19
commit b864327c87
4 changed files with 20 additions and 20 deletions

View File

@ -186,6 +186,7 @@ nsFrameList::RemoveFrame(nsIFrame* aFrame)
}
else {
nsIFrame* prevSibling = GetPrevSiblingFor(aFrame);
NS_ASSERTION(prevSibling, "removing frame not in list");
if (nsnull != prevSibling) {
prevSibling->SetNextSibling(nextFrame);
return PR_TRUE;

View File

@ -4841,8 +4841,12 @@ nsBlockFrame::RemoveFrame(nsIPresContext* aPresContext,
printf("\n");
#endif
if (nsLayoutAtoms::absoluteList == aListName) {
return mAbsoluteContainer.RemoveFrame(this, aPresContext, aPresShell, aListName, aOldFrame);
if (nsnull == aListName) {
rv = DoRemoveFrame(aPresContext, aOldFrame);
}
else if (nsLayoutAtoms::absoluteList == aListName) {
return mAbsoluteContainer.RemoveFrame(this, aPresContext, aPresShell,
aListName, aOldFrame);
}
else if (nsLayoutAtoms::floaterList == aListName) {
// Find which line contains the floater
@ -4863,19 +4867,14 @@ nsBlockFrame::RemoveFrame(nsIPresContext* aPresContext,
}
#ifdef IBMBIDI
else if (nsLayoutAtoms::nextBidi == aListName) {
rv = DoRemoveFrame(aPresContext, aOldFrame);
// Skip the call to |ReflowDirtyChild| below by returning now.
return DoRemoveFrame(aPresContext, aOldFrame);
}
#endif // IBMBIDI
else if (nsnull != aListName) {
else {
rv = NS_ERROR_INVALID_ARG;
}
else {
rv = DoRemoveFrame(aPresContext, aOldFrame);
}
#ifdef IBMBIDI
if (nsLayoutAtoms::nextBidi != aListName)
#endif // IBMBIDI
if (NS_SUCCEEDED(rv)) {
// Ask the parent frame to reflow me.
ReflowDirtyChild(&aPresShell, nsnull);

View File

@ -186,6 +186,7 @@ nsFrameList::RemoveFrame(nsIFrame* aFrame)
}
else {
nsIFrame* prevSibling = GetPrevSiblingFor(aFrame);
NS_ASSERTION(prevSibling, "removing frame not in list");
if (nsnull != prevSibling) {
prevSibling->SetNextSibling(nextFrame);
return PR_TRUE;

View File

@ -4841,8 +4841,12 @@ nsBlockFrame::RemoveFrame(nsIPresContext* aPresContext,
printf("\n");
#endif
if (nsLayoutAtoms::absoluteList == aListName) {
return mAbsoluteContainer.RemoveFrame(this, aPresContext, aPresShell, aListName, aOldFrame);
if (nsnull == aListName) {
rv = DoRemoveFrame(aPresContext, aOldFrame);
}
else if (nsLayoutAtoms::absoluteList == aListName) {
return mAbsoluteContainer.RemoveFrame(this, aPresContext, aPresShell,
aListName, aOldFrame);
}
else if (nsLayoutAtoms::floaterList == aListName) {
// Find which line contains the floater
@ -4863,19 +4867,14 @@ nsBlockFrame::RemoveFrame(nsIPresContext* aPresContext,
}
#ifdef IBMBIDI
else if (nsLayoutAtoms::nextBidi == aListName) {
rv = DoRemoveFrame(aPresContext, aOldFrame);
// Skip the call to |ReflowDirtyChild| below by returning now.
return DoRemoveFrame(aPresContext, aOldFrame);
}
#endif // IBMBIDI
else if (nsnull != aListName) {
else {
rv = NS_ERROR_INVALID_ARG;
}
else {
rv = DoRemoveFrame(aPresContext, aOldFrame);
}
#ifdef IBMBIDI
if (nsLayoutAtoms::nextBidi != aListName)
#endif // IBMBIDI
if (NS_SUCCEEDED(rv)) {
// Ask the parent frame to reflow me.
ReflowDirtyChild(&aPresShell, nsnull);