Removed bogus assert that was tripping on spacer-frames; fixed up justification behavior (thanks harish!)

This commit is contained in:
kipp%netscape.com 1998-12-11 15:49:07 +00:00
Родитель 7b64b1cac4
Коммит 6234eb38c7
6 изменённых файлов: 126 добавлений и 54 удалений

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

@ -309,15 +309,19 @@ nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
mBlock->ListTag(stdout); mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height); maxSize.width, maxSize.height);
maxSize.width = NS_UNCONSTRAINEDSIZE; if (maxSize.width > 100000) {
mUnconstrainedWidth = PR_TRUE; maxSize.width = NS_UNCONSTRAINEDSIZE;
mUnconstrainedWidth = PR_TRUE;
}
} }
if (!mUnconstrainedHeight && (maxSize.height > 100000)) { if (!mUnconstrainedHeight && (maxSize.height > 100000)) {
mBlock->ListTag(stdout); mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height); maxSize.width, maxSize.height);
maxSize.height = NS_UNCONSTRAINEDSIZE; if (maxSize.height > 100000) {
mUnconstrainedHeight = PR_TRUE; maxSize.height = NS_UNCONSTRAINEDSIZE;
mUnconstrainedHeight = PR_TRUE;
}
} }
#endif #endif
@ -2206,8 +2210,7 @@ nsBaseIBFrame::ReflowBlockFrame(nsBlockReflowState& aState,
aState.mReflowStatus = NS_FRAME_NOT_COMPLETE; aState.mReflowStatus = NS_FRAME_NOT_COMPLETE;
} }
else { else {
// XXX there is no break-after support here yet // Note: line-break-after a block is a nop
NS_ASSERTION(!NS_INLINE_IS_BREAK_AFTER(frameReflowStatus), "not yet implemented");
// Try to place the child block // Try to place the child block
PRBool isAdjacentWithTop = aState.IsAdjacentWithTop(); PRBool isAdjacentWithTop = aState.IsAdjacentWithTop();
@ -2605,15 +2608,15 @@ nsBaseIBFrame::ShouldJustifyLine(nsBlockReflowState& aState, nsLineBox* aLine)
nsLineBox* line = nextInFlow->mLines; nsLineBox* line = nextInFlow->mLines;
while (nsnull != line) { while (nsnull != line) {
if (0 != line->ChildCount()) { if (0 != line->ChildCount()) {
return PR_FALSE; return !line->IsBlock();
} }
line = line->mNext; line = line->mNext;
} }
nextInFlow = (nsBaseIBFrame*) nextInFlow->mNextInFlow; nextInFlow = (nsBaseIBFrame*) nextInFlow->mNextInFlow;
} }
// This is the last line // This is the last line - so don't allow justification
return PR_TRUE; return PR_FALSE;
} }
nsresult nsresult
@ -4515,6 +4518,15 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
mState &= ~NS_FRAME_OUTSIDE_CHILDREN; mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
} }
} }
#if 0
if (nsnull != aMetrics.maxElementSize) {
ListTag(stdout); printf(": maxElementSize=%d,%d\n",
*aMetrics.maxElementSize);
if (aMetrics.maxElementSize->width > 15000) {
printf("YIKES!\n");
}
}
#endif
} }
void void

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

@ -309,15 +309,19 @@ nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
mBlock->ListTag(stdout); mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height); maxSize.width, maxSize.height);
maxSize.width = NS_UNCONSTRAINEDSIZE; if (maxSize.width > 100000) {
mUnconstrainedWidth = PR_TRUE; maxSize.width = NS_UNCONSTRAINEDSIZE;
mUnconstrainedWidth = PR_TRUE;
}
} }
if (!mUnconstrainedHeight && (maxSize.height > 100000)) { if (!mUnconstrainedHeight && (maxSize.height > 100000)) {
mBlock->ListTag(stdout); mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height); maxSize.width, maxSize.height);
maxSize.height = NS_UNCONSTRAINEDSIZE; if (maxSize.height > 100000) {
mUnconstrainedHeight = PR_TRUE; maxSize.height = NS_UNCONSTRAINEDSIZE;
mUnconstrainedHeight = PR_TRUE;
}
} }
#endif #endif
@ -2206,8 +2210,7 @@ nsBaseIBFrame::ReflowBlockFrame(nsBlockReflowState& aState,
aState.mReflowStatus = NS_FRAME_NOT_COMPLETE; aState.mReflowStatus = NS_FRAME_NOT_COMPLETE;
} }
else { else {
// XXX there is no break-after support here yet // Note: line-break-after a block is a nop
NS_ASSERTION(!NS_INLINE_IS_BREAK_AFTER(frameReflowStatus), "not yet implemented");
// Try to place the child block // Try to place the child block
PRBool isAdjacentWithTop = aState.IsAdjacentWithTop(); PRBool isAdjacentWithTop = aState.IsAdjacentWithTop();
@ -2605,15 +2608,15 @@ nsBaseIBFrame::ShouldJustifyLine(nsBlockReflowState& aState, nsLineBox* aLine)
nsLineBox* line = nextInFlow->mLines; nsLineBox* line = nextInFlow->mLines;
while (nsnull != line) { while (nsnull != line) {
if (0 != line->ChildCount()) { if (0 != line->ChildCount()) {
return PR_FALSE; return !line->IsBlock();
} }
line = line->mNext; line = line->mNext;
} }
nextInFlow = (nsBaseIBFrame*) nextInFlow->mNextInFlow; nextInFlow = (nsBaseIBFrame*) nextInFlow->mNextInFlow;
} }
// This is the last line // This is the last line - so don't allow justification
return PR_TRUE; return PR_FALSE;
} }
nsresult nsresult
@ -4515,6 +4518,15 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
mState &= ~NS_FRAME_OUTSIDE_CHILDREN; mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
} }
} }
#if 0
if (nsnull != aMetrics.maxElementSize) {
ListTag(stdout); printf(": maxElementSize=%d,%d\n",
*aMetrics.maxElementSize);
if (aMetrics.maxElementSize->width > 15000) {
printf("YIKES!\n");
}
}
#endif
} }
void void

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

@ -309,15 +309,19 @@ nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
mBlock->ListTag(stdout); mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height); maxSize.width, maxSize.height);
maxSize.width = NS_UNCONSTRAINEDSIZE; if (maxSize.width > 100000) {
mUnconstrainedWidth = PR_TRUE; maxSize.width = NS_UNCONSTRAINEDSIZE;
mUnconstrainedWidth = PR_TRUE;
}
} }
if (!mUnconstrainedHeight && (maxSize.height > 100000)) { if (!mUnconstrainedHeight && (maxSize.height > 100000)) {
mBlock->ListTag(stdout); mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height); maxSize.width, maxSize.height);
maxSize.height = NS_UNCONSTRAINEDSIZE; if (maxSize.height > 100000) {
mUnconstrainedHeight = PR_TRUE; maxSize.height = NS_UNCONSTRAINEDSIZE;
mUnconstrainedHeight = PR_TRUE;
}
} }
#endif #endif
@ -2206,8 +2210,7 @@ nsBaseIBFrame::ReflowBlockFrame(nsBlockReflowState& aState,
aState.mReflowStatus = NS_FRAME_NOT_COMPLETE; aState.mReflowStatus = NS_FRAME_NOT_COMPLETE;
} }
else { else {
// XXX there is no break-after support here yet // Note: line-break-after a block is a nop
NS_ASSERTION(!NS_INLINE_IS_BREAK_AFTER(frameReflowStatus), "not yet implemented");
// Try to place the child block // Try to place the child block
PRBool isAdjacentWithTop = aState.IsAdjacentWithTop(); PRBool isAdjacentWithTop = aState.IsAdjacentWithTop();
@ -2605,15 +2608,15 @@ nsBaseIBFrame::ShouldJustifyLine(nsBlockReflowState& aState, nsLineBox* aLine)
nsLineBox* line = nextInFlow->mLines; nsLineBox* line = nextInFlow->mLines;
while (nsnull != line) { while (nsnull != line) {
if (0 != line->ChildCount()) { if (0 != line->ChildCount()) {
return PR_FALSE; return !line->IsBlock();
} }
line = line->mNext; line = line->mNext;
} }
nextInFlow = (nsBaseIBFrame*) nextInFlow->mNextInFlow; nextInFlow = (nsBaseIBFrame*) nextInFlow->mNextInFlow;
} }
// This is the last line // This is the last line - so don't allow justification
return PR_TRUE; return PR_FALSE;
} }
nsresult nsresult
@ -4515,6 +4518,15 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
mState &= ~NS_FRAME_OUTSIDE_CHILDREN; mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
} }
} }
#if 0
if (nsnull != aMetrics.maxElementSize) {
ListTag(stdout); printf(": maxElementSize=%d,%d\n",
*aMetrics.maxElementSize);
if (aMetrics.maxElementSize->width > 15000) {
printf("YIKES!\n");
}
}
#endif
} }
void void

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

@ -309,15 +309,19 @@ nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
mBlock->ListTag(stdout); mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height); maxSize.width, maxSize.height);
maxSize.width = NS_UNCONSTRAINEDSIZE; if (maxSize.width > 100000) {
mUnconstrainedWidth = PR_TRUE; maxSize.width = NS_UNCONSTRAINEDSIZE;
mUnconstrainedWidth = PR_TRUE;
}
} }
if (!mUnconstrainedHeight && (maxSize.height > 100000)) { if (!mUnconstrainedHeight && (maxSize.height > 100000)) {
mBlock->ListTag(stdout); mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height); maxSize.width, maxSize.height);
maxSize.height = NS_UNCONSTRAINEDSIZE; if (maxSize.height > 100000) {
mUnconstrainedHeight = PR_TRUE; maxSize.height = NS_UNCONSTRAINEDSIZE;
mUnconstrainedHeight = PR_TRUE;
}
} }
#endif #endif
@ -2206,8 +2210,7 @@ nsBaseIBFrame::ReflowBlockFrame(nsBlockReflowState& aState,
aState.mReflowStatus = NS_FRAME_NOT_COMPLETE; aState.mReflowStatus = NS_FRAME_NOT_COMPLETE;
} }
else { else {
// XXX there is no break-after support here yet // Note: line-break-after a block is a nop
NS_ASSERTION(!NS_INLINE_IS_BREAK_AFTER(frameReflowStatus), "not yet implemented");
// Try to place the child block // Try to place the child block
PRBool isAdjacentWithTop = aState.IsAdjacentWithTop(); PRBool isAdjacentWithTop = aState.IsAdjacentWithTop();
@ -2605,15 +2608,15 @@ nsBaseIBFrame::ShouldJustifyLine(nsBlockReflowState& aState, nsLineBox* aLine)
nsLineBox* line = nextInFlow->mLines; nsLineBox* line = nextInFlow->mLines;
while (nsnull != line) { while (nsnull != line) {
if (0 != line->ChildCount()) { if (0 != line->ChildCount()) {
return PR_FALSE; return !line->IsBlock();
} }
line = line->mNext; line = line->mNext;
} }
nextInFlow = (nsBaseIBFrame*) nextInFlow->mNextInFlow; nextInFlow = (nsBaseIBFrame*) nextInFlow->mNextInFlow;
} }
// This is the last line // This is the last line - so don't allow justification
return PR_TRUE; return PR_FALSE;
} }
nsresult nsresult
@ -4515,6 +4518,15 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
mState &= ~NS_FRAME_OUTSIDE_CHILDREN; mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
} }
} }
#if 0
if (nsnull != aMetrics.maxElementSize) {
ListTag(stdout); printf(": maxElementSize=%d,%d\n",
*aMetrics.maxElementSize);
if (aMetrics.maxElementSize->width > 15000) {
printf("YIKES!\n");
}
}
#endif
} }
void void

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

@ -309,15 +309,19 @@ nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
mBlock->ListTag(stdout); mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height); maxSize.width, maxSize.height);
maxSize.width = NS_UNCONSTRAINEDSIZE; if (maxSize.width > 100000) {
mUnconstrainedWidth = PR_TRUE; maxSize.width = NS_UNCONSTRAINEDSIZE;
mUnconstrainedWidth = PR_TRUE;
}
} }
if (!mUnconstrainedHeight && (maxSize.height > 100000)) { if (!mUnconstrainedHeight && (maxSize.height > 100000)) {
mBlock->ListTag(stdout); mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height); maxSize.width, maxSize.height);
maxSize.height = NS_UNCONSTRAINEDSIZE; if (maxSize.height > 100000) {
mUnconstrainedHeight = PR_TRUE; maxSize.height = NS_UNCONSTRAINEDSIZE;
mUnconstrainedHeight = PR_TRUE;
}
} }
#endif #endif
@ -2206,8 +2210,7 @@ nsBaseIBFrame::ReflowBlockFrame(nsBlockReflowState& aState,
aState.mReflowStatus = NS_FRAME_NOT_COMPLETE; aState.mReflowStatus = NS_FRAME_NOT_COMPLETE;
} }
else { else {
// XXX there is no break-after support here yet // Note: line-break-after a block is a nop
NS_ASSERTION(!NS_INLINE_IS_BREAK_AFTER(frameReflowStatus), "not yet implemented");
// Try to place the child block // Try to place the child block
PRBool isAdjacentWithTop = aState.IsAdjacentWithTop(); PRBool isAdjacentWithTop = aState.IsAdjacentWithTop();
@ -2605,15 +2608,15 @@ nsBaseIBFrame::ShouldJustifyLine(nsBlockReflowState& aState, nsLineBox* aLine)
nsLineBox* line = nextInFlow->mLines; nsLineBox* line = nextInFlow->mLines;
while (nsnull != line) { while (nsnull != line) {
if (0 != line->ChildCount()) { if (0 != line->ChildCount()) {
return PR_FALSE; return !line->IsBlock();
} }
line = line->mNext; line = line->mNext;
} }
nextInFlow = (nsBaseIBFrame*) nextInFlow->mNextInFlow; nextInFlow = (nsBaseIBFrame*) nextInFlow->mNextInFlow;
} }
// This is the last line // This is the last line - so don't allow justification
return PR_TRUE; return PR_FALSE;
} }
nsresult nsresult
@ -4515,6 +4518,15 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
mState &= ~NS_FRAME_OUTSIDE_CHILDREN; mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
} }
} }
#if 0
if (nsnull != aMetrics.maxElementSize) {
ListTag(stdout); printf(": maxElementSize=%d,%d\n",
*aMetrics.maxElementSize);
if (aMetrics.maxElementSize->width > 15000) {
printf("YIKES!\n");
}
}
#endif
} }
void void

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

@ -309,15 +309,19 @@ nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
mBlock->ListTag(stdout); mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height); maxSize.width, maxSize.height);
maxSize.width = NS_UNCONSTRAINEDSIZE; if (maxSize.width > 100000) {
mUnconstrainedWidth = PR_TRUE; maxSize.width = NS_UNCONSTRAINEDSIZE;
mUnconstrainedWidth = PR_TRUE;
}
} }
if (!mUnconstrainedHeight && (maxSize.height > 100000)) { if (!mUnconstrainedHeight && (maxSize.height > 100000)) {
mBlock->ListTag(stdout); mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height); maxSize.width, maxSize.height);
maxSize.height = NS_UNCONSTRAINEDSIZE; if (maxSize.height > 100000) {
mUnconstrainedHeight = PR_TRUE; maxSize.height = NS_UNCONSTRAINEDSIZE;
mUnconstrainedHeight = PR_TRUE;
}
} }
#endif #endif
@ -2206,8 +2210,7 @@ nsBaseIBFrame::ReflowBlockFrame(nsBlockReflowState& aState,
aState.mReflowStatus = NS_FRAME_NOT_COMPLETE; aState.mReflowStatus = NS_FRAME_NOT_COMPLETE;
} }
else { else {
// XXX there is no break-after support here yet // Note: line-break-after a block is a nop
NS_ASSERTION(!NS_INLINE_IS_BREAK_AFTER(frameReflowStatus), "not yet implemented");
// Try to place the child block // Try to place the child block
PRBool isAdjacentWithTop = aState.IsAdjacentWithTop(); PRBool isAdjacentWithTop = aState.IsAdjacentWithTop();
@ -2605,15 +2608,15 @@ nsBaseIBFrame::ShouldJustifyLine(nsBlockReflowState& aState, nsLineBox* aLine)
nsLineBox* line = nextInFlow->mLines; nsLineBox* line = nextInFlow->mLines;
while (nsnull != line) { while (nsnull != line) {
if (0 != line->ChildCount()) { if (0 != line->ChildCount()) {
return PR_FALSE; return !line->IsBlock();
} }
line = line->mNext; line = line->mNext;
} }
nextInFlow = (nsBaseIBFrame*) nextInFlow->mNextInFlow; nextInFlow = (nsBaseIBFrame*) nextInFlow->mNextInFlow;
} }
// This is the last line // This is the last line - so don't allow justification
return PR_TRUE; return PR_FALSE;
} }
nsresult nsresult
@ -4515,6 +4518,15 @@ nsBlockFrame::ComputeFinalSize(nsBlockReflowState& aState,
mState &= ~NS_FRAME_OUTSIDE_CHILDREN; mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
} }
} }
#if 0
if (nsnull != aMetrics.maxElementSize) {
ListTag(stdout); printf(": maxElementSize=%d,%d\n",
*aMetrics.maxElementSize);
if (aMetrics.maxElementSize->width > 15000) {
printf("YIKES!\n");
}
}
#endif
} }
void void