Added SizeOf() handler for floater information maintained by the

line box
This commit is contained in:
troy%netscape.com 1999-10-02 02:51:03 +00:00
Родитель 4c807379b7
Коммит d219ef5e29
17 изменённых файлов: 137 добавлений и 12 удалений

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

@ -103,6 +103,7 @@ LAYOUT_ATOM(viewportFrame, "ViewportFrame")
LAYOUT_ATOM(cellMap, "TableCellMap")
LAYOUT_ATOM(imageMap, "ImageMap")
LAYOUT_ATOM(lineBox, "LineBox")
LAYOUT_ATOM(lineBoxFloaters, "LineBoxFloaters")
LAYOUT_ATOM(spaceManager, "SpaceManager")
LAYOUT_ATOM(tableStrategy, "TableLayoutStrategy")
LAYOUT_ATOM(textRun, "TextRun")

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

@ -103,6 +103,7 @@ LAYOUT_ATOM(viewportFrame, "ViewportFrame")
LAYOUT_ATOM(cellMap, "TableCellMap")
LAYOUT_ATOM(imageMap, "ImageMap")
LAYOUT_ATOM(lineBox, "LineBox")
LAYOUT_ATOM(lineBoxFloaters, "LineBoxFloaters")
LAYOUT_ATOM(spaceManager, "SpaceManager")
LAYOUT_ATOM(tableStrategy, "TableLayoutStrategy")
LAYOUT_ATOM(textRun, "TextRun")

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

@ -103,6 +103,7 @@ LAYOUT_ATOM(viewportFrame, "ViewportFrame")
LAYOUT_ATOM(cellMap, "TableCellMap")
LAYOUT_ATOM(imageMap, "ImageMap")
LAYOUT_ATOM(lineBox, "LineBox")
LAYOUT_ATOM(lineBoxFloaters, "LineBoxFloaters")
LAYOUT_ATOM(spaceManager, "SpaceManager")
LAYOUT_ATOM(tableStrategy, "TableLayoutStrategy")
LAYOUT_ATOM(textRun, "TextRun")

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

@ -1200,6 +1200,7 @@ nsSpaceManager::BandRect::Length() const
void
nsSpaceManager::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
NS_PRECONDITION(aResult, "null OUT parameter pointer");
*aResult = sizeof(*this);
// Add in the size of the band data. Don't count the header which has

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

@ -5605,12 +5605,16 @@ nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
// Add in size of each line object
nsLineBox* line = mLines;
while (line) {
aHandler->AddSize(nsLayoutAtoms::lineBox, sizeof(nsLineBox));
PRUint32 lineBoxSize;
line->SizeOf(aHandler, &lineBoxSize);
aHandler->AddSize(nsLayoutAtoms::lineBox, lineBoxSize);
line = line->mNext;
}
line = mOverflowLines;
while (line) {
aHandler->AddSize(nsLayoutAtoms::lineBox, sizeof(nsLineBox));
PRUint32 lineBoxSize;
line->SizeOf(aHandler, &lineBoxSize);
aHandler->AddSize(nsLayoutAtoms::lineBox, lineBoxSize);
line = line->mNext;
}

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

@ -5605,12 +5605,16 @@ nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
// Add in size of each line object
nsLineBox* line = mLines;
while (line) {
aHandler->AddSize(nsLayoutAtoms::lineBox, sizeof(nsLineBox));
PRUint32 lineBoxSize;
line->SizeOf(aHandler, &lineBoxSize);
aHandler->AddSize(nsLayoutAtoms::lineBox, lineBoxSize);
line = line->mNext;
}
line = mOverflowLines;
while (line) {
aHandler->AddSize(nsLayoutAtoms::lineBox, sizeof(nsLineBox));
PRUint32 lineBoxSize;
line->SizeOf(aHandler, &lineBoxSize);
aHandler->AddSize(nsLayoutAtoms::lineBox, lineBoxSize);
line = line->mNext;
}

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

@ -5605,12 +5605,16 @@ nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
// Add in size of each line object
nsLineBox* line = mLines;
while (line) {
aHandler->AddSize(nsLayoutAtoms::lineBox, sizeof(nsLineBox));
PRUint32 lineBoxSize;
line->SizeOf(aHandler, &lineBoxSize);
aHandler->AddSize(nsLayoutAtoms::lineBox, lineBoxSize);
line = line->mNext;
}
line = mOverflowLines;
while (line) {
aHandler->AddSize(nsLayoutAtoms::lineBox, sizeof(nsLineBox));
PRUint32 lineBoxSize;
line->SizeOf(aHandler, &lineBoxSize);
aHandler->AddSize(nsLayoutAtoms::lineBox, lineBoxSize);
line = line->mNext;
}

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

@ -22,6 +22,11 @@
#include "nsLineLayout.h"
#include "prprf.h"
#ifdef DEBUG
#include "nsISizeOfHandler.h"
#include "nsLayoutAtoms.h"
#endif
nsLineBox::nsLineBox(nsIFrame* aFrame, PRInt32 aCount, PRUint16 flags)
{
mFirstChild = aFrame;
@ -206,6 +211,25 @@ nsLineBox::CheckIsBlock() const
}
#endif
#ifdef DEBUG
void
nsLineBox::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
NS_PRECONDITION(aResult, "null OUT parameter pointer");
*aResult = sizeof(*this);
// Add in the size needed for floaters associated with this line
if (mFloaters.NotEmpty()) {
PRUint32 floatersSize;
mFloaters.SizeOf(aHandler, &floatersSize);
// Base size of embedded object was included in sizeof(*this) above
floatersSize -= sizeof(mFloaters);
aHandler->AddSize(nsLayoutAtoms::lineBoxFloaters, floatersSize);
}
}
#endif
//----------------------------------------------------------------------
static NS_DEFINE_IID(kILineIteratorIID, NS_ILINE_ITERATOR_IID);
@ -532,6 +556,20 @@ nsFloaterCacheList::Remove(nsFloaterCache* aElement)
}
}
#ifdef DEBUG
void
nsFloaterCacheList::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
NS_PRECONDITION(aResult, "null OUT parameter pointer");
*aResult = sizeof(*this);
// Add in the space for each floater
for (nsFloaterCache* cache = Head(); cache; cache = cache->Next()) {
*aResult += sizeof(*cache);
}
}
#endif
//----------------------------------------------------------------------
void

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

@ -22,6 +22,7 @@
#include "nsVoidArray.h"
#include "nsPlaceholderFrame.h"
#include "nsILineIterator.h"
#include "nsISizeOfHandler.h"
// bits in nsLineBox.mState
#define LINE_IS_DIRTY 0x1
@ -105,6 +106,10 @@ public:
void Append(nsFloaterCacheFreeList& aList);
#ifdef DEBUG
void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
protected:
nsFloaterCache* mHead;
@ -257,6 +262,10 @@ public:
PRBool CheckIsBlock() const;
#endif
#ifdef DEBUG
void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
nsIFrame* mFirstChild;
PRUint16 mChildCount;
PRUint8 mState;

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

@ -1200,6 +1200,7 @@ nsSpaceManager::BandRect::Length() const
void
nsSpaceManager::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
NS_PRECONDITION(aResult, "null OUT parameter pointer");
*aResult = sizeof(*this);
// Add in the size of the band data. Don't count the header which has

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

@ -5605,12 +5605,16 @@ nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
// Add in size of each line object
nsLineBox* line = mLines;
while (line) {
aHandler->AddSize(nsLayoutAtoms::lineBox, sizeof(nsLineBox));
PRUint32 lineBoxSize;
line->SizeOf(aHandler, &lineBoxSize);
aHandler->AddSize(nsLayoutAtoms::lineBox, lineBoxSize);
line = line->mNext;
}
line = mOverflowLines;
while (line) {
aHandler->AddSize(nsLayoutAtoms::lineBox, sizeof(nsLineBox));
PRUint32 lineBoxSize;
line->SizeOf(aHandler, &lineBoxSize);
aHandler->AddSize(nsLayoutAtoms::lineBox, lineBoxSize);
line = line->mNext;
}

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

@ -5605,12 +5605,16 @@ nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
// Add in size of each line object
nsLineBox* line = mLines;
while (line) {
aHandler->AddSize(nsLayoutAtoms::lineBox, sizeof(nsLineBox));
PRUint32 lineBoxSize;
line->SizeOf(aHandler, &lineBoxSize);
aHandler->AddSize(nsLayoutAtoms::lineBox, lineBoxSize);
line = line->mNext;
}
line = mOverflowLines;
while (line) {
aHandler->AddSize(nsLayoutAtoms::lineBox, sizeof(nsLineBox));
PRUint32 lineBoxSize;
line->SizeOf(aHandler, &lineBoxSize);
aHandler->AddSize(nsLayoutAtoms::lineBox, lineBoxSize);
line = line->mNext;
}

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

@ -5605,12 +5605,16 @@ nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
// Add in size of each line object
nsLineBox* line = mLines;
while (line) {
aHandler->AddSize(nsLayoutAtoms::lineBox, sizeof(nsLineBox));
PRUint32 lineBoxSize;
line->SizeOf(aHandler, &lineBoxSize);
aHandler->AddSize(nsLayoutAtoms::lineBox, lineBoxSize);
line = line->mNext;
}
line = mOverflowLines;
while (line) {
aHandler->AddSize(nsLayoutAtoms::lineBox, sizeof(nsLineBox));
PRUint32 lineBoxSize;
line->SizeOf(aHandler, &lineBoxSize);
aHandler->AddSize(nsLayoutAtoms::lineBox, lineBoxSize);
line = line->mNext;
}

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

@ -22,6 +22,11 @@
#include "nsLineLayout.h"
#include "prprf.h"
#ifdef DEBUG
#include "nsISizeOfHandler.h"
#include "nsLayoutAtoms.h"
#endif
nsLineBox::nsLineBox(nsIFrame* aFrame, PRInt32 aCount, PRUint16 flags)
{
mFirstChild = aFrame;
@ -206,6 +211,25 @@ nsLineBox::CheckIsBlock() const
}
#endif
#ifdef DEBUG
void
nsLineBox::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
NS_PRECONDITION(aResult, "null OUT parameter pointer");
*aResult = sizeof(*this);
// Add in the size needed for floaters associated with this line
if (mFloaters.NotEmpty()) {
PRUint32 floatersSize;
mFloaters.SizeOf(aHandler, &floatersSize);
// Base size of embedded object was included in sizeof(*this) above
floatersSize -= sizeof(mFloaters);
aHandler->AddSize(nsLayoutAtoms::lineBoxFloaters, floatersSize);
}
}
#endif
//----------------------------------------------------------------------
static NS_DEFINE_IID(kILineIteratorIID, NS_ILINE_ITERATOR_IID);
@ -532,6 +556,20 @@ nsFloaterCacheList::Remove(nsFloaterCache* aElement)
}
}
#ifdef DEBUG
void
nsFloaterCacheList::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
NS_PRECONDITION(aResult, "null OUT parameter pointer");
*aResult = sizeof(*this);
// Add in the space for each floater
for (nsFloaterCache* cache = Head(); cache; cache = cache->Next()) {
*aResult += sizeof(*cache);
}
}
#endif
//----------------------------------------------------------------------
void

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

@ -22,6 +22,7 @@
#include "nsVoidArray.h"
#include "nsPlaceholderFrame.h"
#include "nsILineIterator.h"
#include "nsISizeOfHandler.h"
// bits in nsLineBox.mState
#define LINE_IS_DIRTY 0x1
@ -105,6 +106,10 @@ public:
void Append(nsFloaterCacheFreeList& aList);
#ifdef DEBUG
void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
protected:
nsFloaterCache* mHead;
@ -257,6 +262,10 @@ public:
PRBool CheckIsBlock() const;
#endif
#ifdef DEBUG
void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
nsIFrame* mFirstChild;
PRUint16 mChildCount;
PRUint8 mState;

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

@ -704,6 +704,7 @@ PRBool nsCellMap::ColHasSpanningCells(PRInt32 aColIndex) const
#ifdef DEBUG
void nsCellMap::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
NS_PRECONDITION(aResult, "null OUT parameter pointer");
PRUint32 sum = sizeof(*this);
// Add in the size of the void arrays. Because we have emnbedded objects

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

@ -704,6 +704,7 @@ PRBool nsCellMap::ColHasSpanningCells(PRInt32 aColIndex) const
#ifdef DEBUG
void nsCellMap::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
NS_PRECONDITION(aResult, "null OUT parameter pointer");
PRUint32 sum = sizeof(*this);
// Add in the size of the void arrays. Because we have emnbedded objects