Added some debugging help for tracking down max-element-size bugs

git-svn-id: svn://10.0.0.236/trunk@24588 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kipp%netscape.com
1999-03-20 19:38:50 +00:00
parent d0ccddea6c
commit 4e9fbfafc5
4 changed files with 94 additions and 6 deletions

View File

@@ -26,9 +26,11 @@
#include "nsHTMLContainerFrame.h"
#ifdef NS_DEBUG
#define NOISY_SPECULATIVE_TOP_MARGIN
#undef NOISY_SPECULATIVE_TOP_MARGIN
#undef NOISY_MAX_ELEMENT_SIZE
#else
#undef NOISY_SPECULATIVE_TOP_MARGIN
#undef NOISY_SPECULATIVE_TOP_MARGIN
#undef NOISY_MAX_ELEMENT_SIZE
#endif
nsBlockReflowContext::nsBlockReflowContext(nsIPresContext& aPresContext,
@@ -169,6 +171,16 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame,
mMetrics.maxElementSize->width = 0;
mMetrics.maxElementSize->height = 0;
}
if ((nsnull != mMetrics.maxElementSize) &&
((mMetrics.maxElementSize->width > mMetrics.width) ||
(mMetrics.maxElementSize->height > mMetrics.height))) {
printf("nsBlockReflowContext: ");
nsFrame::ListTag(stdout, aFrame);
printf(": WARNING: maxElementSize=%d,%d > metrics=%d,%d\n",
mMetrics.maxElementSize->width,
mMetrics.maxElementSize->height,
mMetrics.width, mMetrics.height);
}
if ((mMetrics.width == nscoord(0xdeadbeef)) ||
(mMetrics.height == nscoord(0xdeadbeef)) ||
(mMetrics.ascent == nscoord(0xdeadbeef)) ||
@@ -179,6 +191,16 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame,
mMetrics.ascent, mMetrics.descent);
}
#endif
#ifdef NOISY_MAX_ELEMENT_SIZE
if (nsnull != mMetrics.maxElementSize) {
printf(" ");
nsFrame::ListTag(stdout, aFrame);
printf(": maxElementSize=%d,%d wh=%d,%d\n",
mMetrics.maxElementSize->width,
mMetrics.maxElementSize->height,
mMetrics.width, mMetrics.height);
}
#endif
aFrame->GetFrameState(&state);
if (0 == (NS_FRAME_OUTSIDE_CHILDREN & state)) {

View File

@@ -37,6 +37,7 @@
#undef NOISY_PUSHING
#undef REALLY_NOISY_PUSHING
#define DEBUG_ADD_TEXT
#undef NOISY_MAX_ELEMENT_SIZE
#else
#undef NOISY_HORIZONTAL_ALIGN
#undef REALLY_NOISY_HORIZONTAL_ALIGN
@@ -47,6 +48,7 @@
#undef NOISY_PUSHING
#undef REALLY_NOISY_PUSHING
#undef DEBUG_ADD_TEXT
#undef NOISY_MAX_ELEMENT_SIZE
#endif
nsTextRun::nsTextRun()
@@ -759,16 +761,36 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
metrics.maxElementSize->width = 0;
metrics.maxElementSize->height = 0;
}
if (mComputeMaxElementSize &&
((metrics.maxElementSize->width > metrics.width) ||
(metrics.maxElementSize->height > metrics.height))) {
printf("nsLineLayout: ");
nsFrame::ListTag(stdout, aFrame);
printf(": WARNING: maxElementSize=%d,%d > metrics=%d,%d\n",
metrics.maxElementSize->width,
metrics.maxElementSize->height,
metrics.width, metrics.height);
}
if ((metrics.width == nscoord(0xdeadbeef)) ||
(metrics.height == nscoord(0xdeadbeef)) ||
(metrics.ascent == nscoord(0xdeadbeef)) ||
(metrics.descent == nscoord(0xdeadbeef))) {
printf("nsBlockReflowContext: ");
printf("nsLineLayout: ");
nsFrame::ListTag(stdout, aFrame);
printf(" didn't set whad %d,%d,%d,%d!\n", metrics.width, metrics.height,
metrics.ascent, metrics.descent);
}
#endif
#ifdef NOISY_MAX_ELEMENT_SIZE
if (mComputeMaxElementSize) {
printf(" ");
nsFrame::ListTag(stdout, aFrame);
printf(": maxElementSize=%d,%d wh=%d,%d,\n",
metrics.maxElementSize->width,
metrics.maxElementSize->height,
metrics.width, metrics.height);
}
#endif
aFrame->GetFrameState(&state);
if (NS_FRAME_OUTSIDE_CHILDREN & state) {

View File

@@ -26,9 +26,11 @@
#include "nsHTMLContainerFrame.h"
#ifdef NS_DEBUG
#define NOISY_SPECULATIVE_TOP_MARGIN
#undef NOISY_SPECULATIVE_TOP_MARGIN
#undef NOISY_MAX_ELEMENT_SIZE
#else
#undef NOISY_SPECULATIVE_TOP_MARGIN
#undef NOISY_SPECULATIVE_TOP_MARGIN
#undef NOISY_MAX_ELEMENT_SIZE
#endif
nsBlockReflowContext::nsBlockReflowContext(nsIPresContext& aPresContext,
@@ -169,6 +171,16 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame,
mMetrics.maxElementSize->width = 0;
mMetrics.maxElementSize->height = 0;
}
if ((nsnull != mMetrics.maxElementSize) &&
((mMetrics.maxElementSize->width > mMetrics.width) ||
(mMetrics.maxElementSize->height > mMetrics.height))) {
printf("nsBlockReflowContext: ");
nsFrame::ListTag(stdout, aFrame);
printf(": WARNING: maxElementSize=%d,%d > metrics=%d,%d\n",
mMetrics.maxElementSize->width,
mMetrics.maxElementSize->height,
mMetrics.width, mMetrics.height);
}
if ((mMetrics.width == nscoord(0xdeadbeef)) ||
(mMetrics.height == nscoord(0xdeadbeef)) ||
(mMetrics.ascent == nscoord(0xdeadbeef)) ||
@@ -179,6 +191,16 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame,
mMetrics.ascent, mMetrics.descent);
}
#endif
#ifdef NOISY_MAX_ELEMENT_SIZE
if (nsnull != mMetrics.maxElementSize) {
printf(" ");
nsFrame::ListTag(stdout, aFrame);
printf(": maxElementSize=%d,%d wh=%d,%d\n",
mMetrics.maxElementSize->width,
mMetrics.maxElementSize->height,
mMetrics.width, mMetrics.height);
}
#endif
aFrame->GetFrameState(&state);
if (0 == (NS_FRAME_OUTSIDE_CHILDREN & state)) {

View File

@@ -37,6 +37,7 @@
#undef NOISY_PUSHING
#undef REALLY_NOISY_PUSHING
#define DEBUG_ADD_TEXT
#undef NOISY_MAX_ELEMENT_SIZE
#else
#undef NOISY_HORIZONTAL_ALIGN
#undef REALLY_NOISY_HORIZONTAL_ALIGN
@@ -47,6 +48,7 @@
#undef NOISY_PUSHING
#undef REALLY_NOISY_PUSHING
#undef DEBUG_ADD_TEXT
#undef NOISY_MAX_ELEMENT_SIZE
#endif
nsTextRun::nsTextRun()
@@ -759,16 +761,36 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
metrics.maxElementSize->width = 0;
metrics.maxElementSize->height = 0;
}
if (mComputeMaxElementSize &&
((metrics.maxElementSize->width > metrics.width) ||
(metrics.maxElementSize->height > metrics.height))) {
printf("nsLineLayout: ");
nsFrame::ListTag(stdout, aFrame);
printf(": WARNING: maxElementSize=%d,%d > metrics=%d,%d\n",
metrics.maxElementSize->width,
metrics.maxElementSize->height,
metrics.width, metrics.height);
}
if ((metrics.width == nscoord(0xdeadbeef)) ||
(metrics.height == nscoord(0xdeadbeef)) ||
(metrics.ascent == nscoord(0xdeadbeef)) ||
(metrics.descent == nscoord(0xdeadbeef))) {
printf("nsBlockReflowContext: ");
printf("nsLineLayout: ");
nsFrame::ListTag(stdout, aFrame);
printf(" didn't set whad %d,%d,%d,%d!\n", metrics.width, metrics.height,
metrics.ascent, metrics.descent);
}
#endif
#ifdef NOISY_MAX_ELEMENT_SIZE
if (mComputeMaxElementSize) {
printf(" ");
nsFrame::ListTag(stdout, aFrame);
printf(": maxElementSize=%d,%d wh=%d,%d,\n",
metrics.maxElementSize->width,
metrics.maxElementSize->height,
metrics.width, metrics.height);
}
#endif
aFrame->GetFrameState(&state);
if (NS_FRAME_OUTSIDE_CHILDREN & state) {