removal of debug cruft bug 146474 r=karnaze sr=attinasi

This commit is contained in:
bernd.mielke%snafu.de 2002-05-29 18:55:34 +00:00
Родитель aec8f5f672
Коммит 605e1e230b
8 изменённых файлов: 12 добавлений и 240 удалений

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

@ -154,9 +154,6 @@ PRBool BasicTableLayoutStrategy::Initialize(nsIPresContext* aPresContex
#ifdef DEBUG_TABLE_REFLOW_TIMING
nsTableFrame::DebugTimeMethod(nsTableFrame::eInit, *mTableFrame, (nsHTMLReflowState&)aReflowState, PR_FALSE);
#endif
#ifdef DEBUG_TABLE_REFLOW
printf("Initialized min=%d des=%d pref=%d\n", minWidth, desWidth, prefWidth);
#endif
return result;
}

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

@ -61,7 +61,7 @@ FORCE_STATIC_LIB = 1
include $(topsrcdir)/config/rules.mk
DEFINES += -D_IMPL_NS_HTML -DDEBUG_TABLE_REFLOW_off
DEFINES += -D_IMPL_NS_HTML -DDEBUG_TABLE_REFLOW_TIMING_off
ifeq ($(OS_ARCH),WINNT)
DEFINES += -DWIN32_LEAN_AND_MEAN

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

@ -37,7 +37,7 @@ REQUIRES = xpcom \
$(NULL)
DEFINES =-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN -DoffDEBUG_TABLE_REFLOW \
DEFINES =-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN \
-DoffDEBUG_TABLE_REFLOW_TIMING -DoffDEBUG_TABLE_REFLOW_TIMING_DETAIL \
-DoffDEBUG_TABLE_STRATEGY \
$(NULL)

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

@ -159,7 +159,7 @@ struct nsTableReflowState {
/********************************************************************************
** nsTableFrame **
********************************************************************************/
#if defined DEBUG_TABLE_REFLOW | DEBUG_TABLE_REFLOW_TIMING
#if defined DEBUG_TABLE_REFLOW_TIMING
static PRInt32 gRflCount = 0;
#endif
@ -3459,14 +3459,6 @@ void nsTableFrame::BalanceColumnWidths(nsIPresContext* aPresContext,
SetDesiredWidth(desWidth);
SetPreferredWidth(prefWidth);
#ifdef DEBUG_TABLE_REFLOW
printf("Balanced min=%d des=%d pref=%d cols=", minWidth, desWidth, prefWidth);
for (PRInt32 colX = 0; colX < GetColCount(); colX++) {
printf("%d ", GetColumnWidth(colX));
}
printf("\n");
#endif
}
// This width is based on the column widths array of the table.
@ -7062,7 +7054,7 @@ nsTableFrame::PaintBCBorders(nsIPresContext* aPresContext,
}
/********************************************************************************
** DEBUG_TABLE_REFLOW and DEBUG_TABLE_REFLOW_TIMING **
** DEBUG_TABLE_REFLOW_TIMING **
********************************************************************************/
#ifdef DEBUG
@ -7093,7 +7085,7 @@ GetFrameTypeName(nsIAtom* aFrameType,
}
#endif
#if defined DEBUG_TABLE_REFLOW | DEBUG_TABLE_REFLOW_TIMING
#if defined DEBUG_TABLE_REFLOW_TIMING
#define INDENT_PER_LEVEL 1
@ -7108,105 +7100,6 @@ void PrettyUC(nscoord aSize,
}
}
#ifdef DEBUG_TABLE_REFLOW
void DebugGetIndent(const nsIFrame* aFrame,
char* aBuf)
{
PRInt32 numLevels = 0;
nsIFrame* parent = nsnull;
aFrame->GetParent(&parent);
while (parent) {
nsCOMPtr<nsIAtom> frameType;
parent->GetFrameType(getter_AddRefs(frameType));
if ((nsLayoutAtoms::tableOuterFrame == frameType.get()) ||
(nsLayoutAtoms::tableFrame == frameType.get()) ||
(nsLayoutAtoms::tableRowGroupFrame == frameType.get()) ||
(nsLayoutAtoms::tableRowFrame == frameType.get()) ||
IS_TABLE_CELL(frameType.get())) {
numLevels++;
}
if (nsLayoutAtoms::blockFrame == frameType.get()) {
// only count blocks that are children of cells
nsIFrame* grandParent;
parent->GetParent(&grandParent);
nsCOMPtr<nsIAtom> gFrameType;
grandParent->GetFrameType(getter_AddRefs(gFrameType));
if (IS_TABLE_CELL(gFrameType.get())) {
numLevels++;
}
}
parent->GetParent(&parent);
}
PRInt32 indent = INDENT_PER_LEVEL * numLevels;
memset (aBuf, ' ', indent);
aBuf[indent] = 0;
}
void nsTableFrame::DebugReflow(nsIFrame* aFrame,
nsHTMLReflowState& aState,
nsHTMLReflowMetrics* aMetrics,
nsReflowStatus aStatus)
{
// get the frame type
nsCOMPtr<nsIAtom> fType;
aFrame->GetFrameType(getter_AddRefs(fType));
char fName[128];
GetFrameTypeName(fType.get(), fName);
char indent[256];
DebugGetIndent(aFrame, indent);
printf("%s%s %p ", indent, fName, aFrame);
char width[16];
char height[16];
if (!aMetrics) { // start
PrettyUC(aState.availableWidth, width);
PrettyUC(aState.availableHeight, height);
printf("r=%d ", aState.reason);
if (aState.mFlags.mSpecialHeightReflow) {
printf("special ");
}
printf("a=%s,%s ", width, height);
PrettyUC(aState.mComputedWidth, width);
PrettyUC(aState.mComputedHeight, height);
printf("c=%s,%s ", width, height);
nsIFrame* inFlow;
aFrame->GetPrevInFlow(&inFlow);
if (inFlow) {
printf("pif=%p ", inFlow);
}
aFrame->GetNextInFlow(&inFlow);
if (inFlow) {
printf("nif=%p ", inFlow);
}
printf("cnt=%d \n", gRflCount);
gRflCount++;
//if (32 == gRflCount) {
// NS_ASSERTION(PR_FALSE, "stop");
//}
}
if (aMetrics) { // stop
PrettyUC(aMetrics->width, width);
PrettyUC(aMetrics->height, height);
printf("d=%s,%s ", width, height);
if (aMetrics->maxElementSize) {
PrettyUC(aMetrics->maxElementSize->width, width);
printf("me=%s ", width);
}
if (aMetrics->mFlags & NS_REFLOW_CALC_MAX_WIDTH) {
PrettyUC(aMetrics->mMaximumWidth, width);
printf("m=%s ", width);
}
if (NS_FRAME_IS_NOT_COMPLETE(aStatus)) {
printf("status=%d", aStatus);
}
printf("\n");
}
}
#else
nsReflowTimer* GetFrameTimer(nsIFrame* aFrame,
nsIAtom* aFrameType)
{
@ -7483,9 +7376,7 @@ void nsTableFrame::DebugReflowDone(nsIFrame* aFrame)
}
}
#endif
#endif
#endif //DEBUG_TABLE_REFLOW_TIMING
PRBool nsTableFrame::RowHasSpanningCells(PRInt32 aRowIndex)

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

@ -952,14 +952,13 @@ protected:
// DEBUG REFLOW
#if defined DEBUG_TABLE_REFLOW | DEBUG_TABLE_REFLOW_TIMING
#if defined DEBUG_TABLE_REFLOW_TIMING
public:
static void DebugReflow(nsIFrame* aFrame,
nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics* aMetrics = nsnull,
nsReflowStatus aStatus = NS_FRAME_COMPLETE);
#ifdef DEBUG_TABLE_REFLOW_TIMING
static void DebugReflowDone(nsIFrame* aFrame);
enum nsMethod {eInit=0, eBalanceCols, eNonPctCols, eNonPctColspans, ePctCols};
@ -969,7 +968,6 @@ public:
PRBool aStart);
nsReflowTimer* mTimer;
#endif
#endif
};

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

@ -154,9 +154,6 @@ PRBool BasicTableLayoutStrategy::Initialize(nsIPresContext* aPresContex
#ifdef DEBUG_TABLE_REFLOW_TIMING
nsTableFrame::DebugTimeMethod(nsTableFrame::eInit, *mTableFrame, (nsHTMLReflowState&)aReflowState, PR_FALSE);
#endif
#ifdef DEBUG_TABLE_REFLOW
printf("Initialized min=%d des=%d pref=%d\n", minWidth, desWidth, prefWidth);
#endif
return result;
}

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

@ -159,7 +159,7 @@ struct nsTableReflowState {
/********************************************************************************
** nsTableFrame **
********************************************************************************/
#if defined DEBUG_TABLE_REFLOW | DEBUG_TABLE_REFLOW_TIMING
#if defined DEBUG_TABLE_REFLOW_TIMING
static PRInt32 gRflCount = 0;
#endif
@ -3459,14 +3459,6 @@ void nsTableFrame::BalanceColumnWidths(nsIPresContext* aPresContext,
SetDesiredWidth(desWidth);
SetPreferredWidth(prefWidth);
#ifdef DEBUG_TABLE_REFLOW
printf("Balanced min=%d des=%d pref=%d cols=", minWidth, desWidth, prefWidth);
for (PRInt32 colX = 0; colX < GetColCount(); colX++) {
printf("%d ", GetColumnWidth(colX));
}
printf("\n");
#endif
}
// This width is based on the column widths array of the table.
@ -7062,7 +7054,7 @@ nsTableFrame::PaintBCBorders(nsIPresContext* aPresContext,
}
/********************************************************************************
** DEBUG_TABLE_REFLOW and DEBUG_TABLE_REFLOW_TIMING **
** DEBUG_TABLE_REFLOW_TIMING **
********************************************************************************/
#ifdef DEBUG
@ -7093,7 +7085,7 @@ GetFrameTypeName(nsIAtom* aFrameType,
}
#endif
#if defined DEBUG_TABLE_REFLOW | DEBUG_TABLE_REFLOW_TIMING
#if defined DEBUG_TABLE_REFLOW_TIMING
#define INDENT_PER_LEVEL 1
@ -7108,105 +7100,6 @@ void PrettyUC(nscoord aSize,
}
}
#ifdef DEBUG_TABLE_REFLOW
void DebugGetIndent(const nsIFrame* aFrame,
char* aBuf)
{
PRInt32 numLevels = 0;
nsIFrame* parent = nsnull;
aFrame->GetParent(&parent);
while (parent) {
nsCOMPtr<nsIAtom> frameType;
parent->GetFrameType(getter_AddRefs(frameType));
if ((nsLayoutAtoms::tableOuterFrame == frameType.get()) ||
(nsLayoutAtoms::tableFrame == frameType.get()) ||
(nsLayoutAtoms::tableRowGroupFrame == frameType.get()) ||
(nsLayoutAtoms::tableRowFrame == frameType.get()) ||
IS_TABLE_CELL(frameType.get())) {
numLevels++;
}
if (nsLayoutAtoms::blockFrame == frameType.get()) {
// only count blocks that are children of cells
nsIFrame* grandParent;
parent->GetParent(&grandParent);
nsCOMPtr<nsIAtom> gFrameType;
grandParent->GetFrameType(getter_AddRefs(gFrameType));
if (IS_TABLE_CELL(gFrameType.get())) {
numLevels++;
}
}
parent->GetParent(&parent);
}
PRInt32 indent = INDENT_PER_LEVEL * numLevels;
memset (aBuf, ' ', indent);
aBuf[indent] = 0;
}
void nsTableFrame::DebugReflow(nsIFrame* aFrame,
nsHTMLReflowState& aState,
nsHTMLReflowMetrics* aMetrics,
nsReflowStatus aStatus)
{
// get the frame type
nsCOMPtr<nsIAtom> fType;
aFrame->GetFrameType(getter_AddRefs(fType));
char fName[128];
GetFrameTypeName(fType.get(), fName);
char indent[256];
DebugGetIndent(aFrame, indent);
printf("%s%s %p ", indent, fName, aFrame);
char width[16];
char height[16];
if (!aMetrics) { // start
PrettyUC(aState.availableWidth, width);
PrettyUC(aState.availableHeight, height);
printf("r=%d ", aState.reason);
if (aState.mFlags.mSpecialHeightReflow) {
printf("special ");
}
printf("a=%s,%s ", width, height);
PrettyUC(aState.mComputedWidth, width);
PrettyUC(aState.mComputedHeight, height);
printf("c=%s,%s ", width, height);
nsIFrame* inFlow;
aFrame->GetPrevInFlow(&inFlow);
if (inFlow) {
printf("pif=%p ", inFlow);
}
aFrame->GetNextInFlow(&inFlow);
if (inFlow) {
printf("nif=%p ", inFlow);
}
printf("cnt=%d \n", gRflCount);
gRflCount++;
//if (32 == gRflCount) {
// NS_ASSERTION(PR_FALSE, "stop");
//}
}
if (aMetrics) { // stop
PrettyUC(aMetrics->width, width);
PrettyUC(aMetrics->height, height);
printf("d=%s,%s ", width, height);
if (aMetrics->maxElementSize) {
PrettyUC(aMetrics->maxElementSize->width, width);
printf("me=%s ", width);
}
if (aMetrics->mFlags & NS_REFLOW_CALC_MAX_WIDTH) {
PrettyUC(aMetrics->mMaximumWidth, width);
printf("m=%s ", width);
}
if (NS_FRAME_IS_NOT_COMPLETE(aStatus)) {
printf("status=%d", aStatus);
}
printf("\n");
}
}
#else
nsReflowTimer* GetFrameTimer(nsIFrame* aFrame,
nsIAtom* aFrameType)
{
@ -7483,9 +7376,7 @@ void nsTableFrame::DebugReflowDone(nsIFrame* aFrame)
}
}
#endif
#endif
#endif //DEBUG_TABLE_REFLOW_TIMING
PRBool nsTableFrame::RowHasSpanningCells(PRInt32 aRowIndex)

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

@ -952,14 +952,13 @@ protected:
// DEBUG REFLOW
#if defined DEBUG_TABLE_REFLOW | DEBUG_TABLE_REFLOW_TIMING
#if defined DEBUG_TABLE_REFLOW_TIMING
public:
static void DebugReflow(nsIFrame* aFrame,
nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics* aMetrics = nsnull,
nsReflowStatus aStatus = NS_FRAME_COMPLETE);
#ifdef DEBUG_TABLE_REFLOW_TIMING
static void DebugReflowDone(nsIFrame* aFrame);
enum nsMethod {eInit=0, eBalanceCols, eNonPctCols, eNonPctColspans, ePctCols};
@ -969,7 +968,6 @@ public:
PRBool aStart);
nsReflowTimer* mTimer;
#endif
#endif
};