diff --git a/mozilla/content/shared/public/nsLayoutAtomList.h b/mozilla/content/shared/public/nsLayoutAtomList.h index da644548bbf..b62ad645fbe 100644 --- a/mozilla/content/shared/public/nsLayoutAtomList.h +++ b/mozilla/content/shared/public/nsLayoutAtomList.h @@ -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") diff --git a/mozilla/layout/base/nsLayoutAtomList.h b/mozilla/layout/base/nsLayoutAtomList.h index da644548bbf..b62ad645fbe 100644 --- a/mozilla/layout/base/nsLayoutAtomList.h +++ b/mozilla/layout/base/nsLayoutAtomList.h @@ -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") diff --git a/mozilla/layout/base/public/nsLayoutAtomList.h b/mozilla/layout/base/public/nsLayoutAtomList.h index da644548bbf..b62ad645fbe 100644 --- a/mozilla/layout/base/public/nsLayoutAtomList.h +++ b/mozilla/layout/base/public/nsLayoutAtomList.h @@ -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") diff --git a/mozilla/layout/base/src/nsSpaceManager.cpp b/mozilla/layout/base/src/nsSpaceManager.cpp index 522b7ac1932..19a558f5851 100644 --- a/mozilla/layout/base/src/nsSpaceManager.cpp +++ b/mozilla/layout/base/src/nsSpaceManager.cpp @@ -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 diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index dcd40ca9bd1..47bbc7daaf6 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -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; } diff --git a/mozilla/layout/generic/nsBlockReflowState.cpp b/mozilla/layout/generic/nsBlockReflowState.cpp index dcd40ca9bd1..47bbc7daaf6 100644 --- a/mozilla/layout/generic/nsBlockReflowState.cpp +++ b/mozilla/layout/generic/nsBlockReflowState.cpp @@ -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; } diff --git a/mozilla/layout/generic/nsBlockReflowState.h b/mozilla/layout/generic/nsBlockReflowState.h index dcd40ca9bd1..47bbc7daaf6 100644 --- a/mozilla/layout/generic/nsBlockReflowState.h +++ b/mozilla/layout/generic/nsBlockReflowState.h @@ -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; } diff --git a/mozilla/layout/generic/nsLineBox.cpp b/mozilla/layout/generic/nsLineBox.cpp index cf69a6f63c0..4fa8a8b2b69 100644 --- a/mozilla/layout/generic/nsLineBox.cpp +++ b/mozilla/layout/generic/nsLineBox.cpp @@ -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 diff --git a/mozilla/layout/generic/nsLineBox.h b/mozilla/layout/generic/nsLineBox.h index 7675c2fcf3a..2e753c4c9b7 100644 --- a/mozilla/layout/generic/nsLineBox.h +++ b/mozilla/layout/generic/nsLineBox.h @@ -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; diff --git a/mozilla/layout/generic/nsSpaceManager.cpp b/mozilla/layout/generic/nsSpaceManager.cpp index 522b7ac1932..19a558f5851 100644 --- a/mozilla/layout/generic/nsSpaceManager.cpp +++ b/mozilla/layout/generic/nsSpaceManager.cpp @@ -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 diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index dcd40ca9bd1..47bbc7daaf6 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -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; } diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.cpp b/mozilla/layout/html/base/src/nsBlockReflowState.cpp index dcd40ca9bd1..47bbc7daaf6 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowState.cpp @@ -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; } diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.h b/mozilla/layout/html/base/src/nsBlockReflowState.h index dcd40ca9bd1..47bbc7daaf6 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.h +++ b/mozilla/layout/html/base/src/nsBlockReflowState.h @@ -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; } diff --git a/mozilla/layout/html/base/src/nsLineBox.cpp b/mozilla/layout/html/base/src/nsLineBox.cpp index cf69a6f63c0..4fa8a8b2b69 100644 --- a/mozilla/layout/html/base/src/nsLineBox.cpp +++ b/mozilla/layout/html/base/src/nsLineBox.cpp @@ -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 diff --git a/mozilla/layout/html/base/src/nsLineBox.h b/mozilla/layout/html/base/src/nsLineBox.h index 7675c2fcf3a..2e753c4c9b7 100644 --- a/mozilla/layout/html/base/src/nsLineBox.h +++ b/mozilla/layout/html/base/src/nsLineBox.h @@ -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; diff --git a/mozilla/layout/html/table/src/nsCellMap.cpp b/mozilla/layout/html/table/src/nsCellMap.cpp index d2e65e1dafd..b138cbb89a7 100644 --- a/mozilla/layout/html/table/src/nsCellMap.cpp +++ b/mozilla/layout/html/table/src/nsCellMap.cpp @@ -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 diff --git a/mozilla/layout/tables/nsCellMap.cpp b/mozilla/layout/tables/nsCellMap.cpp index d2e65e1dafd..b138cbb89a7 100644 --- a/mozilla/layout/tables/nsCellMap.cpp +++ b/mozilla/layout/tables/nsCellMap.cpp @@ -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