Fixed bug #3161 - removed bogus assertion

This commit is contained in:
kipp%netscape.com 1999-02-18 18:25:45 +00:00
Родитель 5d1d9c4e56
Коммит 44573facc6
6 изменённых файлов: 156 добавлений и 192 удалений

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

@ -1813,11 +1813,11 @@ nsBlockFrame::PullFrame(nsBlockReflowState& aState,
*/ */
nsresult nsresult
nsBlockFrame::PullFrame(nsBlockReflowState& aState, nsBlockFrame::PullFrame(nsBlockReflowState& aState,
nsLineBox* aLine, nsLineBox* aLine,
nsLineBox** aFromList, nsLineBox** aFromList,
PRBool aUpdateGeometricParent, PRBool aUpdateGeometricParent,
nsIFrame*& aFrameResult, nsIFrame*& aFrameResult,
PRBool& aStopPulling) PRBool& aStopPulling)
{ {
nsLineBox* fromLine = *aFromList; nsLineBox* fromLine = *aFromList;
NS_ASSERTION(nsnull != fromLine, "bad line to pull from"); NS_ASSERTION(nsnull != fromLine, "bad line to pull from");
@ -1881,8 +1881,8 @@ nsBlockFrame::PullFrame(nsBlockReflowState& aState,
void void
nsBlockFrame::DidReflowLine(nsBlockReflowState& aState, nsBlockFrame::DidReflowLine(nsBlockReflowState& aState,
nsLineBox* aLine, nsLineBox* aLine,
PRBool aLineReflowStatus) PRBool aLineReflowStatus)
{ {
// If the line no longer needs a floater array, get rid of it and // If the line no longer needs a floater array, get rid of it and
// save some memory // save some memory
@ -1900,8 +1900,8 @@ nsBlockFrame::DidReflowLine(nsBlockReflowState& aState,
void void
nsBlockFrame::SlideFrames(nsIPresContext& aPresContext, nsBlockFrame::SlideFrames(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager, nsISpaceManager* aSpaceManager,
nsLineBox* aLine, nscoord aDY) nsLineBox* aLine, nscoord aDY)
{ {
#if 0 #if 0
ListTag(stdout); printf(": SlideFrames: line=%p dy=%d\n", aDY); ListTag(stdout); printf(": SlideFrames: line=%p dy=%d\n", aDY);
@ -1932,9 +1932,9 @@ ListTag(stdout); printf(": SlideFrames: line=%p dy=%d\n", aDY);
void void
nsBlockFrame::SlideFloaters(nsIPresContext& aPresContext, nsBlockFrame::SlideFloaters(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager, nsISpaceManager* aSpaceManager,
nsLineBox* aLine, nscoord aDY, nsLineBox* aLine, nscoord aDY,
PRBool aUpdateSpaceManager) PRBool aUpdateSpaceManager)
{ {
nsVoidArray* floaters = aLine->mFloaters; nsVoidArray* floaters = aLine->mFloaters;
if (nsnull != floaters) { if (nsnull != floaters) {
@ -3426,11 +3426,11 @@ nsBlockFrame::RemoveFrame(nsIPresContext& aPresContext,
return rv; return rv;
} }
// XXX need code in here to join two inline lines together if a block // XXX simplify this by using RemoveChild and DeleteChildsNextInFlow
// is deleted between them.
nsresult nsresult
nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext, nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext,
nsIFrame* aDeletedFrame) nsIFrame* aDeletedFrame)
{ {
// Find the line and the previous sibling that contains // Find the line and the previous sibling that contains
// deletedFrame; we also find the pointer to the line. // deletedFrame; we also find the pointer to the line.
@ -3471,8 +3471,6 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext,
aDeletedFrame->GetParent(&parent); aDeletedFrame->GetParent(&parent);
NS_ASSERTION(flow == parent, "messed up delete code"); NS_ASSERTION(flow == parent, "messed up delete code");
#endif #endif
NS_FRAME_TRACE(NS_FRAME_TRACE_CHILD_REFLOW,
("nsBlockFrame::ContentDeleted: deadFrame=%p", aDeletedFrame));
// See if the frame is a floater (actually, the floaters // See if the frame is a floater (actually, the floaters
// placeholder). If it is, then destroy the floated frame too. // placeholder). If it is, then destroy the floated frame too.
@ -3504,12 +3502,13 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext,
// Remove aDeletedFrame from the line // Remove aDeletedFrame from the line
if (line->mFirstChild == aDeletedFrame) { if (line->mFirstChild == aDeletedFrame) {
line->mFirstChild = nextFrame; line->mFirstChild = nextFrame;
if (!line->IsBlock() && (nsnull != prevLine) && !prevLine->IsBlock()) { }
// Make sure the previous line (if it's an inline line) gets if (!line->IsBlock() && (nsnull != prevLine) && !prevLine->IsBlock()) {
// a reflow too so that it can pullup from the line where we // Make sure the previous line (if it's an inline line) gets
// just removed the frame. // a reflow too so that it can pullup from the line where we
prevLine->MarkDirty(); // just removed the frame.
} prevLine->MarkDirty();
// XXX Note: prevLine may be in a prev-in-flow
} }
// Take aDeletedFrame out of the sibling list. Note that // Take aDeletedFrame out of the sibling list. Note that
@ -3744,19 +3743,14 @@ nsBlockFrame::RemoveChild(nsLineBox* aLines, nsIFrame* aChild)
nsIFrame* nextChild; nsIFrame* nextChild;
child->GetNextSibling(&nextChild); child->GetNextSibling(&nextChild);
if (child == aChild) { if (child == aChild) {
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS, if (child == line->mFirstChild) {
("nsBlockFrame::RemoveChild: line=%p frame=%p", line->mFirstChild = nextChild;
line, aChild)); }
// Continuations HAVE to be at the start of a line
NS_ASSERTION(child == line->mFirstChild, "bad continuation");
line->mFirstChild = nextChild;
if (0 == --line->mChildCount) { if (0 == --line->mChildCount) {
line->mFirstChild = nsnull; line->mFirstChild = nsnull;
} }
if (nsnull != prevChild) { if (nsnull != prevChild) {
// When nextInFlow and it's continuation are in the same // Take child out of sibling list too
// container then we remove the nextInFlow from the sibling
// list.
prevChild->SetNextSibling(nextChild); prevChild->SetNextSibling(nextChild);
} }
return PR_TRUE; return PR_TRUE;

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

@ -1813,11 +1813,11 @@ nsBlockFrame::PullFrame(nsBlockReflowState& aState,
*/ */
nsresult nsresult
nsBlockFrame::PullFrame(nsBlockReflowState& aState, nsBlockFrame::PullFrame(nsBlockReflowState& aState,
nsLineBox* aLine, nsLineBox* aLine,
nsLineBox** aFromList, nsLineBox** aFromList,
PRBool aUpdateGeometricParent, PRBool aUpdateGeometricParent,
nsIFrame*& aFrameResult, nsIFrame*& aFrameResult,
PRBool& aStopPulling) PRBool& aStopPulling)
{ {
nsLineBox* fromLine = *aFromList; nsLineBox* fromLine = *aFromList;
NS_ASSERTION(nsnull != fromLine, "bad line to pull from"); NS_ASSERTION(nsnull != fromLine, "bad line to pull from");
@ -1881,8 +1881,8 @@ nsBlockFrame::PullFrame(nsBlockReflowState& aState,
void void
nsBlockFrame::DidReflowLine(nsBlockReflowState& aState, nsBlockFrame::DidReflowLine(nsBlockReflowState& aState,
nsLineBox* aLine, nsLineBox* aLine,
PRBool aLineReflowStatus) PRBool aLineReflowStatus)
{ {
// If the line no longer needs a floater array, get rid of it and // If the line no longer needs a floater array, get rid of it and
// save some memory // save some memory
@ -1900,8 +1900,8 @@ nsBlockFrame::DidReflowLine(nsBlockReflowState& aState,
void void
nsBlockFrame::SlideFrames(nsIPresContext& aPresContext, nsBlockFrame::SlideFrames(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager, nsISpaceManager* aSpaceManager,
nsLineBox* aLine, nscoord aDY) nsLineBox* aLine, nscoord aDY)
{ {
#if 0 #if 0
ListTag(stdout); printf(": SlideFrames: line=%p dy=%d\n", aDY); ListTag(stdout); printf(": SlideFrames: line=%p dy=%d\n", aDY);
@ -1932,9 +1932,9 @@ ListTag(stdout); printf(": SlideFrames: line=%p dy=%d\n", aDY);
void void
nsBlockFrame::SlideFloaters(nsIPresContext& aPresContext, nsBlockFrame::SlideFloaters(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager, nsISpaceManager* aSpaceManager,
nsLineBox* aLine, nscoord aDY, nsLineBox* aLine, nscoord aDY,
PRBool aUpdateSpaceManager) PRBool aUpdateSpaceManager)
{ {
nsVoidArray* floaters = aLine->mFloaters; nsVoidArray* floaters = aLine->mFloaters;
if (nsnull != floaters) { if (nsnull != floaters) {
@ -3426,11 +3426,11 @@ nsBlockFrame::RemoveFrame(nsIPresContext& aPresContext,
return rv; return rv;
} }
// XXX need code in here to join two inline lines together if a block // XXX simplify this by using RemoveChild and DeleteChildsNextInFlow
// is deleted between them.
nsresult nsresult
nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext, nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext,
nsIFrame* aDeletedFrame) nsIFrame* aDeletedFrame)
{ {
// Find the line and the previous sibling that contains // Find the line and the previous sibling that contains
// deletedFrame; we also find the pointer to the line. // deletedFrame; we also find the pointer to the line.
@ -3471,8 +3471,6 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext,
aDeletedFrame->GetParent(&parent); aDeletedFrame->GetParent(&parent);
NS_ASSERTION(flow == parent, "messed up delete code"); NS_ASSERTION(flow == parent, "messed up delete code");
#endif #endif
NS_FRAME_TRACE(NS_FRAME_TRACE_CHILD_REFLOW,
("nsBlockFrame::ContentDeleted: deadFrame=%p", aDeletedFrame));
// See if the frame is a floater (actually, the floaters // See if the frame is a floater (actually, the floaters
// placeholder). If it is, then destroy the floated frame too. // placeholder). If it is, then destroy the floated frame too.
@ -3504,12 +3502,13 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext,
// Remove aDeletedFrame from the line // Remove aDeletedFrame from the line
if (line->mFirstChild == aDeletedFrame) { if (line->mFirstChild == aDeletedFrame) {
line->mFirstChild = nextFrame; line->mFirstChild = nextFrame;
if (!line->IsBlock() && (nsnull != prevLine) && !prevLine->IsBlock()) { }
// Make sure the previous line (if it's an inline line) gets if (!line->IsBlock() && (nsnull != prevLine) && !prevLine->IsBlock()) {
// a reflow too so that it can pullup from the line where we // Make sure the previous line (if it's an inline line) gets
// just removed the frame. // a reflow too so that it can pullup from the line where we
prevLine->MarkDirty(); // just removed the frame.
} prevLine->MarkDirty();
// XXX Note: prevLine may be in a prev-in-flow
} }
// Take aDeletedFrame out of the sibling list. Note that // Take aDeletedFrame out of the sibling list. Note that
@ -3744,19 +3743,14 @@ nsBlockFrame::RemoveChild(nsLineBox* aLines, nsIFrame* aChild)
nsIFrame* nextChild; nsIFrame* nextChild;
child->GetNextSibling(&nextChild); child->GetNextSibling(&nextChild);
if (child == aChild) { if (child == aChild) {
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS, if (child == line->mFirstChild) {
("nsBlockFrame::RemoveChild: line=%p frame=%p", line->mFirstChild = nextChild;
line, aChild)); }
// Continuations HAVE to be at the start of a line
NS_ASSERTION(child == line->mFirstChild, "bad continuation");
line->mFirstChild = nextChild;
if (0 == --line->mChildCount) { if (0 == --line->mChildCount) {
line->mFirstChild = nsnull; line->mFirstChild = nsnull;
} }
if (nsnull != prevChild) { if (nsnull != prevChild) {
// When nextInFlow and it's continuation are in the same // Take child out of sibling list too
// container then we remove the nextInFlow from the sibling
// list.
prevChild->SetNextSibling(nextChild); prevChild->SetNextSibling(nextChild);
} }
return PR_TRUE; return PR_TRUE;

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

@ -1813,11 +1813,11 @@ nsBlockFrame::PullFrame(nsBlockReflowState& aState,
*/ */
nsresult nsresult
nsBlockFrame::PullFrame(nsBlockReflowState& aState, nsBlockFrame::PullFrame(nsBlockReflowState& aState,
nsLineBox* aLine, nsLineBox* aLine,
nsLineBox** aFromList, nsLineBox** aFromList,
PRBool aUpdateGeometricParent, PRBool aUpdateGeometricParent,
nsIFrame*& aFrameResult, nsIFrame*& aFrameResult,
PRBool& aStopPulling) PRBool& aStopPulling)
{ {
nsLineBox* fromLine = *aFromList; nsLineBox* fromLine = *aFromList;
NS_ASSERTION(nsnull != fromLine, "bad line to pull from"); NS_ASSERTION(nsnull != fromLine, "bad line to pull from");
@ -1881,8 +1881,8 @@ nsBlockFrame::PullFrame(nsBlockReflowState& aState,
void void
nsBlockFrame::DidReflowLine(nsBlockReflowState& aState, nsBlockFrame::DidReflowLine(nsBlockReflowState& aState,
nsLineBox* aLine, nsLineBox* aLine,
PRBool aLineReflowStatus) PRBool aLineReflowStatus)
{ {
// If the line no longer needs a floater array, get rid of it and // If the line no longer needs a floater array, get rid of it and
// save some memory // save some memory
@ -1900,8 +1900,8 @@ nsBlockFrame::DidReflowLine(nsBlockReflowState& aState,
void void
nsBlockFrame::SlideFrames(nsIPresContext& aPresContext, nsBlockFrame::SlideFrames(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager, nsISpaceManager* aSpaceManager,
nsLineBox* aLine, nscoord aDY) nsLineBox* aLine, nscoord aDY)
{ {
#if 0 #if 0
ListTag(stdout); printf(": SlideFrames: line=%p dy=%d\n", aDY); ListTag(stdout); printf(": SlideFrames: line=%p dy=%d\n", aDY);
@ -1932,9 +1932,9 @@ ListTag(stdout); printf(": SlideFrames: line=%p dy=%d\n", aDY);
void void
nsBlockFrame::SlideFloaters(nsIPresContext& aPresContext, nsBlockFrame::SlideFloaters(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager, nsISpaceManager* aSpaceManager,
nsLineBox* aLine, nscoord aDY, nsLineBox* aLine, nscoord aDY,
PRBool aUpdateSpaceManager) PRBool aUpdateSpaceManager)
{ {
nsVoidArray* floaters = aLine->mFloaters; nsVoidArray* floaters = aLine->mFloaters;
if (nsnull != floaters) { if (nsnull != floaters) {
@ -3426,11 +3426,11 @@ nsBlockFrame::RemoveFrame(nsIPresContext& aPresContext,
return rv; return rv;
} }
// XXX need code in here to join two inline lines together if a block // XXX simplify this by using RemoveChild and DeleteChildsNextInFlow
// is deleted between them.
nsresult nsresult
nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext, nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext,
nsIFrame* aDeletedFrame) nsIFrame* aDeletedFrame)
{ {
// Find the line and the previous sibling that contains // Find the line and the previous sibling that contains
// deletedFrame; we also find the pointer to the line. // deletedFrame; we also find the pointer to the line.
@ -3471,8 +3471,6 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext,
aDeletedFrame->GetParent(&parent); aDeletedFrame->GetParent(&parent);
NS_ASSERTION(flow == parent, "messed up delete code"); NS_ASSERTION(flow == parent, "messed up delete code");
#endif #endif
NS_FRAME_TRACE(NS_FRAME_TRACE_CHILD_REFLOW,
("nsBlockFrame::ContentDeleted: deadFrame=%p", aDeletedFrame));
// See if the frame is a floater (actually, the floaters // See if the frame is a floater (actually, the floaters
// placeholder). If it is, then destroy the floated frame too. // placeholder). If it is, then destroy the floated frame too.
@ -3504,12 +3502,13 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext,
// Remove aDeletedFrame from the line // Remove aDeletedFrame from the line
if (line->mFirstChild == aDeletedFrame) { if (line->mFirstChild == aDeletedFrame) {
line->mFirstChild = nextFrame; line->mFirstChild = nextFrame;
if (!line->IsBlock() && (nsnull != prevLine) && !prevLine->IsBlock()) { }
// Make sure the previous line (if it's an inline line) gets if (!line->IsBlock() && (nsnull != prevLine) && !prevLine->IsBlock()) {
// a reflow too so that it can pullup from the line where we // Make sure the previous line (if it's an inline line) gets
// just removed the frame. // a reflow too so that it can pullup from the line where we
prevLine->MarkDirty(); // just removed the frame.
} prevLine->MarkDirty();
// XXX Note: prevLine may be in a prev-in-flow
} }
// Take aDeletedFrame out of the sibling list. Note that // Take aDeletedFrame out of the sibling list. Note that
@ -3744,19 +3743,14 @@ nsBlockFrame::RemoveChild(nsLineBox* aLines, nsIFrame* aChild)
nsIFrame* nextChild; nsIFrame* nextChild;
child->GetNextSibling(&nextChild); child->GetNextSibling(&nextChild);
if (child == aChild) { if (child == aChild) {
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS, if (child == line->mFirstChild) {
("nsBlockFrame::RemoveChild: line=%p frame=%p", line->mFirstChild = nextChild;
line, aChild)); }
// Continuations HAVE to be at the start of a line
NS_ASSERTION(child == line->mFirstChild, "bad continuation");
line->mFirstChild = nextChild;
if (0 == --line->mChildCount) { if (0 == --line->mChildCount) {
line->mFirstChild = nsnull; line->mFirstChild = nsnull;
} }
if (nsnull != prevChild) { if (nsnull != prevChild) {
// When nextInFlow and it's continuation are in the same // Take child out of sibling list too
// container then we remove the nextInFlow from the sibling
// list.
prevChild->SetNextSibling(nextChild); prevChild->SetNextSibling(nextChild);
} }
return PR_TRUE; return PR_TRUE;

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

@ -1813,11 +1813,11 @@ nsBlockFrame::PullFrame(nsBlockReflowState& aState,
*/ */
nsresult nsresult
nsBlockFrame::PullFrame(nsBlockReflowState& aState, nsBlockFrame::PullFrame(nsBlockReflowState& aState,
nsLineBox* aLine, nsLineBox* aLine,
nsLineBox** aFromList, nsLineBox** aFromList,
PRBool aUpdateGeometricParent, PRBool aUpdateGeometricParent,
nsIFrame*& aFrameResult, nsIFrame*& aFrameResult,
PRBool& aStopPulling) PRBool& aStopPulling)
{ {
nsLineBox* fromLine = *aFromList; nsLineBox* fromLine = *aFromList;
NS_ASSERTION(nsnull != fromLine, "bad line to pull from"); NS_ASSERTION(nsnull != fromLine, "bad line to pull from");
@ -1881,8 +1881,8 @@ nsBlockFrame::PullFrame(nsBlockReflowState& aState,
void void
nsBlockFrame::DidReflowLine(nsBlockReflowState& aState, nsBlockFrame::DidReflowLine(nsBlockReflowState& aState,
nsLineBox* aLine, nsLineBox* aLine,
PRBool aLineReflowStatus) PRBool aLineReflowStatus)
{ {
// If the line no longer needs a floater array, get rid of it and // If the line no longer needs a floater array, get rid of it and
// save some memory // save some memory
@ -1900,8 +1900,8 @@ nsBlockFrame::DidReflowLine(nsBlockReflowState& aState,
void void
nsBlockFrame::SlideFrames(nsIPresContext& aPresContext, nsBlockFrame::SlideFrames(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager, nsISpaceManager* aSpaceManager,
nsLineBox* aLine, nscoord aDY) nsLineBox* aLine, nscoord aDY)
{ {
#if 0 #if 0
ListTag(stdout); printf(": SlideFrames: line=%p dy=%d\n", aDY); ListTag(stdout); printf(": SlideFrames: line=%p dy=%d\n", aDY);
@ -1932,9 +1932,9 @@ ListTag(stdout); printf(": SlideFrames: line=%p dy=%d\n", aDY);
void void
nsBlockFrame::SlideFloaters(nsIPresContext& aPresContext, nsBlockFrame::SlideFloaters(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager, nsISpaceManager* aSpaceManager,
nsLineBox* aLine, nscoord aDY, nsLineBox* aLine, nscoord aDY,
PRBool aUpdateSpaceManager) PRBool aUpdateSpaceManager)
{ {
nsVoidArray* floaters = aLine->mFloaters; nsVoidArray* floaters = aLine->mFloaters;
if (nsnull != floaters) { if (nsnull != floaters) {
@ -3426,11 +3426,11 @@ nsBlockFrame::RemoveFrame(nsIPresContext& aPresContext,
return rv; return rv;
} }
// XXX need code in here to join two inline lines together if a block // XXX simplify this by using RemoveChild and DeleteChildsNextInFlow
// is deleted between them.
nsresult nsresult
nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext, nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext,
nsIFrame* aDeletedFrame) nsIFrame* aDeletedFrame)
{ {
// Find the line and the previous sibling that contains // Find the line and the previous sibling that contains
// deletedFrame; we also find the pointer to the line. // deletedFrame; we also find the pointer to the line.
@ -3471,8 +3471,6 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext,
aDeletedFrame->GetParent(&parent); aDeletedFrame->GetParent(&parent);
NS_ASSERTION(flow == parent, "messed up delete code"); NS_ASSERTION(flow == parent, "messed up delete code");
#endif #endif
NS_FRAME_TRACE(NS_FRAME_TRACE_CHILD_REFLOW,
("nsBlockFrame::ContentDeleted: deadFrame=%p", aDeletedFrame));
// See if the frame is a floater (actually, the floaters // See if the frame is a floater (actually, the floaters
// placeholder). If it is, then destroy the floated frame too. // placeholder). If it is, then destroy the floated frame too.
@ -3504,12 +3502,13 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext,
// Remove aDeletedFrame from the line // Remove aDeletedFrame from the line
if (line->mFirstChild == aDeletedFrame) { if (line->mFirstChild == aDeletedFrame) {
line->mFirstChild = nextFrame; line->mFirstChild = nextFrame;
if (!line->IsBlock() && (nsnull != prevLine) && !prevLine->IsBlock()) { }
// Make sure the previous line (if it's an inline line) gets if (!line->IsBlock() && (nsnull != prevLine) && !prevLine->IsBlock()) {
// a reflow too so that it can pullup from the line where we // Make sure the previous line (if it's an inline line) gets
// just removed the frame. // a reflow too so that it can pullup from the line where we
prevLine->MarkDirty(); // just removed the frame.
} prevLine->MarkDirty();
// XXX Note: prevLine may be in a prev-in-flow
} }
// Take aDeletedFrame out of the sibling list. Note that // Take aDeletedFrame out of the sibling list. Note that
@ -3744,19 +3743,14 @@ nsBlockFrame::RemoveChild(nsLineBox* aLines, nsIFrame* aChild)
nsIFrame* nextChild; nsIFrame* nextChild;
child->GetNextSibling(&nextChild); child->GetNextSibling(&nextChild);
if (child == aChild) { if (child == aChild) {
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS, if (child == line->mFirstChild) {
("nsBlockFrame::RemoveChild: line=%p frame=%p", line->mFirstChild = nextChild;
line, aChild)); }
// Continuations HAVE to be at the start of a line
NS_ASSERTION(child == line->mFirstChild, "bad continuation");
line->mFirstChild = nextChild;
if (0 == --line->mChildCount) { if (0 == --line->mChildCount) {
line->mFirstChild = nsnull; line->mFirstChild = nsnull;
} }
if (nsnull != prevChild) { if (nsnull != prevChild) {
// When nextInFlow and it's continuation are in the same // Take child out of sibling list too
// container then we remove the nextInFlow from the sibling
// list.
prevChild->SetNextSibling(nextChild); prevChild->SetNextSibling(nextChild);
} }
return PR_TRUE; return PR_TRUE;

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

@ -1813,11 +1813,11 @@ nsBlockFrame::PullFrame(nsBlockReflowState& aState,
*/ */
nsresult nsresult
nsBlockFrame::PullFrame(nsBlockReflowState& aState, nsBlockFrame::PullFrame(nsBlockReflowState& aState,
nsLineBox* aLine, nsLineBox* aLine,
nsLineBox** aFromList, nsLineBox** aFromList,
PRBool aUpdateGeometricParent, PRBool aUpdateGeometricParent,
nsIFrame*& aFrameResult, nsIFrame*& aFrameResult,
PRBool& aStopPulling) PRBool& aStopPulling)
{ {
nsLineBox* fromLine = *aFromList; nsLineBox* fromLine = *aFromList;
NS_ASSERTION(nsnull != fromLine, "bad line to pull from"); NS_ASSERTION(nsnull != fromLine, "bad line to pull from");
@ -1881,8 +1881,8 @@ nsBlockFrame::PullFrame(nsBlockReflowState& aState,
void void
nsBlockFrame::DidReflowLine(nsBlockReflowState& aState, nsBlockFrame::DidReflowLine(nsBlockReflowState& aState,
nsLineBox* aLine, nsLineBox* aLine,
PRBool aLineReflowStatus) PRBool aLineReflowStatus)
{ {
// If the line no longer needs a floater array, get rid of it and // If the line no longer needs a floater array, get rid of it and
// save some memory // save some memory
@ -1900,8 +1900,8 @@ nsBlockFrame::DidReflowLine(nsBlockReflowState& aState,
void void
nsBlockFrame::SlideFrames(nsIPresContext& aPresContext, nsBlockFrame::SlideFrames(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager, nsISpaceManager* aSpaceManager,
nsLineBox* aLine, nscoord aDY) nsLineBox* aLine, nscoord aDY)
{ {
#if 0 #if 0
ListTag(stdout); printf(": SlideFrames: line=%p dy=%d\n", aDY); ListTag(stdout); printf(": SlideFrames: line=%p dy=%d\n", aDY);
@ -1932,9 +1932,9 @@ ListTag(stdout); printf(": SlideFrames: line=%p dy=%d\n", aDY);
void void
nsBlockFrame::SlideFloaters(nsIPresContext& aPresContext, nsBlockFrame::SlideFloaters(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager, nsISpaceManager* aSpaceManager,
nsLineBox* aLine, nscoord aDY, nsLineBox* aLine, nscoord aDY,
PRBool aUpdateSpaceManager) PRBool aUpdateSpaceManager)
{ {
nsVoidArray* floaters = aLine->mFloaters; nsVoidArray* floaters = aLine->mFloaters;
if (nsnull != floaters) { if (nsnull != floaters) {
@ -3426,11 +3426,11 @@ nsBlockFrame::RemoveFrame(nsIPresContext& aPresContext,
return rv; return rv;
} }
// XXX need code in here to join two inline lines together if a block // XXX simplify this by using RemoveChild and DeleteChildsNextInFlow
// is deleted between them.
nsresult nsresult
nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext, nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext,
nsIFrame* aDeletedFrame) nsIFrame* aDeletedFrame)
{ {
// Find the line and the previous sibling that contains // Find the line and the previous sibling that contains
// deletedFrame; we also find the pointer to the line. // deletedFrame; we also find the pointer to the line.
@ -3471,8 +3471,6 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext,
aDeletedFrame->GetParent(&parent); aDeletedFrame->GetParent(&parent);
NS_ASSERTION(flow == parent, "messed up delete code"); NS_ASSERTION(flow == parent, "messed up delete code");
#endif #endif
NS_FRAME_TRACE(NS_FRAME_TRACE_CHILD_REFLOW,
("nsBlockFrame::ContentDeleted: deadFrame=%p", aDeletedFrame));
// See if the frame is a floater (actually, the floaters // See if the frame is a floater (actually, the floaters
// placeholder). If it is, then destroy the floated frame too. // placeholder). If it is, then destroy the floated frame too.
@ -3504,12 +3502,13 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext,
// Remove aDeletedFrame from the line // Remove aDeletedFrame from the line
if (line->mFirstChild == aDeletedFrame) { if (line->mFirstChild == aDeletedFrame) {
line->mFirstChild = nextFrame; line->mFirstChild = nextFrame;
if (!line->IsBlock() && (nsnull != prevLine) && !prevLine->IsBlock()) { }
// Make sure the previous line (if it's an inline line) gets if (!line->IsBlock() && (nsnull != prevLine) && !prevLine->IsBlock()) {
// a reflow too so that it can pullup from the line where we // Make sure the previous line (if it's an inline line) gets
// just removed the frame. // a reflow too so that it can pullup from the line where we
prevLine->MarkDirty(); // just removed the frame.
} prevLine->MarkDirty();
// XXX Note: prevLine may be in a prev-in-flow
} }
// Take aDeletedFrame out of the sibling list. Note that // Take aDeletedFrame out of the sibling list. Note that
@ -3744,19 +3743,14 @@ nsBlockFrame::RemoveChild(nsLineBox* aLines, nsIFrame* aChild)
nsIFrame* nextChild; nsIFrame* nextChild;
child->GetNextSibling(&nextChild); child->GetNextSibling(&nextChild);
if (child == aChild) { if (child == aChild) {
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS, if (child == line->mFirstChild) {
("nsBlockFrame::RemoveChild: line=%p frame=%p", line->mFirstChild = nextChild;
line, aChild)); }
// Continuations HAVE to be at the start of a line
NS_ASSERTION(child == line->mFirstChild, "bad continuation");
line->mFirstChild = nextChild;
if (0 == --line->mChildCount) { if (0 == --line->mChildCount) {
line->mFirstChild = nsnull; line->mFirstChild = nsnull;
} }
if (nsnull != prevChild) { if (nsnull != prevChild) {
// When nextInFlow and it's continuation are in the same // Take child out of sibling list too
// container then we remove the nextInFlow from the sibling
// list.
prevChild->SetNextSibling(nextChild); prevChild->SetNextSibling(nextChild);
} }
return PR_TRUE; return PR_TRUE;

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

@ -1813,11 +1813,11 @@ nsBlockFrame::PullFrame(nsBlockReflowState& aState,
*/ */
nsresult nsresult
nsBlockFrame::PullFrame(nsBlockReflowState& aState, nsBlockFrame::PullFrame(nsBlockReflowState& aState,
nsLineBox* aLine, nsLineBox* aLine,
nsLineBox** aFromList, nsLineBox** aFromList,
PRBool aUpdateGeometricParent, PRBool aUpdateGeometricParent,
nsIFrame*& aFrameResult, nsIFrame*& aFrameResult,
PRBool& aStopPulling) PRBool& aStopPulling)
{ {
nsLineBox* fromLine = *aFromList; nsLineBox* fromLine = *aFromList;
NS_ASSERTION(nsnull != fromLine, "bad line to pull from"); NS_ASSERTION(nsnull != fromLine, "bad line to pull from");
@ -1881,8 +1881,8 @@ nsBlockFrame::PullFrame(nsBlockReflowState& aState,
void void
nsBlockFrame::DidReflowLine(nsBlockReflowState& aState, nsBlockFrame::DidReflowLine(nsBlockReflowState& aState,
nsLineBox* aLine, nsLineBox* aLine,
PRBool aLineReflowStatus) PRBool aLineReflowStatus)
{ {
// If the line no longer needs a floater array, get rid of it and // If the line no longer needs a floater array, get rid of it and
// save some memory // save some memory
@ -1900,8 +1900,8 @@ nsBlockFrame::DidReflowLine(nsBlockReflowState& aState,
void void
nsBlockFrame::SlideFrames(nsIPresContext& aPresContext, nsBlockFrame::SlideFrames(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager, nsISpaceManager* aSpaceManager,
nsLineBox* aLine, nscoord aDY) nsLineBox* aLine, nscoord aDY)
{ {
#if 0 #if 0
ListTag(stdout); printf(": SlideFrames: line=%p dy=%d\n", aDY); ListTag(stdout); printf(": SlideFrames: line=%p dy=%d\n", aDY);
@ -1932,9 +1932,9 @@ ListTag(stdout); printf(": SlideFrames: line=%p dy=%d\n", aDY);
void void
nsBlockFrame::SlideFloaters(nsIPresContext& aPresContext, nsBlockFrame::SlideFloaters(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager, nsISpaceManager* aSpaceManager,
nsLineBox* aLine, nscoord aDY, nsLineBox* aLine, nscoord aDY,
PRBool aUpdateSpaceManager) PRBool aUpdateSpaceManager)
{ {
nsVoidArray* floaters = aLine->mFloaters; nsVoidArray* floaters = aLine->mFloaters;
if (nsnull != floaters) { if (nsnull != floaters) {
@ -3426,11 +3426,11 @@ nsBlockFrame::RemoveFrame(nsIPresContext& aPresContext,
return rv; return rv;
} }
// XXX need code in here to join two inline lines together if a block // XXX simplify this by using RemoveChild and DeleteChildsNextInFlow
// is deleted between them.
nsresult nsresult
nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext, nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext,
nsIFrame* aDeletedFrame) nsIFrame* aDeletedFrame)
{ {
// Find the line and the previous sibling that contains // Find the line and the previous sibling that contains
// deletedFrame; we also find the pointer to the line. // deletedFrame; we also find the pointer to the line.
@ -3471,8 +3471,6 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext,
aDeletedFrame->GetParent(&parent); aDeletedFrame->GetParent(&parent);
NS_ASSERTION(flow == parent, "messed up delete code"); NS_ASSERTION(flow == parent, "messed up delete code");
#endif #endif
NS_FRAME_TRACE(NS_FRAME_TRACE_CHILD_REFLOW,
("nsBlockFrame::ContentDeleted: deadFrame=%p", aDeletedFrame));
// See if the frame is a floater (actually, the floaters // See if the frame is a floater (actually, the floaters
// placeholder). If it is, then destroy the floated frame too. // placeholder). If it is, then destroy the floated frame too.
@ -3504,12 +3502,13 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext& aPresContext,
// Remove aDeletedFrame from the line // Remove aDeletedFrame from the line
if (line->mFirstChild == aDeletedFrame) { if (line->mFirstChild == aDeletedFrame) {
line->mFirstChild = nextFrame; line->mFirstChild = nextFrame;
if (!line->IsBlock() && (nsnull != prevLine) && !prevLine->IsBlock()) { }
// Make sure the previous line (if it's an inline line) gets if (!line->IsBlock() && (nsnull != prevLine) && !prevLine->IsBlock()) {
// a reflow too so that it can pullup from the line where we // Make sure the previous line (if it's an inline line) gets
// just removed the frame. // a reflow too so that it can pullup from the line where we
prevLine->MarkDirty(); // just removed the frame.
} prevLine->MarkDirty();
// XXX Note: prevLine may be in a prev-in-flow
} }
// Take aDeletedFrame out of the sibling list. Note that // Take aDeletedFrame out of the sibling list. Note that
@ -3744,19 +3743,14 @@ nsBlockFrame::RemoveChild(nsLineBox* aLines, nsIFrame* aChild)
nsIFrame* nextChild; nsIFrame* nextChild;
child->GetNextSibling(&nextChild); child->GetNextSibling(&nextChild);
if (child == aChild) { if (child == aChild) {
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS, if (child == line->mFirstChild) {
("nsBlockFrame::RemoveChild: line=%p frame=%p", line->mFirstChild = nextChild;
line, aChild)); }
// Continuations HAVE to be at the start of a line
NS_ASSERTION(child == line->mFirstChild, "bad continuation");
line->mFirstChild = nextChild;
if (0 == --line->mChildCount) { if (0 == --line->mChildCount) {
line->mFirstChild = nsnull; line->mFirstChild = nsnull;
} }
if (nsnull != prevChild) { if (nsnull != prevChild) {
// When nextInFlow and it's continuation are in the same // Take child out of sibling list too
// container then we remove the nextInFlow from the sibling
// list.
prevChild->SetNextSibling(nextChild); prevChild->SetNextSibling(nextChild);
} }
return PR_TRUE; return PR_TRUE;