diff --git a/content/shared/public/nsLayoutAtomList.h b/content/shared/public/nsLayoutAtomList.h index 68a71901544c..28813e919ee2 100644 --- a/content/shared/public/nsLayoutAtomList.h +++ b/content/shared/public/nsLayoutAtomList.h @@ -105,6 +105,7 @@ LAYOUT_ATOM(imageMap, "ImageMap") LAYOUT_ATOM(lineBox, "LineBox") LAYOUT_ATOM(lineBoxFloaters, "LineBoxFloaters") LAYOUT_ATOM(spaceManager, "SpaceManager") +LAYOUT_ATOM(tableColCache, "TableColumnCache") LAYOUT_ATOM(tableStrategy, "TableLayoutStrategy") LAYOUT_ATOM(textRun, "TextRun") LAYOUT_ATOM(xml_document_entities, "XMLDocumentEntities") diff --git a/layout/base/nsLayoutAtomList.h b/layout/base/nsLayoutAtomList.h index 68a71901544c..28813e919ee2 100644 --- a/layout/base/nsLayoutAtomList.h +++ b/layout/base/nsLayoutAtomList.h @@ -105,6 +105,7 @@ LAYOUT_ATOM(imageMap, "ImageMap") LAYOUT_ATOM(lineBox, "LineBox") LAYOUT_ATOM(lineBoxFloaters, "LineBoxFloaters") LAYOUT_ATOM(spaceManager, "SpaceManager") +LAYOUT_ATOM(tableColCache, "TableColumnCache") LAYOUT_ATOM(tableStrategy, "TableLayoutStrategy") LAYOUT_ATOM(textRun, "TextRun") LAYOUT_ATOM(xml_document_entities, "XMLDocumentEntities") diff --git a/layout/base/public/nsLayoutAtomList.h b/layout/base/public/nsLayoutAtomList.h index 68a71901544c..28813e919ee2 100644 --- a/layout/base/public/nsLayoutAtomList.h +++ b/layout/base/public/nsLayoutAtomList.h @@ -105,6 +105,7 @@ LAYOUT_ATOM(imageMap, "ImageMap") LAYOUT_ATOM(lineBox, "LineBox") LAYOUT_ATOM(lineBoxFloaters, "LineBoxFloaters") LAYOUT_ATOM(spaceManager, "SpaceManager") +LAYOUT_ATOM(tableColCache, "TableColumnCache") LAYOUT_ATOM(tableStrategy, "TableLayoutStrategy") LAYOUT_ATOM(textRun, "TextRun") LAYOUT_ATOM(xml_document_entities, "XMLDocumentEntities") diff --git a/layout/html/table/src/nsTableFrame.cpp b/layout/html/table/src/nsTableFrame.cpp index c153560fc6c6..a57dad2f9db0 100644 --- a/layout/html/table/src/nsTableFrame.cpp +++ b/layout/html/table/src/nsTableFrame.cpp @@ -149,6 +149,10 @@ public: eColWidthType_Proportional = 3 // (int) value has proportional meaning }; +#ifdef DEBUG + void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; +#endif + private: PRInt32 mColCounts [4]; PRInt32 *mColIndexes[4]; @@ -252,6 +256,23 @@ void ColumnInfoCache::GetColumnsByType(const nsStyleUnit aType, } } +#ifdef DEBUG +void ColumnInfoCache::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const +{ + NS_PRECONDITION(aResult, "null OUT parameter pointer"); + PRUint32 sum = sizeof(*this); + + // Now add in the space talen up by the arrays + for (int i = 0; i < 4; i++) { + if (mColIndexes[i]) { + sum += mNumColumns * sizeof(PRInt32); + } + } + + *aResult = sum; +} +#endif + NS_IMETHODIMP nsTableFrame::GetFrameType(nsIAtom** aType) const { @@ -5509,9 +5530,11 @@ nsTableFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const // Add in the amount of space for the column width array sum += mColumnWidthsLength * sizeof(PRInt32); - // And the column info cache + // And in size of column info cache if (mColCache) { - sum += sizeof(*mColCache); + PRUint32 colCacheSize; + mColCache->SizeOf(aHandler, &colCacheSize); + aHandler->AddSize(nsLayoutAtoms::tableColCache, colCacheSize); } // Add in size of cell map diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index c153560fc6c6..a57dad2f9db0 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -149,6 +149,10 @@ public: eColWidthType_Proportional = 3 // (int) value has proportional meaning }; +#ifdef DEBUG + void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; +#endif + private: PRInt32 mColCounts [4]; PRInt32 *mColIndexes[4]; @@ -252,6 +256,23 @@ void ColumnInfoCache::GetColumnsByType(const nsStyleUnit aType, } } +#ifdef DEBUG +void ColumnInfoCache::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const +{ + NS_PRECONDITION(aResult, "null OUT parameter pointer"); + PRUint32 sum = sizeof(*this); + + // Now add in the space talen up by the arrays + for (int i = 0; i < 4; i++) { + if (mColIndexes[i]) { + sum += mNumColumns * sizeof(PRInt32); + } + } + + *aResult = sum; +} +#endif + NS_IMETHODIMP nsTableFrame::GetFrameType(nsIAtom** aType) const { @@ -5509,9 +5530,11 @@ nsTableFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const // Add in the amount of space for the column width array sum += mColumnWidthsLength * sizeof(PRInt32); - // And the column info cache + // And in size of column info cache if (mColCache) { - sum += sizeof(*mColCache); + PRUint32 colCacheSize; + mColCache->SizeOf(aHandler, &colCacheSize); + aHandler->AddSize(nsLayoutAtoms::tableColCache, colCacheSize); } // Add in size of cell map