Updated SizeOf methods to not waste space when doing a non-debug build

This commit is contained in:
kipp%netscape.com 1999-09-01 01:02:16 +00:00
Родитель bd73964c84
Коммит dff5b76938
85 изменённых файлов: 621 добавлений и 287 удалений

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

@ -452,13 +452,15 @@ nsAreaFrame::GetFrameName(nsString& aResult) const
return MakeFrameName("Area", aResult);
}
#ifdef DEBUG
NS_IMETHODIMP
nsAreaFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
nsBlockFrame::SizeOf(aHandler, aResult);
*aResult += sizeof(*this) - sizeof(nsBlockFrame);
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
nsBlockFrame::SizeOf(aHandler, aResult);
*aResult += sizeof(*this) - sizeof(nsBlockFrame);
return NS_OK;
}
#endif

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

@ -104,7 +104,9 @@ public:
NS_IMETHOD GetFrameName(nsString& aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
// nsIAreaFrame
NS_IMETHOD GetPositionedInfo(nscoord& aXMost, nscoord& aYMost) const;

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

@ -1054,7 +1054,21 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
if (0 != mFlags) {
fprintf(out, " [flags=%x]", mFlags);
}
fprintf(out, " sc=%p<\n", mStyleContext);
PRInt32 numInlineLines = 0;
PRInt32 numBlockLines = 0;
if (nsnull != mLines) {
nsLineBox* line = mLines;
while (nsnull != line) {
if (line->IsBlock()) {
numBlockLines++;
}
else {
numInlineLines++;
}
line = line->mNext;
}
}
fprintf(out, " sc=%p(i=%d,b=%d)<\n", mStyleContext, numInlineLines, numBlockLines);
aIndent++;
// Output the lines
@ -5490,6 +5504,7 @@ nsBlockFrame::VerifyTree() const
return NS_OK;
}
#ifdef DEBUG
NS_IMETHODIMP
nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -5523,6 +5538,7 @@ nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sum;
return NS_OK;
}
#endif
//----------------------------------------------------------------------

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

@ -101,7 +101,9 @@ public:
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
NS_IMETHOD VerifyTree() const;
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame);
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,

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

@ -1054,7 +1054,21 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
if (0 != mFlags) {
fprintf(out, " [flags=%x]", mFlags);
}
fprintf(out, " sc=%p<\n", mStyleContext);
PRInt32 numInlineLines = 0;
PRInt32 numBlockLines = 0;
if (nsnull != mLines) {
nsLineBox* line = mLines;
while (nsnull != line) {
if (line->IsBlock()) {
numBlockLines++;
}
else {
numInlineLines++;
}
line = line->mNext;
}
}
fprintf(out, " sc=%p(i=%d,b=%d)<\n", mStyleContext, numInlineLines, numBlockLines);
aIndent++;
// Output the lines
@ -5490,6 +5504,7 @@ nsBlockFrame::VerifyTree() const
return NS_OK;
}
#ifdef DEBUG
NS_IMETHODIMP
nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -5523,6 +5538,7 @@ nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sum;
return NS_OK;
}
#endif
//----------------------------------------------------------------------

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

@ -1054,7 +1054,21 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
if (0 != mFlags) {
fprintf(out, " [flags=%x]", mFlags);
}
fprintf(out, " sc=%p<\n", mStyleContext);
PRInt32 numInlineLines = 0;
PRInt32 numBlockLines = 0;
if (nsnull != mLines) {
nsLineBox* line = mLines;
while (nsnull != line) {
if (line->IsBlock()) {
numBlockLines++;
}
else {
numInlineLines++;
}
line = line->mNext;
}
}
fprintf(out, " sc=%p(i=%d,b=%d)<\n", mStyleContext, numInlineLines, numBlockLines);
aIndent++;
// Output the lines
@ -5490,6 +5504,7 @@ nsBlockFrame::VerifyTree() const
return NS_OK;
}
#ifdef DEBUG
NS_IMETHODIMP
nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -5523,6 +5538,7 @@ nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sum;
return NS_OK;
}
#endif
//----------------------------------------------------------------------

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

@ -668,12 +668,14 @@ nsContainerFrame::List(FILE* out, PRInt32 aIndent) const
return NS_OK;
}
#ifdef DEBUG
NS_IMETHODIMP
nsContainerFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
*aResult = sizeof(*this);
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
*aResult = sizeof(*this);
return NS_OK;
}
#endif

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

@ -50,7 +50,9 @@ public:
nsIFrame* aOldFrame,
nsIFrame* aNewFrame);
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
// nsIHTMLReflow overrides
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,

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

@ -93,8 +93,8 @@ PRInt32 fTrackerAddListMax = 0;
void ForceDrawFrame(nsFrame * aFrame);
//non Hack prototypes
static void GetLastLeaf(nsIFrame **aFrame);
static void GetFirstLeaf(nsIFrame **aFrame);
#if 0
static void GetFirstLeaf(nsIFrame **aFrame);
static void RefreshContentFrames(nsIPresContext& aPresContext, nsIContent * aStartContent, nsIContent * aEndContent);
#endif
@ -682,7 +682,7 @@ nsFrame::Paint(nsIPresContext& aPresContext,
SelectionDetails *details;
PRInt32 offset;
if (NS_SUCCEEDED(result) && newContent){
nsresult result = newContent->IndexOf(mContent, offset);
result = newContent->IndexOf(mContent, offset);
if (NS_FAILED(result))
{
return result;
@ -709,7 +709,7 @@ nsFrame::Paint(nsIPresContext& aPresContext,
nsRect drawrect(1, 1, rect.width, rect.height);
aRenderingContext.DrawRect(drawrect );
SelectionDetails *deletingDetails = details;
while(deletingDetails = details->mNext){
while((deletingDetails = details->mNext)){
delete details;
details = deletingDetails;
}
@ -1589,11 +1589,15 @@ nsFrame::DumpBaseRegressionData(FILE* out, PRInt32 aIndent)
NS_IMETHODIMP
nsFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
*aResult = sizeof(*this);
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
#ifdef DEBUG
*aResult = sizeof(*this);
#else
*aResult = 0;
#endif
return NS_OK;
}
NS_IMETHODIMP
@ -1682,7 +1686,13 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIFocusTracker *aTracker,
//magic numbers aLineStart will be -1 for end of block 0 will be start of block
if (!aBlockFrame)
return NS_ERROR_NULL_POINTER;
PRInt32 thisLine = 0;
if (aResultFrame) {
*aResultFrame = nsnull;
}
if (aResultContent) {
*aResultContent = nsnull;
}
nsresult result;
nsCOMPtr<nsILineIterator> it;
result = aBlockFrame->QueryInterface(nsILineIterator::GetIID(),getter_AddRefs(it));
@ -1788,7 +1798,6 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIFocusTracker *aTracker,
result = resultFrame->GetPosition(*(context.get()),aDesiredX,
aResultContent,*aContentOffset, *aContentOffset);
PRBool breakOut = PR_FALSE;
if (NS_SUCCEEDED(result))
found = PR_TRUE;
else {
@ -1818,7 +1827,6 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIFocusTracker *aTracker,
result = resultFrame->GetPosition(*(context.get()),aDesiredX,
aResultContent,*aContentOffset, *aContentOffset);
PRBool breakOut = PR_FALSE;
if (NS_SUCCEEDED(result))
found = PR_TRUE;
else {
@ -1873,7 +1881,6 @@ nsFrame::PeekOffset(nsIFocusTracker *aTracker,
if (!aTracker)
return NS_ERROR_NULL_POINTER;
nscoord coord = aDesiredX;
nsCOMPtr<nsILineIterator> it;
nsIFrame *blockFrame = this;
nsIFrame *thisBlock = this;
@ -2039,7 +2046,7 @@ void ForceDrawFrame(nsFrame * aFrame)//, PRBool)
}
void
static void
GetLastLeaf(nsIFrame **aFrame)
{
if (!aFrame || !*aFrame)
@ -2059,6 +2066,7 @@ GetLastLeaf(nsIFrame **aFrame)
*aFrame = child;
}
#if 0
void
GetFirstLeaf(nsIFrame **aFrame)
{
@ -2075,6 +2083,7 @@ GetFirstLeaf(nsIFrame **aFrame)
*aFrame = child;
}
}
#endif
#ifdef NS_DEBUG
static void

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

@ -452,6 +452,7 @@ RootFrame::GetFrameName(nsString& aResult) const
return MakeFrameName("Root", aResult);
}
#ifdef DEBUG
NS_IMETHODIMP
RootFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -461,3 +462,4 @@ RootFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sizeof(*this);
return NS_OK;
}
#endif

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

@ -56,6 +56,7 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#include "nsIDOMHTMLMapElement.h"
#include "nsIStyleSet.h"
#include "nsLayoutAtoms.h"
#include "nsISizeOfHandler.h"
#ifdef DEBUG
#undef NOISY_IMAGE_LOADING
@ -870,16 +871,26 @@ nsImageFrame::GetFrameType(nsIAtom** aType) const
return NS_OK;
}
// Note: this doesn't factor in:
// -- the mImageMap (it might be shared)
#ifdef DEBUG
NS_IMETHODIMP
nsImageFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
PRUint32 sum = sizeof(*this) - sizeof(mImageLoader) +
mImageLoader.GetDataSize();
PRUint32 sum;
mImageLoader.SizeOf(aHandler, &sum);
sum += sizeof(*this) - sizeof(mImageLoader);
if (mImageMap) {
PRBool recorded;
aHandler->RecordObject((void*) mImageMap, &recorded);
if (!recorded) {
PRUint32 mapSize;
mImageMap->SizeOf(aHandler, &mapSize);
aHandler->AddSize(nsLayoutAtoms::imageMap, mapSize);
}
}
*aResult = sum;
return NS_OK;
}
#endif

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

@ -60,7 +60,9 @@ public:
nsIAtom* aAttribute,
PRInt32 aHint);
NS_IMETHOD GetFrameType(nsIAtom** aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
protected:
virtual ~nsImageFrame();

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

@ -78,7 +78,9 @@ public:
const nsString& GetAltText() const { return mAltText; }
PRBool GetSuppress() const { return mSuppressFeedback; }
#ifdef DEBUG
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
nsString mBase;
nsString mHREF;
@ -105,6 +107,7 @@ Area::~Area()
delete [] mCoords;
}
#ifdef DEBUG
void
Area::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -119,6 +122,7 @@ Area::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sum;
}
}
#endif
#include <stdlib.h>
#define XP_ATOI(_s) ::atoi(_s)
@ -1136,6 +1140,7 @@ nsImageMap::DocumentWillBeDestroyed(nsIDocument *aDocument)
return NS_OK;
}
#ifdef DEBUG
void
nsImageMap::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -1151,3 +1156,4 @@ nsImageMap::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sum;
}
}
#endif

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

@ -62,7 +62,9 @@ public:
void Draw(nsIPresContext& aCX, nsIRenderingContext& aRC);
#ifdef DEBUG
void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
// nsISupports
NS_DECL_ISUPPORTS

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

@ -2180,13 +2180,15 @@ nsFirstLineFrame::Reflow(nsIPresContext& aPresContext,
return rv;
}
#ifdef DEBUG
NS_IMETHODIMP
nsPositionedInlineFrame::SizeOf(nsISizeOfHandler* aHandler,
PRUint32* aResult) const
{
if (aResult) {
*aResult = sizeof(*this);
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
*aResult = sizeof(*this);
return NS_OK;
}
#endif

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

@ -258,7 +258,9 @@ class nsPositionedInlineFrame : public nsInlineFrame
{
public:
NS_IMETHOD Destroy(nsIPresContext& aPresContext);
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,

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

@ -126,13 +126,15 @@ nsLeafFrame::ContentChanged(nsIPresContext* aPresContext,
return rv;
}
#ifdef DEBUG
NS_IMETHODIMP
nsLeafFrame::SizeOf(nsISizeOfHandler* aHandler,
PRUint32* aResult) const
{
if (aResult) {
*aResult = sizeof(*this);
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
*aResult = sizeof(*this);
return NS_OK;
}
#endif

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

@ -41,7 +41,9 @@ public:
NS_IMETHOD ContentChanged(nsIPresContext* aPresContext,
nsIContent* aChild,
nsISupports* aSubContent);
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
protected:
virtual ~nsLeafFrame();

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

@ -114,6 +114,7 @@ nsPlaceholderFrame::List(FILE* out, PRInt32 aIndent) const
return NS_OK;
}
#ifdef DEBUG
NS_IMETHODIMP
nsPlaceholderFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -123,3 +124,4 @@ nsPlaceholderFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sizeof(*this);
return NS_OK;
}
#endif

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

@ -56,7 +56,9 @@ public:
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
protected:
nsIFrame* mOutOfFlowFrame;

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

@ -196,12 +196,14 @@ nsSplittableFrame::DumpBaseRegressionData(FILE* out, PRInt32 aIndent)
}
#ifdef DEBUG
NS_IMETHODIMP
nsSplittableFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
*aResult = sizeof(*this);
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
*aResult = sizeof(*this);
return NS_OK;
}
#endif

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

@ -31,7 +31,9 @@ public:
nsIFrame* aPrevInFlow);
NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
// Flow member functions.
NS_IMETHOD GetPrevInFlow(nsIFrame** aPrevInFlow) const;

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

@ -227,7 +227,9 @@ public:
NS_IMETHOD GetFrameName(nsString& aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
NS_IMETHOD GetPosition(nsIPresContext& aCX,
nscoord aXCoord,
@ -440,33 +442,33 @@ public:
protected:
virtual ~nsTextFrame();
// XXX pack this tighter
PRInt32 mContentOffset;
PRInt32 mContentLength;
PRUint32 mFlags;
PRInt32 mColumn;
nscoord mComputedWidth;
};
// Flag information used by rendering code. This information is
// computed by the ResizeReflow code. Remaining bits are used by the
// tab count.
// computed by the ResizeReflow code. The flags are stored in the
// mState variable in the frame class private section.
// Flag indicating that whitespace was skipped
#define TEXT_SKIP_LEADING_WS 0x01
#define TEXT_SKIP_LEADING_WS 0x01000000
#define TEXT_HAS_MULTIBYTE 0x02
#define TEXT_HAS_MULTIBYTE 0x02000000
#define TEXT_BLINK_ON 0x04
#define TEXT_IN_WORD 0x04000000
#define TEXT_IN_WORD 0x08
#define TEXT_TRIMMED_WS 0x10
#define TEXT_TRIMMED_WS 0x08000000
// This bit is set on the first frame in a continuation indicating
// that it was choppsed short because of :first-letter style.
#define TEXT_FIRST_LETTER 0x20
// that it was chopped short because of :first-letter style.
#define TEXT_FIRST_LETTER 0x10000000
// Bits in mState used for reflow flags
#define TEXT_REFLOW_FLAGS 0x7F000000
#define TEXT_BLINK_ON 0x80000000
//----------------------------------------------------------------------
@ -497,7 +499,7 @@ nsTextFrame::nsTextFrame()
nsTextFrame::~nsTextFrame()
{
if (0 != (mFlags & TEXT_BLINK_ON)) {
if (0 != (mState & TEXT_BLINK_ON)) {
NS_ASSERTION(nsnull != gTextBlinker, "corrupted blinker");
gTextBlinker->RemoveFrame(this);
}
@ -574,7 +576,7 @@ nsTextFrame::Paint(nsIPresContext& aPresContext,
if (NS_FRAME_PAINT_LAYER_FOREGROUND != aWhichLayer) {
return NS_OK;
}
if ((0 != (mFlags & TEXT_BLINK_ON)) && gBlinkTextOff) {
if ((0 != (mState & TEXT_BLINK_ON)) && gBlinkTextOff) {
return NS_OK;
}
nsIStyleContext* sc = mStyleContext;
@ -592,7 +594,7 @@ nsTextFrame::Paint(nsIPresContext& aPresContext,
// performance hint.
PRUint32 hints = 0;
aRenderingContext.GetHints(hints);
if ((TEXT_HAS_MULTIBYTE & mFlags) ||
if ((TEXT_HAS_MULTIBYTE & mState) ||
(0 == (hints & NS_RENDERING_HINT_FAST_8BIT_TEXT))) {
// Use PRUnichar rendering routine
PaintUnicodeText(&aPresContext, aRenderingContext, sc, ts, 0, 0);
@ -629,11 +631,11 @@ nsTextFrame::PrepareUnicodeText(nsTextTransformer& aTX,
// Skip over the leading whitespace
PRInt32 n = mContentLength;
if (0 != (mFlags & TEXT_SKIP_LEADING_WS)) {
if (0 != (mState & TEXT_SKIP_LEADING_WS)) {
PRBool isWhitespace;
PRInt32 wordLen, contentLen;
aTX.GetNextWord(PR_FALSE, wordLen, contentLen, isWhitespace);
NS_ASSERTION(isWhitespace, "mFlags and content are out of sync");
NS_ASSERTION(isWhitespace, "mState and content are out of sync");
if (isWhitespace) {
if (nsnull != aIndexes) {
// Point mapping indicies at the same content index since
@ -651,7 +653,7 @@ nsTextFrame::PrepareUnicodeText(nsTextTransformer& aTX,
// Rescan the content and transform it. Stop when we have consumed
// mContentLength characters.
PRBool inWord = (TEXT_IN_WORD & mFlags) ? PR_TRUE : PR_FALSE;
PRBool inWord = (TEXT_IN_WORD & mState) ? PR_TRUE : PR_FALSE;
PRInt32 column = mColumn;
PRInt32 textLength = 0;
while (0 != n) {
@ -719,7 +721,7 @@ nsTextFrame::PrepareUnicodeText(nsTextTransformer& aTX,
}
// Remove trailing whitespace if it was trimmed after reflow
if (TEXT_TRIMMED_WS & mFlags) {
if (TEXT_TRIMMED_WS & mState) {
if (--dst >= aBuffer) {
PRUnichar ch = *dst;
if (XP_IS_SPACE(ch)) {
@ -971,7 +973,6 @@ nsTextFrame::PaintUnicodeText(nsIPresContext* aPresContext,
SelectionDetails *details = nsnull;
nsCOMPtr<nsIPresShell> shell;
nsCOMPtr<nsIFrameSelection> frameSelection;
PRBool drawSelected = PR_FALSE;
nsresult rv = aPresContext->GetShell(getter_AddRefs(shell));
if (NS_SUCCEEDED(rv) && shell){
@ -1066,12 +1067,12 @@ nsTextFrame::GetPositionSlowly(nsIPresContext& aPresContext,
GetOffsetFromView(origin, &view);
nscoord charWidth,widthsofar = 0;
PRInt32 index = 0;
PRInt32 indx = 0;
PRBool found = PR_FALSE;
PRUnichar* startBuf = paintBuf;
nsIFontMetrics* lastFont = ts.mLastFont;
for (; --textLength >= 0; paintBuf++,index++) {
for (; --textLength >= 0; paintBuf++,indx++) {
nsIFontMetrics* nextFont;
nscoord glyphWidth;
PRUnichar ch = *paintBuf;
@ -1104,12 +1105,12 @@ nsTextFrame::GetPositionSlowly(nsIPresContext& aPresContext,
}
if ((aXCoord - origin.x) >= widthsofar && (aXCoord - origin.x) <= (widthsofar + glyphWidth)){
if ( ((aXCoord - origin.x) - widthsofar) <= (glyphWidth /2)){
aOffset = index;
aOffset = indx;
found = PR_TRUE;
break;
}
else{
aOffset = index+1;
aOffset = indx+1;
found = PR_TRUE;
break;
}
@ -1423,11 +1424,8 @@ nsTextFrame::PaintTextSlowly(nsIPresContext* aPresContext,
//must set up last one for selection beyond edge if in boundary
ip[mContentLength]++;
}
PRInt32 selectionStartOffset = 0;//frame coordinates
PRInt32 selectionEndOffset = 0;//frame coordinates
nsCOMPtr<nsIPresShell> shell;
nsCOMPtr<nsIFrameSelection> frameSelection;
PRBool drawSelected = PR_FALSE;
nsresult rv = aPresContext->GetShell(getter_AddRefs(shell));
if (NS_SUCCEEDED(rv) && shell){
rv = shell->GetFrameSelection(getter_AddRefs(frameSelection));
@ -1537,11 +1535,8 @@ nsTextFrame::PaintAsciiText(nsIPresContext* aPresContext,
//must set up last one for selection beyond edge if in boundary
ip[mContentLength]++;
}
PRInt32 selectionStartOffset = 0;//frame coordinates
PRInt32 selectionEndOffset = 0;//frame coordinates
nsCOMPtr<nsIPresShell> shell;
nsCOMPtr<nsIFrameSelection> frameSelection;
PRBool drawSelected = PR_FALSE;
nsresult rv = aPresContext->GetShell(getter_AddRefs(shell));
if (NS_SUCCEEDED(rv) && shell){
rv = shell->GetFrameSelection(getter_AddRefs(frameSelection));
@ -1715,7 +1710,7 @@ nsTextFrame::GetPosition(nsIPresContext& aCX,
ip[mContentLength]++;
}
PRInt32 index;
PRInt32 indx;
PRInt32 textWidth = 0;
PRUnichar* text = paintBuf;
nsPoint origin;
@ -1724,14 +1719,14 @@ nsTextFrame::GetPosition(nsIPresContext& aCX,
PRBool found = BinarySearchForPosition(acx, text, origin.x, 0, 0,
PRInt32(textLength),
PRInt32(aXCoord) , //go to local coordinates
index, textWidth);
indx, textWidth);
if (found) {
PRInt32 charWidth;
acx->GetWidth(text[index], charWidth);
acx->GetWidth(text[indx], charWidth);
charWidth /= 2;
if (PRInt32(aXCoord) - origin.x > textWidth+charWidth) {
index++;
indx++;
}
}
@ -1742,7 +1737,7 @@ nsTextFrame::GetPosition(nsIPresContext& aCX,
delete [] paintBuf;
}
aContentOffset = index + mContentOffset;
aContentOffset = indx + mContentOffset;
//reusing wordBufMem
PRInt32 i;
for (i = 0;i <= mContentLength; i ++){
@ -2063,7 +2058,7 @@ nsTextFrame::PeekOffset(nsIFocusTracker *aTracker,
break;
}
}
/* if (aStartOffset == 0 && (mFlags & TEXT_SKIP_LEADING_WS))
/* if (aStartOffset == 0 && (mState & TEXT_SKIP_LEADING_WS))
i--; //back up because we just skipped over some white space. why skip over the char also?
*/
if (i > mContentLength){
@ -2347,18 +2342,18 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
nsLineLayout& lineLayout = *aReflowState.mLineLayout;
TextStyle ts(&aPresContext, *aReflowState.rendContext, mStyleContext);
// Initialize mFlags (without destroying the TEXT_BLINK_ON bit) bits
// that are filled in by the reflow routines.
mFlags &= TEXT_BLINK_ON;
// Clear out the reflow state flags in mState (without destroying
// the TEXT_BLINK_ON bit).
mState &= ~TEXT_REFLOW_FLAGS;
if (ts.mFont->mFont.decorations & NS_STYLE_TEXT_DECORATION_BLINK) {
if (0 == (mFlags & TEXT_BLINK_ON)) {
mFlags |= TEXT_BLINK_ON;
if (0 == (mState & TEXT_BLINK_ON)) {
mState |= TEXT_BLINK_ON;
gTextBlinker->AddFrame(this);
}
}
else {
if (0 != (mFlags & TEXT_BLINK_ON)) {
mFlags &= ~TEXT_BLINK_ON;
if (0 != (mState & TEXT_BLINK_ON)) {
mState &= ~TEXT_BLINK_ON;
gTextBlinker->RemoveFrame(this);
}
}
@ -2410,11 +2405,11 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
// is only valid for one pass through the measuring loop.
PRBool inWord = lineLayout.InWord() ||
((nsnull != mPrevInFlow) &&
(((nsTextFrame*)mPrevInFlow)->mFlags & TEXT_FIRST_LETTER));
(((nsTextFrame*)mPrevInFlow)->mState & TEXT_FIRST_LETTER));
if (inWord) {
mFlags |= TEXT_IN_WORD;
mState |= TEXT_IN_WORD;
}
mFlags &= ~TEXT_FIRST_LETTER;
mState &= ~TEXT_FIRST_LETTER;
PRInt32 column = lineLayout.GetColumn();
PRInt32 prevColumn = column;
@ -2451,7 +2446,7 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
skipWhitespace = PR_FALSE;
// Only set flag when we actually do skip whitespace
mFlags |= TEXT_SKIP_LEADING_WS;
mState |= TEXT_SKIP_LEADING_WS;
continue;
}
if ('\t' == bp[0]) {
@ -2512,7 +2507,7 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
}
}
if (tx.HasMultibyte()) {
mFlags |= TEXT_HAS_MULTIBYTE;
mState |= TEXT_HAS_MULTIBYTE;
}
// Post processing logic to deal with word-breaking that spans
@ -2617,7 +2612,7 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
if (justDidFirstLetter) {
lineLayout.SetFirstLetterFrame(this);
lineLayout.SetFirstLetterStyleOK(PR_FALSE);
mFlags |= TEXT_FIRST_LETTER;
mState |= TEXT_FIRST_LETTER;
}
// Setup metrics for caller; store final max-element-size information
@ -2803,10 +2798,10 @@ nsTextFrame::TrimTrailingWhiteSpace(nsIPresContext* aPresContext,
mComputedWidth -= dw;
}
if (0 != dw) {
mFlags |= TEXT_TRIMMED_WS;
mState |= TEXT_TRIMMED_WS;
}
else {
mFlags &= ~TEXT_TRIMMED_WS;
mState &= ~TEXT_TRIMMED_WS;
}
aDeltaWidth = dw;
return NS_OK;
@ -3074,6 +3069,7 @@ nsTextFrame::GetFrameType(nsIAtom** aType) const
return NS_OK;
}
#ifdef DEBUG
NS_IMETHODIMP
nsTextFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -3083,6 +3079,7 @@ nsTextFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sizeof(*this);
return NS_OK;
}
#endif
NS_IMETHODIMP
nsTextFrame::GetFrameName(nsString& aResult) const
@ -3108,10 +3105,9 @@ nsTextFrame::List(FILE* out, PRInt32 aIndent) const
// Output the first/last content offset and prev/next in flow info
PRBool isComplete = (mContentOffset + mContentLength) == contentLength;
fprintf(out, "[%d,%d,%c][%x] ",
fprintf(out, "[%d,%d,%c] ",
mContentOffset, mContentOffset+mContentLength-1,
isComplete ? 'T':'F',
mFlags);
isComplete ? 'T':'F');
if (nsnull != mNextSibling) {
fprintf(out, " next=%p", mNextSibling);

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

@ -83,7 +83,9 @@ public:
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
protected:
nsresult IncrementalReflow(nsIPresContext& aPresContext,
@ -573,6 +575,7 @@ ViewportFrame::GetFrameName(nsString& aResult) const
return MakeFrameName("Viewport", aResult);
}
#ifdef DEBUG
NS_IMETHODIMP
ViewportFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -582,3 +585,4 @@ ViewportFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sizeof(*this);
return NS_OK;
}
#endif

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

@ -452,13 +452,15 @@ nsAreaFrame::GetFrameName(nsString& aResult) const
return MakeFrameName("Area", aResult);
}
#ifdef DEBUG
NS_IMETHODIMP
nsAreaFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
nsBlockFrame::SizeOf(aHandler, aResult);
*aResult += sizeof(*this) - sizeof(nsBlockFrame);
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
nsBlockFrame::SizeOf(aHandler, aResult);
*aResult += sizeof(*this) - sizeof(nsBlockFrame);
return NS_OK;
}
#endif

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

@ -104,7 +104,9 @@ public:
NS_IMETHOD GetFrameName(nsString& aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
// nsIAreaFrame
NS_IMETHOD GetPositionedInfo(nscoord& aXMost, nscoord& aYMost) const;

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

@ -1054,7 +1054,21 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
if (0 != mFlags) {
fprintf(out, " [flags=%x]", mFlags);
}
fprintf(out, " sc=%p<\n", mStyleContext);
PRInt32 numInlineLines = 0;
PRInt32 numBlockLines = 0;
if (nsnull != mLines) {
nsLineBox* line = mLines;
while (nsnull != line) {
if (line->IsBlock()) {
numBlockLines++;
}
else {
numInlineLines++;
}
line = line->mNext;
}
}
fprintf(out, " sc=%p(i=%d,b=%d)<\n", mStyleContext, numInlineLines, numBlockLines);
aIndent++;
// Output the lines
@ -5490,6 +5504,7 @@ nsBlockFrame::VerifyTree() const
return NS_OK;
}
#ifdef DEBUG
NS_IMETHODIMP
nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -5523,6 +5538,7 @@ nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sum;
return NS_OK;
}
#endif
//----------------------------------------------------------------------

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

@ -101,7 +101,9 @@ public:
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
NS_IMETHOD VerifyTree() const;
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame);
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,

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

@ -1054,7 +1054,21 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
if (0 != mFlags) {
fprintf(out, " [flags=%x]", mFlags);
}
fprintf(out, " sc=%p<\n", mStyleContext);
PRInt32 numInlineLines = 0;
PRInt32 numBlockLines = 0;
if (nsnull != mLines) {
nsLineBox* line = mLines;
while (nsnull != line) {
if (line->IsBlock()) {
numBlockLines++;
}
else {
numInlineLines++;
}
line = line->mNext;
}
}
fprintf(out, " sc=%p(i=%d,b=%d)<\n", mStyleContext, numInlineLines, numBlockLines);
aIndent++;
// Output the lines
@ -5490,6 +5504,7 @@ nsBlockFrame::VerifyTree() const
return NS_OK;
}
#ifdef DEBUG
NS_IMETHODIMP
nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -5523,6 +5538,7 @@ nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sum;
return NS_OK;
}
#endif
//----------------------------------------------------------------------

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

@ -1054,7 +1054,21 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
if (0 != mFlags) {
fprintf(out, " [flags=%x]", mFlags);
}
fprintf(out, " sc=%p<\n", mStyleContext);
PRInt32 numInlineLines = 0;
PRInt32 numBlockLines = 0;
if (nsnull != mLines) {
nsLineBox* line = mLines;
while (nsnull != line) {
if (line->IsBlock()) {
numBlockLines++;
}
else {
numInlineLines++;
}
line = line->mNext;
}
}
fprintf(out, " sc=%p(i=%d,b=%d)<\n", mStyleContext, numInlineLines, numBlockLines);
aIndent++;
// Output the lines
@ -5490,6 +5504,7 @@ nsBlockFrame::VerifyTree() const
return NS_OK;
}
#ifdef DEBUG
NS_IMETHODIMP
nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -5523,6 +5538,7 @@ nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sum;
return NS_OK;
}
#endif
//----------------------------------------------------------------------

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

@ -668,12 +668,14 @@ nsContainerFrame::List(FILE* out, PRInt32 aIndent) const
return NS_OK;
}
#ifdef DEBUG
NS_IMETHODIMP
nsContainerFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
*aResult = sizeof(*this);
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
*aResult = sizeof(*this);
return NS_OK;
}
#endif

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

@ -50,7 +50,9 @@ public:
nsIFrame* aOldFrame,
nsIFrame* aNewFrame);
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
// nsIHTMLReflow overrides
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,

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

@ -93,8 +93,8 @@ PRInt32 fTrackerAddListMax = 0;
void ForceDrawFrame(nsFrame * aFrame);
//non Hack prototypes
static void GetLastLeaf(nsIFrame **aFrame);
static void GetFirstLeaf(nsIFrame **aFrame);
#if 0
static void GetFirstLeaf(nsIFrame **aFrame);
static void RefreshContentFrames(nsIPresContext& aPresContext, nsIContent * aStartContent, nsIContent * aEndContent);
#endif
@ -682,7 +682,7 @@ nsFrame::Paint(nsIPresContext& aPresContext,
SelectionDetails *details;
PRInt32 offset;
if (NS_SUCCEEDED(result) && newContent){
nsresult result = newContent->IndexOf(mContent, offset);
result = newContent->IndexOf(mContent, offset);
if (NS_FAILED(result))
{
return result;
@ -709,7 +709,7 @@ nsFrame::Paint(nsIPresContext& aPresContext,
nsRect drawrect(1, 1, rect.width, rect.height);
aRenderingContext.DrawRect(drawrect );
SelectionDetails *deletingDetails = details;
while(deletingDetails = details->mNext){
while((deletingDetails = details->mNext)){
delete details;
details = deletingDetails;
}
@ -1589,11 +1589,15 @@ nsFrame::DumpBaseRegressionData(FILE* out, PRInt32 aIndent)
NS_IMETHODIMP
nsFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
*aResult = sizeof(*this);
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
#ifdef DEBUG
*aResult = sizeof(*this);
#else
*aResult = 0;
#endif
return NS_OK;
}
NS_IMETHODIMP
@ -1682,7 +1686,13 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIFocusTracker *aTracker,
//magic numbers aLineStart will be -1 for end of block 0 will be start of block
if (!aBlockFrame)
return NS_ERROR_NULL_POINTER;
PRInt32 thisLine = 0;
if (aResultFrame) {
*aResultFrame = nsnull;
}
if (aResultContent) {
*aResultContent = nsnull;
}
nsresult result;
nsCOMPtr<nsILineIterator> it;
result = aBlockFrame->QueryInterface(nsILineIterator::GetIID(),getter_AddRefs(it));
@ -1788,7 +1798,6 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIFocusTracker *aTracker,
result = resultFrame->GetPosition(*(context.get()),aDesiredX,
aResultContent,*aContentOffset, *aContentOffset);
PRBool breakOut = PR_FALSE;
if (NS_SUCCEEDED(result))
found = PR_TRUE;
else {
@ -1818,7 +1827,6 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIFocusTracker *aTracker,
result = resultFrame->GetPosition(*(context.get()),aDesiredX,
aResultContent,*aContentOffset, *aContentOffset);
PRBool breakOut = PR_FALSE;
if (NS_SUCCEEDED(result))
found = PR_TRUE;
else {
@ -1873,7 +1881,6 @@ nsFrame::PeekOffset(nsIFocusTracker *aTracker,
if (!aTracker)
return NS_ERROR_NULL_POINTER;
nscoord coord = aDesiredX;
nsCOMPtr<nsILineIterator> it;
nsIFrame *blockFrame = this;
nsIFrame *thisBlock = this;
@ -2039,7 +2046,7 @@ void ForceDrawFrame(nsFrame * aFrame)//, PRBool)
}
void
static void
GetLastLeaf(nsIFrame **aFrame)
{
if (!aFrame || !*aFrame)
@ -2059,6 +2066,7 @@ GetLastLeaf(nsIFrame **aFrame)
*aFrame = child;
}
#if 0
void
GetFirstLeaf(nsIFrame **aFrame)
{
@ -2075,6 +2083,7 @@ GetFirstLeaf(nsIFrame **aFrame)
*aFrame = child;
}
}
#endif
#ifdef NS_DEBUG
static void

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

@ -266,6 +266,7 @@ HRuleFrame::GetFrameType(nsIAtom** aType) const
return NS_OK;
}
#ifdef DEBUG
NS_IMETHODIMP
HRuleFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -275,3 +276,4 @@ HRuleFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sizeof(*this);
return NS_OK;
}
#endif

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

@ -452,6 +452,7 @@ RootFrame::GetFrameName(nsString& aResult) const
return MakeFrameName("Root", aResult);
}
#ifdef DEBUG
NS_IMETHODIMP
RootFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -461,3 +462,4 @@ RootFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sizeof(*this);
return NS_OK;
}
#endif

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

@ -373,16 +373,19 @@ nsHTMLImageLoader::GetLoadStatus() const
return loadStatus;
}
#ifdef DEBUG
// Note: this doesn't factor in:
// -- the mBaseURL (it might be shared)
// -- the mFrame (that will be counted elsewhere most likely)
// -- the mClosure (we don't know what type it is)
// -- the mImageLoader (it might be shared)
PRUint32
nsHTMLImageLoader::GetDataSize() const
void
nsHTMLImageLoader::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
PRUint32 sum = sizeof(*this);
sum += sizeof(PRUnichar) * mURLSpec.Length() +
sizeof(PRUnichar) * mURL.Length();
return sum;
PRUint32 sum = sizeof(*this) - sizeof(mURLSpec) - sizeof(mURL);
PRUint32 ss;
mURLSpec.SizeOf(aHandler, &ss); sum += ss;
mURL.SizeOf(aHandler, &ss); sum += ss;
*aResult = sum;
}
#endif

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

@ -26,6 +26,7 @@ class nsIFrame;
class nsImageMap;
class nsIImage;
class nsIURI;
class nsISizeOfHandler;
struct nsHTMLReflowState;
struct nsHTMLReflowMetrics;
struct nsSize;
@ -82,7 +83,9 @@ public:
return mFlags.mHaveComputedSize;
}
PRUint32 GetDataSize() const;
#ifdef DEBUG
void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
protected:
static nsresult ImageLoadCB(nsIPresContext* aPresContext,

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

@ -56,6 +56,7 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#include "nsIDOMHTMLMapElement.h"
#include "nsIStyleSet.h"
#include "nsLayoutAtoms.h"
#include "nsISizeOfHandler.h"
#ifdef DEBUG
#undef NOISY_IMAGE_LOADING
@ -870,16 +871,26 @@ nsImageFrame::GetFrameType(nsIAtom** aType) const
return NS_OK;
}
// Note: this doesn't factor in:
// -- the mImageMap (it might be shared)
#ifdef DEBUG
NS_IMETHODIMP
nsImageFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
PRUint32 sum = sizeof(*this) - sizeof(mImageLoader) +
mImageLoader.GetDataSize();
PRUint32 sum;
mImageLoader.SizeOf(aHandler, &sum);
sum += sizeof(*this) - sizeof(mImageLoader);
if (mImageMap) {
PRBool recorded;
aHandler->RecordObject((void*) mImageMap, &recorded);
if (!recorded) {
PRUint32 mapSize;
mImageMap->SizeOf(aHandler, &mapSize);
aHandler->AddSize(nsLayoutAtoms::imageMap, mapSize);
}
}
*aResult = sum;
return NS_OK;
}
#endif

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

@ -60,7 +60,9 @@ public:
nsIAtom* aAttribute,
PRInt32 aHint);
NS_IMETHOD GetFrameType(nsIAtom** aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
protected:
virtual ~nsImageFrame();

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

@ -78,7 +78,9 @@ public:
const nsString& GetAltText() const { return mAltText; }
PRBool GetSuppress() const { return mSuppressFeedback; }
#ifdef DEBUG
virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
nsString mBase;
nsString mHREF;
@ -105,6 +107,7 @@ Area::~Area()
delete [] mCoords;
}
#ifdef DEBUG
void
Area::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -119,6 +122,7 @@ Area::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sum;
}
}
#endif
#include <stdlib.h>
#define XP_ATOI(_s) ::atoi(_s)
@ -1136,6 +1140,7 @@ nsImageMap::DocumentWillBeDestroyed(nsIDocument *aDocument)
return NS_OK;
}
#ifdef DEBUG
void
nsImageMap::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -1151,3 +1156,4 @@ nsImageMap::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sum;
}
}
#endif

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

@ -62,7 +62,9 @@ public:
void Draw(nsIPresContext& aCX, nsIRenderingContext& aRC);
#ifdef DEBUG
void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
// nsISupports
NS_DECL_ISUPPORTS

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

@ -2180,13 +2180,15 @@ nsFirstLineFrame::Reflow(nsIPresContext& aPresContext,
return rv;
}
#ifdef DEBUG
NS_IMETHODIMP
nsPositionedInlineFrame::SizeOf(nsISizeOfHandler* aHandler,
PRUint32* aResult) const
{
if (aResult) {
*aResult = sizeof(*this);
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
*aResult = sizeof(*this);
return NS_OK;
}
#endif

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

@ -258,7 +258,9 @@ class nsPositionedInlineFrame : public nsInlineFrame
{
public:
NS_IMETHOD Destroy(nsIPresContext& aPresContext);
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,

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

@ -126,13 +126,15 @@ nsLeafFrame::ContentChanged(nsIPresContext* aPresContext,
return rv;
}
#ifdef DEBUG
NS_IMETHODIMP
nsLeafFrame::SizeOf(nsISizeOfHandler* aHandler,
PRUint32* aResult) const
{
if (aResult) {
*aResult = sizeof(*this);
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
*aResult = sizeof(*this);
return NS_OK;
}
#endif

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

@ -41,7 +41,9 @@ public:
NS_IMETHOD ContentChanged(nsIPresContext* aPresContext,
nsIContent* aChild,
nsISupports* aSubContent);
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
protected:
virtual ~nsLeafFrame();

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

@ -114,6 +114,7 @@ nsPlaceholderFrame::List(FILE* out, PRInt32 aIndent) const
return NS_OK;
}
#ifdef DEBUG
NS_IMETHODIMP
nsPlaceholderFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -123,3 +124,4 @@ nsPlaceholderFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sizeof(*this);
return NS_OK;
}
#endif

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

@ -56,7 +56,9 @@ public:
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
protected:
nsIFrame* mOutOfFlowFrame;

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

@ -762,6 +762,7 @@ nsScrollFrame::GetFrameName(nsString& aResult) const
return MakeFrameName("Scroll", aResult);
}
#ifdef DEBUG
NS_IMETHODIMP
nsScrollFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -771,3 +772,4 @@ nsScrollFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sizeof(*this);
return NS_OK;
}
#endif

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

@ -86,7 +86,9 @@ public:
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
protected:
nsScrollFrame();

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

@ -196,12 +196,14 @@ nsSplittableFrame::DumpBaseRegressionData(FILE* out, PRInt32 aIndent)
}
#ifdef DEBUG
NS_IMETHODIMP
nsSplittableFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
*aResult = sizeof(*this);
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
*aResult = sizeof(*this);
return NS_OK;
}
#endif

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

@ -31,7 +31,9 @@ public:
nsIFrame* aPrevInFlow);
NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
// Flow member functions.
NS_IMETHOD GetPrevInFlow(nsIFrame** aPrevInFlow) const;

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

@ -227,7 +227,9 @@ public:
NS_IMETHOD GetFrameName(nsString& aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
NS_IMETHOD GetPosition(nsIPresContext& aCX,
nscoord aXCoord,
@ -440,33 +442,33 @@ public:
protected:
virtual ~nsTextFrame();
// XXX pack this tighter
PRInt32 mContentOffset;
PRInt32 mContentLength;
PRUint32 mFlags;
PRInt32 mColumn;
nscoord mComputedWidth;
};
// Flag information used by rendering code. This information is
// computed by the ResizeReflow code. Remaining bits are used by the
// tab count.
// computed by the ResizeReflow code. The flags are stored in the
// mState variable in the frame class private section.
// Flag indicating that whitespace was skipped
#define TEXT_SKIP_LEADING_WS 0x01
#define TEXT_SKIP_LEADING_WS 0x01000000
#define TEXT_HAS_MULTIBYTE 0x02
#define TEXT_HAS_MULTIBYTE 0x02000000
#define TEXT_BLINK_ON 0x04
#define TEXT_IN_WORD 0x04000000
#define TEXT_IN_WORD 0x08
#define TEXT_TRIMMED_WS 0x10
#define TEXT_TRIMMED_WS 0x08000000
// This bit is set on the first frame in a continuation indicating
// that it was choppsed short because of :first-letter style.
#define TEXT_FIRST_LETTER 0x20
// that it was chopped short because of :first-letter style.
#define TEXT_FIRST_LETTER 0x10000000
// Bits in mState used for reflow flags
#define TEXT_REFLOW_FLAGS 0x7F000000
#define TEXT_BLINK_ON 0x80000000
//----------------------------------------------------------------------
@ -497,7 +499,7 @@ nsTextFrame::nsTextFrame()
nsTextFrame::~nsTextFrame()
{
if (0 != (mFlags & TEXT_BLINK_ON)) {
if (0 != (mState & TEXT_BLINK_ON)) {
NS_ASSERTION(nsnull != gTextBlinker, "corrupted blinker");
gTextBlinker->RemoveFrame(this);
}
@ -574,7 +576,7 @@ nsTextFrame::Paint(nsIPresContext& aPresContext,
if (NS_FRAME_PAINT_LAYER_FOREGROUND != aWhichLayer) {
return NS_OK;
}
if ((0 != (mFlags & TEXT_BLINK_ON)) && gBlinkTextOff) {
if ((0 != (mState & TEXT_BLINK_ON)) && gBlinkTextOff) {
return NS_OK;
}
nsIStyleContext* sc = mStyleContext;
@ -592,7 +594,7 @@ nsTextFrame::Paint(nsIPresContext& aPresContext,
// performance hint.
PRUint32 hints = 0;
aRenderingContext.GetHints(hints);
if ((TEXT_HAS_MULTIBYTE & mFlags) ||
if ((TEXT_HAS_MULTIBYTE & mState) ||
(0 == (hints & NS_RENDERING_HINT_FAST_8BIT_TEXT))) {
// Use PRUnichar rendering routine
PaintUnicodeText(&aPresContext, aRenderingContext, sc, ts, 0, 0);
@ -629,11 +631,11 @@ nsTextFrame::PrepareUnicodeText(nsTextTransformer& aTX,
// Skip over the leading whitespace
PRInt32 n = mContentLength;
if (0 != (mFlags & TEXT_SKIP_LEADING_WS)) {
if (0 != (mState & TEXT_SKIP_LEADING_WS)) {
PRBool isWhitespace;
PRInt32 wordLen, contentLen;
aTX.GetNextWord(PR_FALSE, wordLen, contentLen, isWhitespace);
NS_ASSERTION(isWhitespace, "mFlags and content are out of sync");
NS_ASSERTION(isWhitespace, "mState and content are out of sync");
if (isWhitespace) {
if (nsnull != aIndexes) {
// Point mapping indicies at the same content index since
@ -651,7 +653,7 @@ nsTextFrame::PrepareUnicodeText(nsTextTransformer& aTX,
// Rescan the content and transform it. Stop when we have consumed
// mContentLength characters.
PRBool inWord = (TEXT_IN_WORD & mFlags) ? PR_TRUE : PR_FALSE;
PRBool inWord = (TEXT_IN_WORD & mState) ? PR_TRUE : PR_FALSE;
PRInt32 column = mColumn;
PRInt32 textLength = 0;
while (0 != n) {
@ -719,7 +721,7 @@ nsTextFrame::PrepareUnicodeText(nsTextTransformer& aTX,
}
// Remove trailing whitespace if it was trimmed after reflow
if (TEXT_TRIMMED_WS & mFlags) {
if (TEXT_TRIMMED_WS & mState) {
if (--dst >= aBuffer) {
PRUnichar ch = *dst;
if (XP_IS_SPACE(ch)) {
@ -971,7 +973,6 @@ nsTextFrame::PaintUnicodeText(nsIPresContext* aPresContext,
SelectionDetails *details = nsnull;
nsCOMPtr<nsIPresShell> shell;
nsCOMPtr<nsIFrameSelection> frameSelection;
PRBool drawSelected = PR_FALSE;
nsresult rv = aPresContext->GetShell(getter_AddRefs(shell));
if (NS_SUCCEEDED(rv) && shell){
@ -1066,12 +1067,12 @@ nsTextFrame::GetPositionSlowly(nsIPresContext& aPresContext,
GetOffsetFromView(origin, &view);
nscoord charWidth,widthsofar = 0;
PRInt32 index = 0;
PRInt32 indx = 0;
PRBool found = PR_FALSE;
PRUnichar* startBuf = paintBuf;
nsIFontMetrics* lastFont = ts.mLastFont;
for (; --textLength >= 0; paintBuf++,index++) {
for (; --textLength >= 0; paintBuf++,indx++) {
nsIFontMetrics* nextFont;
nscoord glyphWidth;
PRUnichar ch = *paintBuf;
@ -1104,12 +1105,12 @@ nsTextFrame::GetPositionSlowly(nsIPresContext& aPresContext,
}
if ((aXCoord - origin.x) >= widthsofar && (aXCoord - origin.x) <= (widthsofar + glyphWidth)){
if ( ((aXCoord - origin.x) - widthsofar) <= (glyphWidth /2)){
aOffset = index;
aOffset = indx;
found = PR_TRUE;
break;
}
else{
aOffset = index+1;
aOffset = indx+1;
found = PR_TRUE;
break;
}
@ -1423,11 +1424,8 @@ nsTextFrame::PaintTextSlowly(nsIPresContext* aPresContext,
//must set up last one for selection beyond edge if in boundary
ip[mContentLength]++;
}
PRInt32 selectionStartOffset = 0;//frame coordinates
PRInt32 selectionEndOffset = 0;//frame coordinates
nsCOMPtr<nsIPresShell> shell;
nsCOMPtr<nsIFrameSelection> frameSelection;
PRBool drawSelected = PR_FALSE;
nsresult rv = aPresContext->GetShell(getter_AddRefs(shell));
if (NS_SUCCEEDED(rv) && shell){
rv = shell->GetFrameSelection(getter_AddRefs(frameSelection));
@ -1537,11 +1535,8 @@ nsTextFrame::PaintAsciiText(nsIPresContext* aPresContext,
//must set up last one for selection beyond edge if in boundary
ip[mContentLength]++;
}
PRInt32 selectionStartOffset = 0;//frame coordinates
PRInt32 selectionEndOffset = 0;//frame coordinates
nsCOMPtr<nsIPresShell> shell;
nsCOMPtr<nsIFrameSelection> frameSelection;
PRBool drawSelected = PR_FALSE;
nsresult rv = aPresContext->GetShell(getter_AddRefs(shell));
if (NS_SUCCEEDED(rv) && shell){
rv = shell->GetFrameSelection(getter_AddRefs(frameSelection));
@ -1715,7 +1710,7 @@ nsTextFrame::GetPosition(nsIPresContext& aCX,
ip[mContentLength]++;
}
PRInt32 index;
PRInt32 indx;
PRInt32 textWidth = 0;
PRUnichar* text = paintBuf;
nsPoint origin;
@ -1724,14 +1719,14 @@ nsTextFrame::GetPosition(nsIPresContext& aCX,
PRBool found = BinarySearchForPosition(acx, text, origin.x, 0, 0,
PRInt32(textLength),
PRInt32(aXCoord) , //go to local coordinates
index, textWidth);
indx, textWidth);
if (found) {
PRInt32 charWidth;
acx->GetWidth(text[index], charWidth);
acx->GetWidth(text[indx], charWidth);
charWidth /= 2;
if (PRInt32(aXCoord) - origin.x > textWidth+charWidth) {
index++;
indx++;
}
}
@ -1742,7 +1737,7 @@ nsTextFrame::GetPosition(nsIPresContext& aCX,
delete [] paintBuf;
}
aContentOffset = index + mContentOffset;
aContentOffset = indx + mContentOffset;
//reusing wordBufMem
PRInt32 i;
for (i = 0;i <= mContentLength; i ++){
@ -2063,7 +2058,7 @@ nsTextFrame::PeekOffset(nsIFocusTracker *aTracker,
break;
}
}
/* if (aStartOffset == 0 && (mFlags & TEXT_SKIP_LEADING_WS))
/* if (aStartOffset == 0 && (mState & TEXT_SKIP_LEADING_WS))
i--; //back up because we just skipped over some white space. why skip over the char also?
*/
if (i > mContentLength){
@ -2347,18 +2342,18 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
nsLineLayout& lineLayout = *aReflowState.mLineLayout;
TextStyle ts(&aPresContext, *aReflowState.rendContext, mStyleContext);
// Initialize mFlags (without destroying the TEXT_BLINK_ON bit) bits
// that are filled in by the reflow routines.
mFlags &= TEXT_BLINK_ON;
// Clear out the reflow state flags in mState (without destroying
// the TEXT_BLINK_ON bit).
mState &= ~TEXT_REFLOW_FLAGS;
if (ts.mFont->mFont.decorations & NS_STYLE_TEXT_DECORATION_BLINK) {
if (0 == (mFlags & TEXT_BLINK_ON)) {
mFlags |= TEXT_BLINK_ON;
if (0 == (mState & TEXT_BLINK_ON)) {
mState |= TEXT_BLINK_ON;
gTextBlinker->AddFrame(this);
}
}
else {
if (0 != (mFlags & TEXT_BLINK_ON)) {
mFlags &= ~TEXT_BLINK_ON;
if (0 != (mState & TEXT_BLINK_ON)) {
mState &= ~TEXT_BLINK_ON;
gTextBlinker->RemoveFrame(this);
}
}
@ -2410,11 +2405,11 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
// is only valid for one pass through the measuring loop.
PRBool inWord = lineLayout.InWord() ||
((nsnull != mPrevInFlow) &&
(((nsTextFrame*)mPrevInFlow)->mFlags & TEXT_FIRST_LETTER));
(((nsTextFrame*)mPrevInFlow)->mState & TEXT_FIRST_LETTER));
if (inWord) {
mFlags |= TEXT_IN_WORD;
mState |= TEXT_IN_WORD;
}
mFlags &= ~TEXT_FIRST_LETTER;
mState &= ~TEXT_FIRST_LETTER;
PRInt32 column = lineLayout.GetColumn();
PRInt32 prevColumn = column;
@ -2451,7 +2446,7 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
skipWhitespace = PR_FALSE;
// Only set flag when we actually do skip whitespace
mFlags |= TEXT_SKIP_LEADING_WS;
mState |= TEXT_SKIP_LEADING_WS;
continue;
}
if ('\t' == bp[0]) {
@ -2512,7 +2507,7 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
}
}
if (tx.HasMultibyte()) {
mFlags |= TEXT_HAS_MULTIBYTE;
mState |= TEXT_HAS_MULTIBYTE;
}
// Post processing logic to deal with word-breaking that spans
@ -2617,7 +2612,7 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
if (justDidFirstLetter) {
lineLayout.SetFirstLetterFrame(this);
lineLayout.SetFirstLetterStyleOK(PR_FALSE);
mFlags |= TEXT_FIRST_LETTER;
mState |= TEXT_FIRST_LETTER;
}
// Setup metrics for caller; store final max-element-size information
@ -2803,10 +2798,10 @@ nsTextFrame::TrimTrailingWhiteSpace(nsIPresContext* aPresContext,
mComputedWidth -= dw;
}
if (0 != dw) {
mFlags |= TEXT_TRIMMED_WS;
mState |= TEXT_TRIMMED_WS;
}
else {
mFlags &= ~TEXT_TRIMMED_WS;
mState &= ~TEXT_TRIMMED_WS;
}
aDeltaWidth = dw;
return NS_OK;
@ -3074,6 +3069,7 @@ nsTextFrame::GetFrameType(nsIAtom** aType) const
return NS_OK;
}
#ifdef DEBUG
NS_IMETHODIMP
nsTextFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -3083,6 +3079,7 @@ nsTextFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sizeof(*this);
return NS_OK;
}
#endif
NS_IMETHODIMP
nsTextFrame::GetFrameName(nsString& aResult) const
@ -3108,10 +3105,9 @@ nsTextFrame::List(FILE* out, PRInt32 aIndent) const
// Output the first/last content offset and prev/next in flow info
PRBool isComplete = (mContentOffset + mContentLength) == contentLength;
fprintf(out, "[%d,%d,%c][%x] ",
fprintf(out, "[%d,%d,%c] ",
mContentOffset, mContentOffset+mContentLength-1,
isComplete ? 'T':'F',
mFlags);
isComplete ? 'T':'F');
if (nsnull != mNextSibling) {
fprintf(out, " next=%p", mNextSibling);

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

@ -50,12 +50,14 @@ public:
return mArray.Count();
}
#ifdef DEBUG
void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const {
if (aResult) {
mArray.SizeOf(aHandler, aResult);
*aResult += sizeof(this) - sizeof(mArray);
}
}
#endif
nsIFrame* operator[](PRInt32 aIndex) const {
return (nsIFrame*) mArray[aIndex];

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

@ -83,7 +83,9 @@ public:
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
#endif
protected:
nsresult IncrementalReflow(nsIPresContext& aPresContext,
@ -573,6 +575,7 @@ ViewportFrame::GetFrameName(nsString& aResult) const
return MakeFrameName("Viewport", aResult);
}
#ifdef DEBUG
NS_IMETHODIMP
ViewportFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
@ -582,3 +585,4 @@ ViewportFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
*aResult = sizeof(*this);
return NS_OK;
}
#endif

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

@ -63,10 +63,10 @@ nsresult NS_NewGfxAutoTextControlFrame(nsIFrame** aNewFrame)
char* nsGfxAutoTextControlFrame::eventName[] = {"onstartlookup", "onautocomplete"};
nsGfxAutoTextControlFrame::nsGfxAutoTextControlFrame() :
mLookupInterval(300),
mLookupTimer(nsnull),
mUseBlurr(PR_FALSE)
nsGfxAutoTextControlFrame::nsGfxAutoTextControlFrame()
: mUseBlurr(PR_FALSE),
mLookupTimer(nsnull),
mLookupInterval(300)
{
PRInt32 i;
for (i = 0; i < LAST_ID; i ++)

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

@ -1444,6 +1444,59 @@ void nsGfxTextControlFrame::RemoveNewlines(nsString &aString)
aString.StripChars(badChars);
}
NS_IMETHODIMP
nsGfxTextControlFrame::List(FILE* out, PRInt32 aIndent) const
{
IndentBy(out, aIndent);
ListTag(out);
nsIView* view;
GetView(&view);
if (nsnull != view) {
fprintf(out, " [view=%p]", view);
}
fprintf(out, " {%d,%d,%d,%d}", mRect.x, mRect.y, mRect.width, mRect.height);
if (0 != mState) {
fprintf(out, " [state=%08x]", mState);
}
fputs("<\n", out);
// Dump out frames contained in interior web-shell
if (mWebShell) {
nsCOMPtr<nsIContentViewer> viewer;
mWebShell->GetContentViewer(getter_AddRefs(viewer));
if (viewer) {
nsCOMPtr<nsIDocumentViewer> docv(do_QueryInterface(viewer));
if (docv) {
nsCOMPtr<nsIPresContext> cx;
docv->GetPresContext(*getter_AddRefs(cx));
if (cx) {
nsCOMPtr<nsIPresShell> shell;
cx->GetShell(getter_AddRefs(shell));
if (shell) {
nsIFrame* rootFrame;
shell->GetRootFrame(&rootFrame);
if (rootFrame) {
rootFrame->List(out, aIndent + 1);
nsCOMPtr<nsIDocument> doc;
docv->GetDocument(*getter_AddRefs(doc));
if (doc) {
nsCOMPtr<nsIContent> rootContent(getter_AddRefs(doc->GetRootContent()));
if (rootContent) {
rootContent->List(out, aIndent + 1);
}
}
}
}
}
}
}
}
IndentBy(out, aIndent);
fputs(">\n", out);
return NS_OK;
}
/*******************************************************************************
* EnderFrameLoadingInfo

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

@ -390,6 +390,7 @@ public:
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
NS_IMETHOD InitTextControl();

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

@ -1150,15 +1150,16 @@ nsPoint nsTableCellFrame::GetCollapseOffset()
return mCollapseOffset;
}
#ifdef DEBUG
NS_IMETHODIMP
nsTableCellFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
}
#endif

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

@ -111,7 +111,9 @@ public:
*/
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
NS_IMETHOD GetFrameName(nsString& aResult) const;

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

@ -175,14 +175,16 @@ nsTableColFrame::GetFrameName(nsString& aResult) const
return MakeFrameName("TableCol", aResult);
}
#ifdef DEBUG
NS_IMETHODIMP
nsTableColFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
}
#endif

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

@ -82,7 +82,9 @@ public:
nsReflowStatus& aStatus);
NS_IMETHOD GetFrameName(nsString& aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
/** return the index of the column the col represents. always >= 0 */
virtual PRInt32 GetColumnIndex ();

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

@ -701,14 +701,16 @@ nsTableColGroupFrame::GetFrameName(nsString& aResult) const
return MakeFrameName("TableColGroup", aResult);
}
#ifdef DEBUG
NS_IMETHODIMP
nsTableColGroupFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
}
#endif

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

@ -79,7 +79,9 @@ public:
nsReflowStatus& aStatus);
NS_IMETHOD GetFrameName(nsString& aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
/** returns the number of columns represented by this group.
* if there are col children, count them (taking into account the span of each)

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

@ -5367,14 +5367,16 @@ PRBool nsTableFrame::ColIsSpannedInto(PRInt32 aColIndex)
}
#ifdef DEBUG
NS_IMETHODIMP
nsTableFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
}
#endif

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

@ -235,7 +235,9 @@ public:
/** @see nsIFrame::GetFrameName */
NS_IMETHOD GetFrameName(nsString& aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
/** get the max border thickness for each edge */
void GetTableBorder(nsMargin &aBorder);

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

@ -1185,14 +1185,16 @@ nsTableOuterFrame::GetFrameName(nsString& aResult) const
return MakeFrameName("TableOuter", aResult);
}
#ifdef DEBUG
NS_IMETHODIMP
nsTableOuterFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
}
#endif

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

@ -92,7 +92,9 @@ public:
/** @see nsIFrame::GetFrameName */
NS_IMETHOD GetFrameName(nsString& aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
/** SetSelected needs to be overridden to talk to inner tableframe
*/

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

@ -1587,14 +1587,16 @@ nsTableRowFrame::GetFrameName(nsString& aResult) const
return MakeFrameName("TableRow", aResult);
}
#ifdef DEBUG
NS_IMETHODIMP
nsTableRowFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
}
#endif

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

@ -149,7 +149,9 @@ public:
NS_IMETHOD GetFrameName(nsString& aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
/** set mTallestCell to 0 in anticipation of recalculating it */
void ResetMaxChildHeight();

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

@ -1562,14 +1562,16 @@ nsTableRowGroupFrame::GetFrameName(nsString& aResult) const
}
#ifdef DEBUG
NS_IMETHODIMP
nsTableRowGroupFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
}
#endif

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

@ -154,7 +154,9 @@ public:
*/
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
NS_IMETHOD GetFrameName(nsString& aResult) const;

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

@ -1150,15 +1150,16 @@ nsPoint nsTableCellFrame::GetCollapseOffset()
return mCollapseOffset;
}
#ifdef DEBUG
NS_IMETHODIMP
nsTableCellFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
}
#endif

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

@ -111,7 +111,9 @@ public:
*/
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
NS_IMETHOD GetFrameName(nsString& aResult) const;

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

@ -175,14 +175,16 @@ nsTableColFrame::GetFrameName(nsString& aResult) const
return MakeFrameName("TableCol", aResult);
}
#ifdef DEBUG
NS_IMETHODIMP
nsTableColFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
}
#endif

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

@ -82,7 +82,9 @@ public:
nsReflowStatus& aStatus);
NS_IMETHOD GetFrameName(nsString& aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
/** return the index of the column the col represents. always >= 0 */
virtual PRInt32 GetColumnIndex ();

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

@ -701,14 +701,16 @@ nsTableColGroupFrame::GetFrameName(nsString& aResult) const
return MakeFrameName("TableColGroup", aResult);
}
#ifdef DEBUG
NS_IMETHODIMP
nsTableColGroupFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
}
#endif

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

@ -79,7 +79,9 @@ public:
nsReflowStatus& aStatus);
NS_IMETHOD GetFrameName(nsString& aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
/** returns the number of columns represented by this group.
* if there are col children, count them (taking into account the span of each)

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

@ -5367,14 +5367,16 @@ PRBool nsTableFrame::ColIsSpannedInto(PRInt32 aColIndex)
}
#ifdef DEBUG
NS_IMETHODIMP
nsTableFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
}
#endif

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

@ -235,7 +235,9 @@ public:
/** @see nsIFrame::GetFrameName */
NS_IMETHOD GetFrameName(nsString& aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
/** get the max border thickness for each edge */
void GetTableBorder(nsMargin &aBorder);

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

@ -1185,14 +1185,16 @@ nsTableOuterFrame::GetFrameName(nsString& aResult) const
return MakeFrameName("TableOuter", aResult);
}
#ifdef DEBUG
NS_IMETHODIMP
nsTableOuterFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
}
#endif

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

@ -92,7 +92,9 @@ public:
/** @see nsIFrame::GetFrameName */
NS_IMETHOD GetFrameName(nsString& aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
/** SetSelected needs to be overridden to talk to inner tableframe
*/

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

@ -1587,14 +1587,16 @@ nsTableRowFrame::GetFrameName(nsString& aResult) const
return MakeFrameName("TableRow", aResult);
}
#ifdef DEBUG
NS_IMETHODIMP
nsTableRowFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
}
#endif

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

@ -149,7 +149,9 @@ public:
NS_IMETHOD GetFrameName(nsString& aResult) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
/** set mTallestCell to 0 in anticipation of recalculating it */
void ResetMaxChildHeight();

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

@ -1562,14 +1562,16 @@ nsTableRowGroupFrame::GetFrameName(nsString& aResult) const
}
#ifdef DEBUG
NS_IMETHODIMP
nsTableRowGroupFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const
{
if (aResult) {
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
return NS_ERROR_NULL_POINTER;
PRUint32 sum = sizeof(*this);
// XXX write me
*aResult = sum;
return NS_OK;
}
#endif

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

@ -154,7 +154,9 @@ public:
*/
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
#ifdef DEBUG
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
#endif
NS_IMETHOD GetFrameName(nsString& aResult) const;