bug 6459 - incremental reflow methods call DeleteFrame instead of RemoveFrame

This commit is contained in:
karnaze%netscape.com 1999-06-10 02:29:34 +00:00
Родитель 2a3a60880a
Коммит a4f30df4ac
10 изменённых файлов: 158 добавлений и 14 удалений

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

@ -307,7 +307,7 @@ NS_METHOD nsTableColGroupFrame::IR_TargetIsMe(nsIPresContext& aPresCont
else
{
rv = mFrames.RemoveFrame(objectFrame);
rv = mFrames.DeleteFrame(aPresContext, objectFrame);
}
break;

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

@ -3256,7 +3256,7 @@ NS_METHOD nsTableFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
}
else
{
rv = mFrames.RemoveFrame(objectFrame);
rv = mFrames.DeleteFrame(aPresContext, objectFrame);
}
break;
@ -3546,7 +3546,7 @@ NS_METHOD nsTableFrame::IR_RowGroupRemoved(nsIPresContext& aPresContext,
nsTableRowGroupFrame * aDeletedFrame)
{
if (PR_TRUE==gsDebugIR) printf("TIF IR: IR_RowGroupRemoved for frame %p\n", aDeletedFrame);
nsresult rv = mFrames.RemoveFrame(aDeletedFrame);
nsresult rv = mFrames.DeleteFrame(aPresContext, aDeletedFrame);
InvalidateCellMap();
InvalidateColumnCache();

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

@ -43,6 +43,74 @@ static const PRBool gsTiming = PR_FALSE;
static const PRBool gsDebugIR = PR_FALSE;
#endif
// temporary timer code
#include <windows.h>
static const PRInt32 MS_PER_SEC = 1000;
static const PRInt32 MS_PER_MIN = 60 * 1000;
static const PRInt32 MS_PER_HOUR = 60 * 60 * 1000;
static const PRInt32 MS_PER_DAY = 24 * 60 * 60 * 1000;
class nsTimer
{
public:
nsTimer() { Reset(); }
void Start();
void Reset();
void Stop();
PRInt32 GetTime() { return mCumMS; }
PRInt32 GetTime2() { return mCumMS2; }
PRInt32 GetStarts() { return mNumStarts; }
protected:
SYSTEMTIME mLastTime;
PRInt32 mCumMS;
PRInt32 mCumMS2;
PRInt32 mNumStarts;
PRIntervalTime mStartTime;
};
void nsTimer::Reset()
{
mCumMS = 0;
mCumMS2 = 0;
mNumStarts = 0;
}
void nsTimer::Start()
{
::GetSystemTime(&mLastTime);
mNumStarts++;
mStartTime = PR_IntervalNow();
}
void nsTimer::Stop()
{
SYSTEMTIME time;
::GetSystemTime(&time);
NS_ASSERTION(mLastTime.wYear == time.wYear, "cannot cross years");
NS_ASSERTION(mLastTime.wMonth == time.wMonth, "cannot cross months");
PRInt32 diff = time.wDay - mLastTime.wDay;
mCumMS += diff * MS_PER_DAY;
diff = time.wHour - mLastTime.wHour;
mCumMS += diff * MS_PER_HOUR;
diff = time.wMinute - mLastTime.wMinute;
mCumMS += diff * MS_PER_MIN;
diff = time.wSecond - mLastTime.wSecond;
mCumMS += diff * MS_PER_SEC;
diff = time.wMilliseconds - mLastTime.wMilliseconds;
mCumMS += diff;
PRIntervalTime endTime = PR_IntervalNow();
mCumMS2 += endTime - mStartTime;
}
// these macros are defined to improve the readability of the main code
// XXX they need to be put in an include file and shared
#define TDBG_S(typ,str) \
@ -933,6 +1001,8 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext& aPresContext,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
nsTimer myTimer; // CWK
myTimer.Start();
nsresult rv = NS_OK;
TDBG_SPDD(gsDebug,"%p: nsTableOuterFrame::Reflow : maxSize=%d,%d\n",
this, aReflowState.availableWidth, aReflowState.availableHeight);
@ -1104,6 +1174,8 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext& aPresContext,
endTime-startTime, this);/* XXX need to use LL_* macros! */
}
myTimer.Stop(); // CWK
printf("outer reflow time=%d time2=%d starts=%d \n", myTimer.GetTime(), myTimer.GetTime2(), myTimer.GetStarts()); // CWK
return rv;
}

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

@ -1109,7 +1109,7 @@ NS_METHOD nsTableRowFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
}
else
{
rv = mFrames.RemoveFrame(objectFrame);
rv = mFrames.DeleteFrame(aPresContext, objectFrame);
}
break;
@ -1263,7 +1263,7 @@ NS_METHOD nsTableRowFrame::IR_CellRemoved(nsIPresContext& aPresContext,
nsTableCellFrame * aDeletedFrame)
{
if (PR_TRUE==gsDebugIR) printf("\nRow IR: IR_RowRemoved\n");
nsresult rv = mFrames.RemoveFrame((nsIFrame*)aDeletedFrame);
nsresult rv = mFrames.DeleteFrame(aPresContext, (nsIFrame*)aDeletedFrame);
if (NS_SUCCEEDED(rv))
{
ResetMaxChildHeight();

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

@ -1157,7 +1157,7 @@ NS_METHOD nsTableRowGroupFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
}
else
{
rv = mFrames.RemoveFrame(objectFrame);
rv = mFrames.DeleteFrame(aPresContext, objectFrame);
}
break;
@ -1326,7 +1326,7 @@ NS_METHOD nsTableRowGroupFrame::IR_RowRemoved(nsIPresContext& aPresContext,
nsTableRowFrame * aDeletedFrame)
{
if (PR_TRUE==gsDebugIR) printf("\nTRGF IR: IR_RowRemoved\n");
nsresult rv = mFrames.RemoveFrame((nsIFrame *)aDeletedFrame);
nsresult rv = mFrames.DeleteFrame(aPresContext, (nsIFrame *)aDeletedFrame);
if (NS_SUCCEEDED(rv))
{
aReflowState.tableFrame->InvalidateCellMap();

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

@ -307,7 +307,7 @@ NS_METHOD nsTableColGroupFrame::IR_TargetIsMe(nsIPresContext& aPresCont
else
{
rv = mFrames.RemoveFrame(objectFrame);
rv = mFrames.DeleteFrame(aPresContext, objectFrame);
}
break;

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

@ -3256,7 +3256,7 @@ NS_METHOD nsTableFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
}
else
{
rv = mFrames.RemoveFrame(objectFrame);
rv = mFrames.DeleteFrame(aPresContext, objectFrame);
}
break;
@ -3546,7 +3546,7 @@ NS_METHOD nsTableFrame::IR_RowGroupRemoved(nsIPresContext& aPresContext,
nsTableRowGroupFrame * aDeletedFrame)
{
if (PR_TRUE==gsDebugIR) printf("TIF IR: IR_RowGroupRemoved for frame %p\n", aDeletedFrame);
nsresult rv = mFrames.RemoveFrame(aDeletedFrame);
nsresult rv = mFrames.DeleteFrame(aPresContext, aDeletedFrame);
InvalidateCellMap();
InvalidateColumnCache();

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

@ -43,6 +43,74 @@ static const PRBool gsTiming = PR_FALSE;
static const PRBool gsDebugIR = PR_FALSE;
#endif
// temporary timer code
#include <windows.h>
static const PRInt32 MS_PER_SEC = 1000;
static const PRInt32 MS_PER_MIN = 60 * 1000;
static const PRInt32 MS_PER_HOUR = 60 * 60 * 1000;
static const PRInt32 MS_PER_DAY = 24 * 60 * 60 * 1000;
class nsTimer
{
public:
nsTimer() { Reset(); }
void Start();
void Reset();
void Stop();
PRInt32 GetTime() { return mCumMS; }
PRInt32 GetTime2() { return mCumMS2; }
PRInt32 GetStarts() { return mNumStarts; }
protected:
SYSTEMTIME mLastTime;
PRInt32 mCumMS;
PRInt32 mCumMS2;
PRInt32 mNumStarts;
PRIntervalTime mStartTime;
};
void nsTimer::Reset()
{
mCumMS = 0;
mCumMS2 = 0;
mNumStarts = 0;
}
void nsTimer::Start()
{
::GetSystemTime(&mLastTime);
mNumStarts++;
mStartTime = PR_IntervalNow();
}
void nsTimer::Stop()
{
SYSTEMTIME time;
::GetSystemTime(&time);
NS_ASSERTION(mLastTime.wYear == time.wYear, "cannot cross years");
NS_ASSERTION(mLastTime.wMonth == time.wMonth, "cannot cross months");
PRInt32 diff = time.wDay - mLastTime.wDay;
mCumMS += diff * MS_PER_DAY;
diff = time.wHour - mLastTime.wHour;
mCumMS += diff * MS_PER_HOUR;
diff = time.wMinute - mLastTime.wMinute;
mCumMS += diff * MS_PER_MIN;
diff = time.wSecond - mLastTime.wSecond;
mCumMS += diff * MS_PER_SEC;
diff = time.wMilliseconds - mLastTime.wMilliseconds;
mCumMS += diff;
PRIntervalTime endTime = PR_IntervalNow();
mCumMS2 += endTime - mStartTime;
}
// these macros are defined to improve the readability of the main code
// XXX they need to be put in an include file and shared
#define TDBG_S(typ,str) \
@ -933,6 +1001,8 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext& aPresContext,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
nsTimer myTimer; // CWK
myTimer.Start();
nsresult rv = NS_OK;
TDBG_SPDD(gsDebug,"%p: nsTableOuterFrame::Reflow : maxSize=%d,%d\n",
this, aReflowState.availableWidth, aReflowState.availableHeight);
@ -1104,6 +1174,8 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext& aPresContext,
endTime-startTime, this);/* XXX need to use LL_* macros! */
}
myTimer.Stop(); // CWK
printf("outer reflow time=%d time2=%d starts=%d \n", myTimer.GetTime(), myTimer.GetTime2(), myTimer.GetStarts()); // CWK
return rv;
}

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

@ -1109,7 +1109,7 @@ NS_METHOD nsTableRowFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
}
else
{
rv = mFrames.RemoveFrame(objectFrame);
rv = mFrames.DeleteFrame(aPresContext, objectFrame);
}
break;
@ -1263,7 +1263,7 @@ NS_METHOD nsTableRowFrame::IR_CellRemoved(nsIPresContext& aPresContext,
nsTableCellFrame * aDeletedFrame)
{
if (PR_TRUE==gsDebugIR) printf("\nRow IR: IR_RowRemoved\n");
nsresult rv = mFrames.RemoveFrame((nsIFrame*)aDeletedFrame);
nsresult rv = mFrames.DeleteFrame(aPresContext, (nsIFrame*)aDeletedFrame);
if (NS_SUCCEEDED(rv))
{
ResetMaxChildHeight();

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

@ -1157,7 +1157,7 @@ NS_METHOD nsTableRowGroupFrame::IR_TargetIsMe(nsIPresContext& aPresContext,
}
else
{
rv = mFrames.RemoveFrame(objectFrame);
rv = mFrames.DeleteFrame(aPresContext, objectFrame);
}
break;
@ -1326,7 +1326,7 @@ NS_METHOD nsTableRowGroupFrame::IR_RowRemoved(nsIPresContext& aPresContext,
nsTableRowFrame * aDeletedFrame)
{
if (PR_TRUE==gsDebugIR) printf("\nTRGF IR: IR_RowRemoved\n");
nsresult rv = mFrames.RemoveFrame((nsIFrame *)aDeletedFrame);
nsresult rv = mFrames.DeleteFrame(aPresContext, (nsIFrame *)aDeletedFrame);
if (NS_SUCCEEDED(rv))
{
aReflowState.tableFrame->InvalidateCellMap();