Added DumpRegressionData; revised ListTag; added GetFrameName

This commit is contained in:
kipp%netscape.com 1998-11-19 17:22:29 +00:00
Родитель f1dc36016a
Коммит 63107e9026
103 изменённых файлов: 741 добавлений и 458 удалений

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

@ -1106,11 +1106,14 @@ static void
ShowDiffs(nsIFrame* k1, nsIFrame* k2, const nsRect& r1, const nsRect& r2)
{
printf("verifyreflow: ");
k1->ListTag(stdout);
nsAutoString name;
k1->GetFrameName(name);
fputs(name, stdout);
printf(" ");
stdout << r1;
printf(" != ");
k2->ListTag(stdout);
k2->GetFrameName(name);
fputs(name, stdout);
printf(" ");
stdout << r2;
printf("\n");

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

@ -401,9 +401,27 @@ public:
NS_IMETHOD Scrolled(nsIView *aView) = 0;
// Debugging
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const= 0;
NS_IMETHOD ListTag(FILE* out = stdout) const = 0;
NS_IMETHOD List(FILE* out,
PRInt32 aIndent,
nsIListFilter *aFilter) const = 0;
/**
* Get a printable from of the name of the frame type.
*/
NS_IMETHOD GetFrameName(nsString& aResult) const = 0;
/**
* Called to dump out regression data that describes the layout
* of the frame and it's children, and so on. The format of the
* data is dictated to be XML (using a specific DTD); the
* specific kind of data dumped is up to the frame itself, with
* the caveat that some base types are defined.
* For more information, see XXX.
*/
NS_IMETHOD DumpRegressionData(FILE* out, PRInt32 aIndent) = 0;
NS_IMETHOD VerifyTree() const = 0;
static NS_LAYOUT nsIListFilter * GetFilter(nsString *aFilterName);
/**

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

@ -71,6 +71,11 @@ public:
NS_METHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD GetFrameName(nsString& aResult) const {
return MakeFrameName("FieldSet", aResult);
}
protected:
virtual ~nsFieldSetFrame();

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

@ -332,3 +332,8 @@ nsFileControlFrame::GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
return status;
}
NS_IMETHODIMP
nsFileControlFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("FileControl", aResult);
}

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

@ -39,6 +39,8 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD GetFrameName(nsString& aResult) const;
virtual void MouseClicked(nsIPresContext* aPresContext);
virtual PRInt32 GetMaxNumValues();

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

@ -86,6 +86,10 @@ public:
nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD GetFrameName(nsString& aResult) const {
return MakeFrameName("ButtonControl", aResult);
}
virtual PRBool IsSuccessful(nsIFormControlFrame* aSubmitter);
NS_IMETHOD GetType(PRInt32* aType) const;
NS_IMETHOD GetName(nsString* aName);
@ -452,9 +456,6 @@ nsHTMLButtonControlFrame::HandleEvent(nsIPresContext& aPresContext,
nsIView* grabber;
viewMan->GetMouseEventGrabber(grabber);
if ((grabber == view) || (nsnull == grabber)) {
nsIWidget* window;
PRBool ignore;
switch (aEvent->message) {
case NS_MOUSE_ENTER:
if (mLastMouseState == eMouseDown) {

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

@ -71,6 +71,10 @@ public:
nsGUIEvent* aEvent,
nsEventStatus& aEventStatus);
NS_IMETHOD GetFrameName(nsString& aResult) const {
return MakeFrameName("ImageControl", aResult);
}
virtual void MouseClicked(nsIPresContext* aPresContext);
virtual void SetFormFrame(nsFormFrame* aFormFrame) { mFormFrame = aFormFrame; }

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

@ -197,3 +197,9 @@ nsLegendFrame::IsInline()
{
return mInline;
}
NS_IMETHODIMP
nsLegendFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("Legend", aResult);
}

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

@ -50,6 +50,8 @@ public:
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD GetFrameName(nsString& aResult) const;
PRInt32 GetAlign();
PRBool IsInline();

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

@ -485,3 +485,8 @@ nsTextControlFrame::GetCursor(nsIPresContext& aPresContext, nsPoint& aPoint, PRI
}
NS_IMETHODIMP
nsTextControlFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("TextControl", aResult);
}

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

@ -35,6 +35,8 @@ public:
nsIAtom* aAttribute,
PRInt32 aHint);
NS_IMETHOD GetFrameName(nsString& aResult) const;
virtual void PostCreateWidget(nsIPresContext* aPresContext,
nscoord& aWidth,
nscoord& aHeight);

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

@ -192,6 +192,7 @@ DumpStyleGeneaology(nsIFrame* aFrame, const char* gap)
{
fputs(gap, stdout);
aFrame->ListTag(stdout);
fputs(name, out);
printf(": ");
nsIStyleContext* sc;
aFrame->GetStyleContext(sc);
@ -219,7 +220,7 @@ public:
NS_IMETHOD Paint(nsIPresContext &aCX,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const;
// nsIHTMLReflow
@ -261,10 +262,9 @@ BulletFrame::DeleteFrame(nsIPresContext& aPresContext)
}
NS_IMETHODIMP
BulletFrame::ListTag(FILE* out) const
BulletFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "Bullet(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Bullet", aResult);
}
NS_IMETHODIMP
@ -802,8 +802,7 @@ ListFloaters(FILE* out, PRInt32 aIndent, nsVoidArray* aFloaters)
for (j = aIndent; --j >= 0; ) fputs(" ", out);
nsPlaceholderFrame* ph = (nsPlaceholderFrame*) aFloaters->ElementAt(i);
if (nsnull != ph) {
ph->ListTag(out);
fputs("\n", out);
fprintf(out, "placeholder@%p\n", ph);
nsIFrame* frame = ph->GetAnchoredItem();
if (nsnull != frame) {
frame->List(out, aIndent + 1, nsnull);
@ -1121,13 +1120,15 @@ nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
#ifdef NS_DEBUG
if (!mUnconstrainedWidth && (maxSize.width > 100000)) {
mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", maxSize.width, maxSize.height);
printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height);
maxSize.width = NS_UNCONSTRAINEDSIZE;
mUnconstrainedWidth = PR_TRUE;
}
if (!mUnconstrainedHeight && (maxSize.height > 100000)) {
mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", maxSize.width, maxSize.height);
printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height);
maxSize.height = NS_UNCONSTRAINEDSIZE;
mUnconstrainedHeight = PR_TRUE;
}
@ -1394,8 +1395,8 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
: mStyleContext));
#ifdef NOISY_FIRST_LETTER
if (nsnull != mFirstLetterStyle) {
ListTag(stdout);
printf(": first-letter style found\n");
printf("block(%d)@%p: first-letter style found\n",
ContentIndexInContainer(this), this);
}
#endif
}
@ -1447,20 +1448,9 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aCX,
}
NS_IMETHODIMP
nsBlockFrame::ListTag(FILE* out) const
nsBlockFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "Block<");
if (nsnull != mContent) {
nsIAtom* atom;
mContent->GetTag(atom);
if (nsnull != atom) {
nsAutoString tmp;
atom->ToString(tmp);
fputs(tmp, out);
}
}
fprintf(out, ">(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Block", aResult);
}
NS_METHOD

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

@ -68,7 +68,7 @@ public:
return NS_OK;
}
NS_IMETHOD List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const;
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD VerifyTree() const;
// nsIHTMLReflow

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

@ -192,6 +192,7 @@ DumpStyleGeneaology(nsIFrame* aFrame, const char* gap)
{
fputs(gap, stdout);
aFrame->ListTag(stdout);
fputs(name, out);
printf(": ");
nsIStyleContext* sc;
aFrame->GetStyleContext(sc);
@ -219,7 +220,7 @@ public:
NS_IMETHOD Paint(nsIPresContext &aCX,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const;
// nsIHTMLReflow
@ -261,10 +262,9 @@ BulletFrame::DeleteFrame(nsIPresContext& aPresContext)
}
NS_IMETHODIMP
BulletFrame::ListTag(FILE* out) const
BulletFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "Bullet(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Bullet", aResult);
}
NS_IMETHODIMP
@ -802,8 +802,7 @@ ListFloaters(FILE* out, PRInt32 aIndent, nsVoidArray* aFloaters)
for (j = aIndent; --j >= 0; ) fputs(" ", out);
nsPlaceholderFrame* ph = (nsPlaceholderFrame*) aFloaters->ElementAt(i);
if (nsnull != ph) {
ph->ListTag(out);
fputs("\n", out);
fprintf(out, "placeholder@%p\n", ph);
nsIFrame* frame = ph->GetAnchoredItem();
if (nsnull != frame) {
frame->List(out, aIndent + 1, nsnull);
@ -1121,13 +1120,15 @@ nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
#ifdef NS_DEBUG
if (!mUnconstrainedWidth && (maxSize.width > 100000)) {
mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", maxSize.width, maxSize.height);
printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height);
maxSize.width = NS_UNCONSTRAINEDSIZE;
mUnconstrainedWidth = PR_TRUE;
}
if (!mUnconstrainedHeight && (maxSize.height > 100000)) {
mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", maxSize.width, maxSize.height);
printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height);
maxSize.height = NS_UNCONSTRAINEDSIZE;
mUnconstrainedHeight = PR_TRUE;
}
@ -1394,8 +1395,8 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
: mStyleContext));
#ifdef NOISY_FIRST_LETTER
if (nsnull != mFirstLetterStyle) {
ListTag(stdout);
printf(": first-letter style found\n");
printf("block(%d)@%p: first-letter style found\n",
ContentIndexInContainer(this), this);
}
#endif
}
@ -1447,20 +1448,9 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aCX,
}
NS_IMETHODIMP
nsBlockFrame::ListTag(FILE* out) const
nsBlockFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "Block<");
if (nsnull != mContent) {
nsIAtom* atom;
mContent->GetTag(atom);
if (nsnull != atom) {
nsAutoString tmp;
atom->ToString(tmp);
fputs(tmp, out);
}
}
fprintf(out, ">(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Block", aResult);
}
NS_METHOD

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

@ -192,6 +192,7 @@ DumpStyleGeneaology(nsIFrame* aFrame, const char* gap)
{
fputs(gap, stdout);
aFrame->ListTag(stdout);
fputs(name, out);
printf(": ");
nsIStyleContext* sc;
aFrame->GetStyleContext(sc);
@ -219,7 +220,7 @@ public:
NS_IMETHOD Paint(nsIPresContext &aCX,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const;
// nsIHTMLReflow
@ -261,10 +262,9 @@ BulletFrame::DeleteFrame(nsIPresContext& aPresContext)
}
NS_IMETHODIMP
BulletFrame::ListTag(FILE* out) const
BulletFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "Bullet(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Bullet", aResult);
}
NS_IMETHODIMP
@ -802,8 +802,7 @@ ListFloaters(FILE* out, PRInt32 aIndent, nsVoidArray* aFloaters)
for (j = aIndent; --j >= 0; ) fputs(" ", out);
nsPlaceholderFrame* ph = (nsPlaceholderFrame*) aFloaters->ElementAt(i);
if (nsnull != ph) {
ph->ListTag(out);
fputs("\n", out);
fprintf(out, "placeholder@%p\n", ph);
nsIFrame* frame = ph->GetAnchoredItem();
if (nsnull != frame) {
frame->List(out, aIndent + 1, nsnull);
@ -1121,13 +1120,15 @@ nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
#ifdef NS_DEBUG
if (!mUnconstrainedWidth && (maxSize.width > 100000)) {
mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", maxSize.width, maxSize.height);
printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height);
maxSize.width = NS_UNCONSTRAINEDSIZE;
mUnconstrainedWidth = PR_TRUE;
}
if (!mUnconstrainedHeight && (maxSize.height > 100000)) {
mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", maxSize.width, maxSize.height);
printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height);
maxSize.height = NS_UNCONSTRAINEDSIZE;
mUnconstrainedHeight = PR_TRUE;
}
@ -1394,8 +1395,8 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
: mStyleContext));
#ifdef NOISY_FIRST_LETTER
if (nsnull != mFirstLetterStyle) {
ListTag(stdout);
printf(": first-letter style found\n");
printf("block(%d)@%p: first-letter style found\n",
ContentIndexInContainer(this), this);
}
#endif
}
@ -1447,20 +1448,9 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aCX,
}
NS_IMETHODIMP
nsBlockFrame::ListTag(FILE* out) const
nsBlockFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "Block<");
if (nsnull != mContent) {
nsIAtom* atom;
mContent->GetTag(atom);
if (nsnull != atom) {
nsAutoString tmp;
atom->ToString(tmp);
fputs(tmp, out);
}
}
fprintf(out, ">(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Block", aResult);
}
NS_METHOD

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

@ -468,7 +468,7 @@ nsContainerFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, nsIFrame*
}
top = parent;
}
top->List();
top->List(stdout, 0, nsnull);
}
NS_ASSERTION((0 == childCount) && (nsnull == firstChild),
"deleting !empty next-in-flow");
@ -660,9 +660,12 @@ void nsContainerFrame::AppendChildren(nsIFrame* aChild, PRBool aSetParent)
/////////////////////////////////////////////////////////////////////////////
// Debugging
NS_METHOD nsContainerFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
NS_IMETHODIMP
nsContainerFrame::List(FILE* out, PRInt32 aIndent,
nsIListFilter *aFilter) const
{
// if a filter is present, only output this frame if the filter says we should
// if a filter is present, only output this frame if the filter says
// we should
nsAutoString tagString;
if (nsnull != mContent) {
nsIAtom* tag;
@ -672,15 +675,15 @@ NS_METHOD nsContainerFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFil
NS_RELEASE(tag);
}
}
PRBool outputMe = (PRBool)((nsnull==aFilter) || (PR_TRUE==aFilter->OutputTag(&tagString)));
if (PR_TRUE==outputMe)
{
PRBool outputMe = (nsnull==aFilter) || aFilter->OutputTag(&tagString);
if (outputMe) {
// Indent
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
IndentBy(out, aIndent);
// Output the tag
ListTag(out);
nsIView* view;
GetView(view);
if (nsnull != view) {
@ -700,8 +703,7 @@ NS_METHOD nsContainerFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFil
// Output the children
if (nsnull != mFirstChild) {
if (PR_TRUE==outputMe)
{
if (outputMe) {
if (0 != mState) {
fprintf(out, " [state=%08x]", mState);
}
@ -710,14 +712,12 @@ NS_METHOD nsContainerFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFil
for (nsIFrame* child = mFirstChild; child; child->GetNextSibling(child)) {
child->List(out, aIndent + 1, aFilter);
}
if (PR_TRUE==outputMe)
{
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
if (outputMe) {
IndentBy(out, aIndent);
fputs(">\n", out);
}
} else {
if (PR_TRUE==outputMe)
{
if (outputMe) {
if (0 != mState) {
fprintf(out, " [state=%08x]", mState);
}
@ -728,17 +728,12 @@ NS_METHOD nsContainerFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFil
return NS_OK;
}
#define VERIFY_ASSERT(_expr, _msg) \
if (!(_expr)) { \
DumpTree(); \
} \
NS_ASSERTION(_expr, _msg)
NS_METHOD nsContainerFrame::VerifyTree() const
NS_IMETHODIMP
nsContainerFrame::VerifyTree() const
{
#ifdef NS_DEBUG
NS_ASSERTION(0 == (mState & NS_FRAME_IN_REFLOW), "frame is in reflow");
VERIFY_ASSERT(nsnull == mOverflowList, "bad overflow list");
NS_ASSERTION(nsnull == mOverflowList, "bad overflow list");
#endif
return NS_OK;
}
@ -791,18 +786,4 @@ PRBool nsContainerFrame::IsChild(const nsIFrame* aChild) const
return PR_TRUE;
}
void nsContainerFrame::DumpTree() const
{
nsIFrame* root = (nsIFrame*)this;
nsIFrame* parent = mGeometricParent;
while (nsnull != parent) {
root = parent;
parent->GetGeometricParent(parent);
}
root->List();
}
#endif

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

@ -173,8 +173,6 @@ protected:
* Returns PR_TRUE if aChild is a child of this frame.
*/
PRBool IsChild(const nsIFrame* aChild) const;
void DumpTree() const;
#endif
nsIFrame* mFirstChild;

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

@ -1523,9 +1523,11 @@ PRInt32 nsFrame::ContentIndexInContainer(const nsIFrame* aFrame)
}
// Debugging
NS_IMETHODIMP nsFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
NS_IMETHODIMP
nsFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
{
// if a filter is present, only output this frame if the filter says we should
// if a filter is present, only output this frame if the filter says
// we should
nsAutoString tagString;
if (nsnull != mContent) {
nsIAtom* tag;
@ -1536,10 +1538,9 @@ NS_IMETHODIMP nsFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter)
}
}
if ((nsnull==aFilter) || (PR_TRUE==aFilter->OutputTag(&tagString)))
{
if ((nsnull==aFilter) || aFilter->OutputTag(&tagString)) {
// Indent
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
IndentBy(out, aIndent);
// Output the tag and rect
ListTag(out);
@ -1556,25 +1557,127 @@ NS_IMETHODIMP nsFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter)
return NS_OK;
}
// Output the frame's tag
NS_IMETHODIMP nsFrame::ListTag(FILE* out) const
NS_IMETHODIMP
nsFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("Frame", aResult);
}
nsresult
nsFrame::MakeFrameName(const char* aType, nsString& aResult) const
{
aResult = aType;
aResult.Append("<");
if (nsnull != mContent) {
nsIAtom* tag;
mContent->GetTag(tag);
if (tag != nsnull) {
nsAutoString buf;
tag->ToString(buf);
fputs(buf, out);
aResult.Append(buf);
NS_RELEASE(tag);
}
}
fprintf(out, "(%d)@%p", ContentIndexInContainer(this), this);
char buf[40];
PR_snprintf(buf, sizeof(buf), ">(%d)", ContentIndexInContainer(this));
aResult.Append(buf);
return NS_OK;
}
NS_IMETHODIMP nsFrame::VerifyTree() const
NS_IMETHODIMP
nsFrame::DumpRegressionData(FILE* out, PRInt32 aIndent)
{
IndentBy(out, aIndent);
fprintf(out, "<frame type=\"");
nsAutoString name;
GetFrameName(name);
fputs(name, out);
fprintf(out, "\">\n");
aIndent++;
DumpBaseRegressionData(out, aIndent);
aIndent--;
IndentBy(out, aIndent);
fprintf(out, "</frame>\n");
return NS_OK;
}
void
nsFrame::DumpBaseRegressionData(FILE* out, PRInt32 aIndent)
{
IndentBy(out, aIndent);
fprintf(out, "<ident addr=\"%p\"/>\n", this);
if (mContentParent != mGeometricParent) {
IndentBy(out, aIndent);
fprintf(out, "<content-parent addr=\"%p\"/>\n", mContentParent);
}
if (nsnull != mGeometricParent) {
IndentBy(out, aIndent);
fprintf(out, "<geometric-parent addr=\"%p\"/>\n", mGeometricParent);
}
if (nsnull != mNextSibling) {
IndentBy(out, aIndent);
fprintf(out, "<next-sibling addr=\"%p\"/>\n", mNextSibling);
}
if (0 != mState) {
IndentBy(out, aIndent);
fprintf(out, "<flags value=\"%x\"/>\n", mState);
}
if (nsnull != mView) {
IndentBy(out, aIndent);
fprintf(out, "<view addr=\"%x\">\n", mView);
aIndent++;
// XXX add in code to dump out view state too...
aIndent--;
IndentBy(out, aIndent);
fprintf(out, "</view>\n");
}
IndentBy(out, aIndent);
fprintf(out, "<bbox x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\"/>\n",
mRect.x, mRect.y, mRect.width, mRect.height);
// Now dump all of the children on all of the child lists
nsIFrame* kid;
nsIAtom* list = nsnull;
PRInt32 listIndex = 0;
do {
nsresult rv = FirstChild(list, kid);
if (NS_SUCCEEDED(rv) && (nsnull != kid)) {
IndentBy(out, aIndent);
if (nsnull != list) {
nsAutoString listName;
list->ToString(listName);
fprintf(out, "<child-list name=\"");
fputs(listName, out);
fprintf(out, "\">\n");
}
else {
fprintf(out, "<child-list>\n");
}
aIndent++;
while (nsnull != kid) {
kid->DumpRegressionData(out, aIndent);
kid->GetNextSibling(kid);
}
aIndent--;
IndentBy(out, aIndent);
fprintf(out, "</child-list>\n");
}
NS_IF_RELEASE(list);
GetAdditionalChildListName(listIndex++, list);
} while (nsnull != list);
}
NS_IMETHODIMP
nsFrame::VerifyTree() const
{
NS_ASSERTION(0 == (mState & NS_FRAME_IN_REFLOW), "frame is in reflow");
return NS_OK;

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

@ -24,6 +24,7 @@
#include "nsISelection.h"
#include "nsSelectionRange.h"
#include "nsSelectionPoint.h"
#include "nsString.h"
#include "prlog.h"
/**
@ -183,8 +184,9 @@ public:
NS_IMETHOD SetNextSibling(nsIFrame* aNextSibling);
NS_IMETHOD IsTransparent(PRBool& aTransparent) const;
NS_IMETHOD Scrolled(nsIView *aView);
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const;
NS_IMETHOD ListTag(FILE* out = stdout) const;
NS_IMETHOD List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD DumpRegressionData(FILE* out, PRInt32 aIndent);
NS_IMETHOD VerifyTree() const;
// nsIHTMLReflow
@ -269,6 +271,13 @@ public:
void TraceMsg(const char* fmt, ...);
#endif
void ListTag(FILE* out) const {
nsAutoString tmp;
GetFrameName(tmp);
fputs(tmp, out);
fprintf(out, "@%p", this);
}
protected:
virtual void NewContentIsBefore(nsIPresContext& aPresContext,
nsIRenderingContext * aRendContext,
@ -308,6 +317,23 @@ protected:
void SizeOfWithoutThis(nsISizeOfHandler* aHandler) const;
/**
* Dump out the "base classes" regression data. This should dump
* out the interior data, not the "frame" XML container. And it
* should call the base classes same named method before doing
* anything specific in a derived class. This means that derived
* classes need not override DumpRegressionData unless they need
* some custom behavior that requires changing how the outer "frame"
* XML container is dumped.
*/
virtual void DumpBaseRegressionData(FILE* out, PRInt32 aIndent);
void IndentBy(FILE* out, PRInt32 aIndent) const {
while (--aIndent >= 0) fputs(" ", out);
}
nsresult MakeFrameName(const char* aKind, nsString& aResult) const;
nsRect mRect;
nsIContent* mContent;
nsIStyleContext* mStyleContext;

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

@ -105,7 +105,7 @@ class nsHTMLFrameOuterFrame : public nsHTMLContainerFrame {
public:
nsHTMLFrameOuterFrame(nsIContent* aContent, nsIFrame* aParent);
NS_IMETHOD ListTag(FILE* out = stdout) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
@ -141,7 +141,7 @@ public:
nsHTMLFrameInnerFrame(nsIContent* aContent, nsIFrame* aParentFrame);
NS_IMETHOD ListTag(FILE* out = stdout) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
/**
* @see nsIFrame::Paint
@ -288,11 +288,9 @@ nsHTMLFrameOuterFrame::Paint(nsIPresContext& aPresContext,
}
}
NS_IMETHODIMP nsHTMLFrameOuterFrame::ListTag(FILE* out) const
NS_IMETHODIMP nsHTMLFrameOuterFrame::GetFrameName(nsString& aResult) const
{
nsHTMLContainerFrame::ListTag(out);
fputs(" (OUTER)", out);
return NS_OK;
return MakeFrameName("FrameOuter", aResult);
}
NS_IMETHODIMP
@ -568,11 +566,9 @@ PRInt32 nsHTMLFrameInnerFrame::GetMarginHeight(nsIPresContext* aPresContext, nsI
return marginHeight;
}
NS_IMETHODIMP nsHTMLFrameInnerFrame::ListTag(FILE* out) const
NS_IMETHODIMP nsHTMLFrameInnerFrame::GetFrameName(nsString& aResult) const
{
nsLeafFrame::ListTag(out);
fputs(" (INNER)", out);
return NS_OK;
return MakeFrameName("FrameInner", aResult);
}
NS_METHOD

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

@ -62,7 +62,7 @@ static NS_DEFINE_IID(kIFramesetFrameIID, NS_IFRAMESETFRAME_IID);
class nsHTMLFramesetBorderFrame : public nsLeafFrame {
public:
NS_IMETHOD ListTag(FILE* out = stdout) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
nsGUIEvent* aEvent,
@ -1627,11 +1627,9 @@ nsHTMLFramesetBorderFrame::GetCursor(nsIPresContext& aPresContext,
return NS_OK;
}
NS_IMETHODIMP nsHTMLFramesetBorderFrame::ListTag(FILE* out) const
NS_IMETHODIMP nsHTMLFramesetBorderFrame::GetFrameName(nsString& aResult) const
{
nsLeafFrame::ListTag(out);
fputs(" (BORDER)", out);
return NS_OK;
return MakeFrameName("FramesetBorder", aResult);
}
/*******************************************************************************
@ -1700,6 +1698,6 @@ NS_IMETHODIMP nsHTMLFramesetBlankFrame::List(FILE* out, PRInt32 aIndent) const
{
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out); // Indent
fprintf(out, "%X BLANK \n", this);
return nsLeafFrame::List(out, aIndent);
return nsLeafFrame::List(out, aIndent, nsnull);
}

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

@ -61,7 +61,7 @@ public:
return NS_OK;
}
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
protected:
virtual PRIntn GetSkipSides() const;
@ -264,15 +264,8 @@ RootFrame::HandleEvent(nsIPresContext& aPresContext,
return NS_OK;
}
// Output the frame's tag
NS_IMETHODIMP
RootFrame::ListTag(FILE* out) const
RootFrame::GetFrameName(nsString& aResult) const
{
if (nsnull == mContent) {
fprintf(out, "*Root(-1)@%p", this);
}
else {
return nsFrame::ListTag(out);
}
return NS_OK;
return MakeFrameName("Root", aResult);
}

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

@ -401,9 +401,27 @@ public:
NS_IMETHOD Scrolled(nsIView *aView) = 0;
// Debugging
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const= 0;
NS_IMETHOD ListTag(FILE* out = stdout) const = 0;
NS_IMETHOD List(FILE* out,
PRInt32 aIndent,
nsIListFilter *aFilter) const = 0;
/**
* Get a printable from of the name of the frame type.
*/
NS_IMETHOD GetFrameName(nsString& aResult) const = 0;
/**
* Called to dump out regression data that describes the layout
* of the frame and it's children, and so on. The format of the
* data is dictated to be XML (using a specific DTD); the
* specific kind of data dumped is up to the frame itself, with
* the caveat that some base types are defined.
* For more information, see XXX.
*/
NS_IMETHOD DumpRegressionData(FILE* out, PRInt32 aIndent) = 0;
NS_IMETHOD VerifyTree() const = 0;
static NS_LAYOUT nsIListFilter * GetFilter(nsString *aFilterName);
/**

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

@ -67,7 +67,7 @@ public:
nsIFrame* aParent,
nsIStyleContext* aStyleContext,
nsIFrame*& aContinuingFrame);
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
// nsIHTMLReflow
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout);
@ -1265,16 +1265,7 @@ nsInlineFrame::DrainOverflowLists(nsIPresContext& aPresContext)
}
NS_IMETHODIMP
nsInlineFrame::ListTag(FILE* out) const
nsInlineFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "Inline<");
nsIAtom* atom;
mContent->GetTag(atom);
if (nsnull != atom) {
nsAutoString tmp;
atom->ToString(tmp);
fputs(tmp, out);
}
fprintf(out, ">(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Inline", aResult);
}

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

@ -41,7 +41,9 @@ nsTextRun::List(FILE* out, PRInt32 aIndent)
fprintf(out, "%p: count=%d <", this, n);
for (i = 0; i < n; i++) {
nsIFrame* text = (nsIFrame*) mArray.ElementAt(i);
text->ListTag(out);
nsAutoString tmp;
text->GetFrameName(tmp);
fputs(tmp, out);
printf(" ");
}
fputs(">\n", out);

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

@ -153,17 +153,9 @@ NS_METHOD nsPageFrame::Paint(nsIPresContext& aPresContext,
return NS_OK;
}
NS_METHOD nsPageFrame::ListTag(FILE* out) const
NS_IMETHODIMP
nsPageFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "*Page<");
nsIAtom* atom;
mContent->GetTag(atom);
if (nsnull != atom) {
nsAutoString tmp;
atom->ToString(tmp);
fputs(tmp, out);
}
fprintf(out, ">(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Page", aResult);
}

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

@ -40,7 +40,7 @@ public:
const nsRect& aDirtyRect);
// Debugging
NS_IMETHOD ListTag(FILE* out = stdout) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
};
#endif /* nsPageFrame_h___ */

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

@ -129,9 +129,7 @@ nsPlaceholderFrame::AttributeChanged(nsIPresContext* aPresContext,
}
NS_IMETHODIMP
nsPlaceholderFrame::ListTag(FILE* out) const
nsPlaceholderFrame::GetFrameName(nsString& aResult) const
{
fputs("*placeholder", out);
fprintf(out, "(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Placeholder", aResult);
}

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

@ -61,7 +61,7 @@ public:
nsIAtom* aAttribute,
PRInt32 aHint);
NS_IMETHOD ListTag(FILE* out = stdout) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
protected:
// Constructor. Takes as arguments the content object and the Frame for

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

@ -192,18 +192,9 @@ nsSimplePageSequenceFrame::Reflow(nsIPresContext& aPresContext,
}
NS_IMETHODIMP
nsSimplePageSequenceFrame::ListTag(FILE* out) const
nsSimplePageSequenceFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "*SimplePageSequence<");
nsIAtom* atom;
mContent->GetTag(atom);
if (nsnull != atom) {
nsAutoString tmp;
atom->ToString(tmp);
fputs(tmp, out);
}
fprintf(out, ">(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("SimplePageSequence", aResult);
}
NS_IMETHODIMP

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

@ -39,7 +39,7 @@ public:
const nsRect& aDirtyRect);
// Debugging
NS_IMETHOD ListTag(FILE* out = stdout) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
};
#endif /* nsSimplePageSequence_h___ */

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

@ -123,7 +123,7 @@ public:
NS_IMETHOD List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const;
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD GetPosition(nsIPresContext& aCX,
nsIRenderingContext * aRendContext,
@ -2058,7 +2058,9 @@ TextFrame::ComputeTotalWordWidth(nsLineLayout& aLineLayout,
if ((NS_OK == frame->GetContent(content)) && (nsnull != content)) {
#ifdef DEBUG_WORD_WRAPPING
printf(" next textRun=");
frame->ListTag(stdout);
nsAutoString tmp;
frame->GetFrameName(tmp);
fputs(tmp, stdout);
printf("\n");
#endif
nsITextContent* tc;
@ -2232,10 +2234,9 @@ TextFrame::ToCString(nsString& aBuf, PRInt32& aContentLength) const
}
NS_IMETHODIMP
TextFrame::ListTag(FILE* out) const
TextFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "Text(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Text", aResult);
}
NS_IMETHODIMP

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

@ -162,9 +162,8 @@ nsIFrame* nsAbsoluteFrame::GetContainingBlock() const
return result;
}
NS_IMETHODIMP nsAbsoluteFrame::ListTag(FILE* out) const
NS_IMETHODIMP
nsAbsoluteFrame::GetFrameName(nsString& aResult) const
{
fputs("*absolute", out);
fprintf(out, "(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Absolute", aResult);
}

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

@ -54,7 +54,7 @@ public:
nsIAtom* aAttribute,
PRInt32 aHint);
NS_IMETHOD ListTag(FILE* out = stdout) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
protected:
nsIFrame* mFrame; // the absolutely positioned frame

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

@ -192,6 +192,7 @@ DumpStyleGeneaology(nsIFrame* aFrame, const char* gap)
{
fputs(gap, stdout);
aFrame->ListTag(stdout);
fputs(name, out);
printf(": ");
nsIStyleContext* sc;
aFrame->GetStyleContext(sc);
@ -219,7 +220,7 @@ public:
NS_IMETHOD Paint(nsIPresContext &aCX,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const;
// nsIHTMLReflow
@ -261,10 +262,9 @@ BulletFrame::DeleteFrame(nsIPresContext& aPresContext)
}
NS_IMETHODIMP
BulletFrame::ListTag(FILE* out) const
BulletFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "Bullet(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Bullet", aResult);
}
NS_IMETHODIMP
@ -802,8 +802,7 @@ ListFloaters(FILE* out, PRInt32 aIndent, nsVoidArray* aFloaters)
for (j = aIndent; --j >= 0; ) fputs(" ", out);
nsPlaceholderFrame* ph = (nsPlaceholderFrame*) aFloaters->ElementAt(i);
if (nsnull != ph) {
ph->ListTag(out);
fputs("\n", out);
fprintf(out, "placeholder@%p\n", ph);
nsIFrame* frame = ph->GetAnchoredItem();
if (nsnull != frame) {
frame->List(out, aIndent + 1, nsnull);
@ -1121,13 +1120,15 @@ nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
#ifdef NS_DEBUG
if (!mUnconstrainedWidth && (maxSize.width > 100000)) {
mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", maxSize.width, maxSize.height);
printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height);
maxSize.width = NS_UNCONSTRAINEDSIZE;
mUnconstrainedWidth = PR_TRUE;
}
if (!mUnconstrainedHeight && (maxSize.height > 100000)) {
mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", maxSize.width, maxSize.height);
printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height);
maxSize.height = NS_UNCONSTRAINEDSIZE;
mUnconstrainedHeight = PR_TRUE;
}
@ -1394,8 +1395,8 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
: mStyleContext));
#ifdef NOISY_FIRST_LETTER
if (nsnull != mFirstLetterStyle) {
ListTag(stdout);
printf(": first-letter style found\n");
printf("block(%d)@%p: first-letter style found\n",
ContentIndexInContainer(this), this);
}
#endif
}
@ -1447,20 +1448,9 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aCX,
}
NS_IMETHODIMP
nsBlockFrame::ListTag(FILE* out) const
nsBlockFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "Block<");
if (nsnull != mContent) {
nsIAtom* atom;
mContent->GetTag(atom);
if (nsnull != atom) {
nsAutoString tmp;
atom->ToString(tmp);
fputs(tmp, out);
}
}
fprintf(out, ">(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Block", aResult);
}
NS_METHOD

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

@ -68,7 +68,7 @@ public:
return NS_OK;
}
NS_IMETHOD List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const;
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD VerifyTree() const;
// nsIHTMLReflow

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

@ -192,6 +192,7 @@ DumpStyleGeneaology(nsIFrame* aFrame, const char* gap)
{
fputs(gap, stdout);
aFrame->ListTag(stdout);
fputs(name, out);
printf(": ");
nsIStyleContext* sc;
aFrame->GetStyleContext(sc);
@ -219,7 +220,7 @@ public:
NS_IMETHOD Paint(nsIPresContext &aCX,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const;
// nsIHTMLReflow
@ -261,10 +262,9 @@ BulletFrame::DeleteFrame(nsIPresContext& aPresContext)
}
NS_IMETHODIMP
BulletFrame::ListTag(FILE* out) const
BulletFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "Bullet(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Bullet", aResult);
}
NS_IMETHODIMP
@ -802,8 +802,7 @@ ListFloaters(FILE* out, PRInt32 aIndent, nsVoidArray* aFloaters)
for (j = aIndent; --j >= 0; ) fputs(" ", out);
nsPlaceholderFrame* ph = (nsPlaceholderFrame*) aFloaters->ElementAt(i);
if (nsnull != ph) {
ph->ListTag(out);
fputs("\n", out);
fprintf(out, "placeholder@%p\n", ph);
nsIFrame* frame = ph->GetAnchoredItem();
if (nsnull != frame) {
frame->List(out, aIndent + 1, nsnull);
@ -1121,13 +1120,15 @@ nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
#ifdef NS_DEBUG
if (!mUnconstrainedWidth && (maxSize.width > 100000)) {
mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", maxSize.width, maxSize.height);
printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height);
maxSize.width = NS_UNCONSTRAINEDSIZE;
mUnconstrainedWidth = PR_TRUE;
}
if (!mUnconstrainedHeight && (maxSize.height > 100000)) {
mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", maxSize.width, maxSize.height);
printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height);
maxSize.height = NS_UNCONSTRAINEDSIZE;
mUnconstrainedHeight = PR_TRUE;
}
@ -1394,8 +1395,8 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
: mStyleContext));
#ifdef NOISY_FIRST_LETTER
if (nsnull != mFirstLetterStyle) {
ListTag(stdout);
printf(": first-letter style found\n");
printf("block(%d)@%p: first-letter style found\n",
ContentIndexInContainer(this), this);
}
#endif
}
@ -1447,20 +1448,9 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aCX,
}
NS_IMETHODIMP
nsBlockFrame::ListTag(FILE* out) const
nsBlockFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "Block<");
if (nsnull != mContent) {
nsIAtom* atom;
mContent->GetTag(atom);
if (nsnull != atom) {
nsAutoString tmp;
atom->ToString(tmp);
fputs(tmp, out);
}
}
fprintf(out, ">(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Block", aResult);
}
NS_METHOD

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

@ -192,6 +192,7 @@ DumpStyleGeneaology(nsIFrame* aFrame, const char* gap)
{
fputs(gap, stdout);
aFrame->ListTag(stdout);
fputs(name, out);
printf(": ");
nsIStyleContext* sc;
aFrame->GetStyleContext(sc);
@ -219,7 +220,7 @@ public:
NS_IMETHOD Paint(nsIPresContext &aCX,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const;
// nsIHTMLReflow
@ -261,10 +262,9 @@ BulletFrame::DeleteFrame(nsIPresContext& aPresContext)
}
NS_IMETHODIMP
BulletFrame::ListTag(FILE* out) const
BulletFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "Bullet(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Bullet", aResult);
}
NS_IMETHODIMP
@ -802,8 +802,7 @@ ListFloaters(FILE* out, PRInt32 aIndent, nsVoidArray* aFloaters)
for (j = aIndent; --j >= 0; ) fputs(" ", out);
nsPlaceholderFrame* ph = (nsPlaceholderFrame*) aFloaters->ElementAt(i);
if (nsnull != ph) {
ph->ListTag(out);
fputs("\n", out);
fprintf(out, "placeholder@%p\n", ph);
nsIFrame* frame = ph->GetAnchoredItem();
if (nsnull != frame) {
frame->List(out, aIndent + 1, nsnull);
@ -1121,13 +1120,15 @@ nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
#ifdef NS_DEBUG
if (!mUnconstrainedWidth && (maxSize.width > 100000)) {
mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", maxSize.width, maxSize.height);
printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height);
maxSize.width = NS_UNCONSTRAINEDSIZE;
mUnconstrainedWidth = PR_TRUE;
}
if (!mUnconstrainedHeight && (maxSize.height > 100000)) {
mBlock->ListTag(stdout);
printf(": bad parent: maxSize WAS %d,%d\n", maxSize.width, maxSize.height);
printf(": bad parent: maxSize WAS %d,%d\n",
maxSize.width, maxSize.height);
maxSize.height = NS_UNCONSTRAINEDSIZE;
mUnconstrainedHeight = PR_TRUE;
}
@ -1394,8 +1395,8 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
: mStyleContext));
#ifdef NOISY_FIRST_LETTER
if (nsnull != mFirstLetterStyle) {
ListTag(stdout);
printf(": first-letter style found\n");
printf("block(%d)@%p: first-letter style found\n",
ContentIndexInContainer(this), this);
}
#endif
}
@ -1447,20 +1448,9 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aCX,
}
NS_IMETHODIMP
nsBlockFrame::ListTag(FILE* out) const
nsBlockFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "Block<");
if (nsnull != mContent) {
nsIAtom* atom;
mContent->GetTag(atom);
if (nsnull != atom) {
nsAutoString tmp;
atom->ToString(tmp);
fputs(tmp, out);
}
}
fprintf(out, ">(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Block", aResult);
}
NS_METHOD

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

@ -847,20 +847,9 @@ void nsBodyFrame::ComputeAbsoluteFrameBounds(nsIFrame* aAnchorFra
// Diagnostics
NS_IMETHODIMP
nsBodyFrame::ListTag(FILE* out) const
nsBodyFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "Body<");
if (nsnull != mContent) {
nsIAtom* atom;
mContent->GetTag(atom);
if (nsnull != atom) {
nsAutoString tmp;
atom->ToString(tmp);
fputs(tmp, out);
}
}
fprintf(out, ">(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Body", aResult);
}
NS_IMETHODIMP

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

@ -69,8 +69,8 @@ public:
nsIFrame*& aContinuingFrame);
NS_IMETHOD DidSetStyleContext(nsIPresContext* aPresContext);
NS_METHOD List(FILE* out, PRInt32 aIndent, nsIListFilter* aFilter) const;
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD List(FILE* out, PRInt32 aIndent, nsIListFilter* aFilter) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
// nsIAbsoluteItems
NS_IMETHOD AddAbsoluteItem(nsAbsoluteFrame* aAnchorFrame);

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

@ -468,7 +468,7 @@ nsContainerFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, nsIFrame*
}
top = parent;
}
top->List();
top->List(stdout, 0, nsnull);
}
NS_ASSERTION((0 == childCount) && (nsnull == firstChild),
"deleting !empty next-in-flow");
@ -660,9 +660,12 @@ void nsContainerFrame::AppendChildren(nsIFrame* aChild, PRBool aSetParent)
/////////////////////////////////////////////////////////////////////////////
// Debugging
NS_METHOD nsContainerFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
NS_IMETHODIMP
nsContainerFrame::List(FILE* out, PRInt32 aIndent,
nsIListFilter *aFilter) const
{
// if a filter is present, only output this frame if the filter says we should
// if a filter is present, only output this frame if the filter says
// we should
nsAutoString tagString;
if (nsnull != mContent) {
nsIAtom* tag;
@ -672,15 +675,15 @@ NS_METHOD nsContainerFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFil
NS_RELEASE(tag);
}
}
PRBool outputMe = (PRBool)((nsnull==aFilter) || (PR_TRUE==aFilter->OutputTag(&tagString)));
if (PR_TRUE==outputMe)
{
PRBool outputMe = (nsnull==aFilter) || aFilter->OutputTag(&tagString);
if (outputMe) {
// Indent
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
IndentBy(out, aIndent);
// Output the tag
ListTag(out);
nsIView* view;
GetView(view);
if (nsnull != view) {
@ -700,8 +703,7 @@ NS_METHOD nsContainerFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFil
// Output the children
if (nsnull != mFirstChild) {
if (PR_TRUE==outputMe)
{
if (outputMe) {
if (0 != mState) {
fprintf(out, " [state=%08x]", mState);
}
@ -710,14 +712,12 @@ NS_METHOD nsContainerFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFil
for (nsIFrame* child = mFirstChild; child; child->GetNextSibling(child)) {
child->List(out, aIndent + 1, aFilter);
}
if (PR_TRUE==outputMe)
{
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
if (outputMe) {
IndentBy(out, aIndent);
fputs(">\n", out);
}
} else {
if (PR_TRUE==outputMe)
{
if (outputMe) {
if (0 != mState) {
fprintf(out, " [state=%08x]", mState);
}
@ -728,17 +728,12 @@ NS_METHOD nsContainerFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFil
return NS_OK;
}
#define VERIFY_ASSERT(_expr, _msg) \
if (!(_expr)) { \
DumpTree(); \
} \
NS_ASSERTION(_expr, _msg)
NS_METHOD nsContainerFrame::VerifyTree() const
NS_IMETHODIMP
nsContainerFrame::VerifyTree() const
{
#ifdef NS_DEBUG
NS_ASSERTION(0 == (mState & NS_FRAME_IN_REFLOW), "frame is in reflow");
VERIFY_ASSERT(nsnull == mOverflowList, "bad overflow list");
NS_ASSERTION(nsnull == mOverflowList, "bad overflow list");
#endif
return NS_OK;
}
@ -791,18 +786,4 @@ PRBool nsContainerFrame::IsChild(const nsIFrame* aChild) const
return PR_TRUE;
}
void nsContainerFrame::DumpTree() const
{
nsIFrame* root = (nsIFrame*)this;
nsIFrame* parent = mGeometricParent;
while (nsnull != parent) {
root = parent;
parent->GetGeometricParent(parent);
}
root->List();
}
#endif

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

@ -173,8 +173,6 @@ protected:
* Returns PR_TRUE if aChild is a child of this frame.
*/
PRBool IsChild(const nsIFrame* aChild) const;
void DumpTree() const;
#endif
nsIFrame* mFirstChild;

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

@ -1523,9 +1523,11 @@ PRInt32 nsFrame::ContentIndexInContainer(const nsIFrame* aFrame)
}
// Debugging
NS_IMETHODIMP nsFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
NS_IMETHODIMP
nsFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
{
// if a filter is present, only output this frame if the filter says we should
// if a filter is present, only output this frame if the filter says
// we should
nsAutoString tagString;
if (nsnull != mContent) {
nsIAtom* tag;
@ -1536,10 +1538,9 @@ NS_IMETHODIMP nsFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter)
}
}
if ((nsnull==aFilter) || (PR_TRUE==aFilter->OutputTag(&tagString)))
{
if ((nsnull==aFilter) || aFilter->OutputTag(&tagString)) {
// Indent
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
IndentBy(out, aIndent);
// Output the tag and rect
ListTag(out);
@ -1556,25 +1557,127 @@ NS_IMETHODIMP nsFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter)
return NS_OK;
}
// Output the frame's tag
NS_IMETHODIMP nsFrame::ListTag(FILE* out) const
NS_IMETHODIMP
nsFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("Frame", aResult);
}
nsresult
nsFrame::MakeFrameName(const char* aType, nsString& aResult) const
{
aResult = aType;
aResult.Append("<");
if (nsnull != mContent) {
nsIAtom* tag;
mContent->GetTag(tag);
if (tag != nsnull) {
nsAutoString buf;
tag->ToString(buf);
fputs(buf, out);
aResult.Append(buf);
NS_RELEASE(tag);
}
}
fprintf(out, "(%d)@%p", ContentIndexInContainer(this), this);
char buf[40];
PR_snprintf(buf, sizeof(buf), ">(%d)", ContentIndexInContainer(this));
aResult.Append(buf);
return NS_OK;
}
NS_IMETHODIMP nsFrame::VerifyTree() const
NS_IMETHODIMP
nsFrame::DumpRegressionData(FILE* out, PRInt32 aIndent)
{
IndentBy(out, aIndent);
fprintf(out, "<frame type=\"");
nsAutoString name;
GetFrameName(name);
fputs(name, out);
fprintf(out, "\">\n");
aIndent++;
DumpBaseRegressionData(out, aIndent);
aIndent--;
IndentBy(out, aIndent);
fprintf(out, "</frame>\n");
return NS_OK;
}
void
nsFrame::DumpBaseRegressionData(FILE* out, PRInt32 aIndent)
{
IndentBy(out, aIndent);
fprintf(out, "<ident addr=\"%p\"/>\n", this);
if (mContentParent != mGeometricParent) {
IndentBy(out, aIndent);
fprintf(out, "<content-parent addr=\"%p\"/>\n", mContentParent);
}
if (nsnull != mGeometricParent) {
IndentBy(out, aIndent);
fprintf(out, "<geometric-parent addr=\"%p\"/>\n", mGeometricParent);
}
if (nsnull != mNextSibling) {
IndentBy(out, aIndent);
fprintf(out, "<next-sibling addr=\"%p\"/>\n", mNextSibling);
}
if (0 != mState) {
IndentBy(out, aIndent);
fprintf(out, "<flags value=\"%x\"/>\n", mState);
}
if (nsnull != mView) {
IndentBy(out, aIndent);
fprintf(out, "<view addr=\"%x\">\n", mView);
aIndent++;
// XXX add in code to dump out view state too...
aIndent--;
IndentBy(out, aIndent);
fprintf(out, "</view>\n");
}
IndentBy(out, aIndent);
fprintf(out, "<bbox x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\"/>\n",
mRect.x, mRect.y, mRect.width, mRect.height);
// Now dump all of the children on all of the child lists
nsIFrame* kid;
nsIAtom* list = nsnull;
PRInt32 listIndex = 0;
do {
nsresult rv = FirstChild(list, kid);
if (NS_SUCCEEDED(rv) && (nsnull != kid)) {
IndentBy(out, aIndent);
if (nsnull != list) {
nsAutoString listName;
list->ToString(listName);
fprintf(out, "<child-list name=\"");
fputs(listName, out);
fprintf(out, "\">\n");
}
else {
fprintf(out, "<child-list>\n");
}
aIndent++;
while (nsnull != kid) {
kid->DumpRegressionData(out, aIndent);
kid->GetNextSibling(kid);
}
aIndent--;
IndentBy(out, aIndent);
fprintf(out, "</child-list>\n");
}
NS_IF_RELEASE(list);
GetAdditionalChildListName(listIndex++, list);
} while (nsnull != list);
}
NS_IMETHODIMP
nsFrame::VerifyTree() const
{
NS_ASSERTION(0 == (mState & NS_FRAME_IN_REFLOW), "frame is in reflow");
return NS_OK;

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

@ -24,6 +24,7 @@
#include "nsISelection.h"
#include "nsSelectionRange.h"
#include "nsSelectionPoint.h"
#include "nsString.h"
#include "prlog.h"
/**
@ -183,8 +184,9 @@ public:
NS_IMETHOD SetNextSibling(nsIFrame* aNextSibling);
NS_IMETHOD IsTransparent(PRBool& aTransparent) const;
NS_IMETHOD Scrolled(nsIView *aView);
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const;
NS_IMETHOD ListTag(FILE* out = stdout) const;
NS_IMETHOD List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD DumpRegressionData(FILE* out, PRInt32 aIndent);
NS_IMETHOD VerifyTree() const;
// nsIHTMLReflow
@ -269,6 +271,13 @@ public:
void TraceMsg(const char* fmt, ...);
#endif
void ListTag(FILE* out) const {
nsAutoString tmp;
GetFrameName(tmp);
fputs(tmp, out);
fprintf(out, "@%p", this);
}
protected:
virtual void NewContentIsBefore(nsIPresContext& aPresContext,
nsIRenderingContext * aRendContext,
@ -308,6 +317,23 @@ protected:
void SizeOfWithoutThis(nsISizeOfHandler* aHandler) const;
/**
* Dump out the "base classes" regression data. This should dump
* out the interior data, not the "frame" XML container. And it
* should call the base classes same named method before doing
* anything specific in a derived class. This means that derived
* classes need not override DumpRegressionData unless they need
* some custom behavior that requires changing how the outer "frame"
* XML container is dumped.
*/
virtual void DumpBaseRegressionData(FILE* out, PRInt32 aIndent);
void IndentBy(FILE* out, PRInt32 aIndent) const {
while (--aIndent >= 0) fputs(" ", out);
}
nsresult MakeFrameName(const char* aKind, nsString& aResult) const;
nsRect mRect;
nsIContent* mContent;
nsIStyleContext* mStyleContext;

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

@ -61,7 +61,7 @@ public:
return NS_OK;
}
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
protected:
virtual PRIntn GetSkipSides() const;
@ -264,15 +264,8 @@ RootFrame::HandleEvent(nsIPresContext& aPresContext,
return NS_OK;
}
// Output the frame's tag
NS_IMETHODIMP
RootFrame::ListTag(FILE* out) const
RootFrame::GetFrameName(nsString& aResult) const
{
if (nsnull == mContent) {
fprintf(out, "*Root(-1)@%p", this);
}
else {
return nsFrame::ListTag(out);
}
return NS_OK;
return MakeFrameName("Root", aResult);
}

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

@ -67,7 +67,7 @@ public:
nsIFrame* aParent,
nsIStyleContext* aStyleContext,
nsIFrame*& aContinuingFrame);
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
// nsIHTMLReflow
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout);
@ -1265,16 +1265,7 @@ nsInlineFrame::DrainOverflowLists(nsIPresContext& aPresContext)
}
NS_IMETHODIMP
nsInlineFrame::ListTag(FILE* out) const
nsInlineFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "Inline<");
nsIAtom* atom;
mContent->GetTag(atom);
if (nsnull != atom) {
nsAutoString tmp;
atom->ToString(tmp);
fputs(tmp, out);
}
fprintf(out, ">(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Inline", aResult);
}

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

@ -834,7 +834,9 @@ nsInlineReflow::VerticalAlignFrames(nsRect& aLineBox,
#ifdef NOISY_VERTICAL_ALIGN
printf(" ");
pfd->mFrame->ListTag(stdout);
nsAutoString tmp;
pfd->mFrame->GetFrameName(tmp);
fputs(tmp, stdout);
printf(": yTop=%d minYTop=%d yBottom=%d maxYBottom=%d\n",
yTop, minYTop, yTop + height, maxYBottom);
NS_ASSERTION(yTop >= -1000000, "bad yTop");

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

@ -41,7 +41,9 @@ nsTextRun::List(FILE* out, PRInt32 aIndent)
fprintf(out, "%p: count=%d <", this, n);
for (i = 0; i < n; i++) {
nsIFrame* text = (nsIFrame*) mArray.ElementAt(i);
text->ListTag(out);
nsAutoString tmp;
text->GetFrameName(tmp);
fputs(tmp, out);
printf(" ");
}
fputs(">\n", out);

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

@ -153,17 +153,9 @@ NS_METHOD nsPageFrame::Paint(nsIPresContext& aPresContext,
return NS_OK;
}
NS_METHOD nsPageFrame::ListTag(FILE* out) const
NS_IMETHODIMP
nsPageFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "*Page<");
nsIAtom* atom;
mContent->GetTag(atom);
if (nsnull != atom) {
nsAutoString tmp;
atom->ToString(tmp);
fputs(tmp, out);
}
fprintf(out, ">(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Page", aResult);
}

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

@ -40,7 +40,7 @@ public:
const nsRect& aDirtyRect);
// Debugging
NS_IMETHOD ListTag(FILE* out = stdout) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
};
#endif /* nsPageFrame_h___ */

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

@ -129,9 +129,7 @@ nsPlaceholderFrame::AttributeChanged(nsIPresContext* aPresContext,
}
NS_IMETHODIMP
nsPlaceholderFrame::ListTag(FILE* out) const
nsPlaceholderFrame::GetFrameName(nsString& aResult) const
{
fputs("*placeholder", out);
fprintf(out, "(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Placeholder", aResult);
}

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

@ -61,7 +61,7 @@ public:
nsIAtom* aAttribute,
PRInt32 aHint);
NS_IMETHOD ListTag(FILE* out = stdout) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
protected:
// Constructor. Takes as arguments the content object and the Frame for

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

@ -1106,11 +1106,14 @@ static void
ShowDiffs(nsIFrame* k1, nsIFrame* k2, const nsRect& r1, const nsRect& r2)
{
printf("verifyreflow: ");
k1->ListTag(stdout);
nsAutoString name;
k1->GetFrameName(name);
fputs(name, stdout);
printf(" ");
stdout << r1;
printf(" != ");
k2->ListTag(stdout);
k2->GetFrameName(name);
fputs(name, stdout);
printf(" ");
stdout << r2;
printf("\n");

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

@ -60,7 +60,7 @@ public:
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD ListTag(FILE* out = stdout) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
protected:
virtual PRIntn GetSkipSides() const;
@ -434,21 +434,9 @@ nsScrollFrame::GetSkipSides() const
}
NS_IMETHODIMP
nsScrollFrame::ListTag(FILE* out) const
nsScrollFrame::GetFrameName(nsString& aResult) const
{
fputs("*ScrollFrame<", out);
if (nsnull != mContent) {
nsIAtom* atom;
mContent->GetTag(atom);
if (nsnull != atom) {
nsAutoString tmp;
atom->ToString(tmp);
fputs(tmp, out);
NS_RELEASE(atom);
}
}
fprintf(out, ">(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Scroll", aResult);
}
//----------------------------------------------------------------------

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

@ -192,18 +192,9 @@ nsSimplePageSequenceFrame::Reflow(nsIPresContext& aPresContext,
}
NS_IMETHODIMP
nsSimplePageSequenceFrame::ListTag(FILE* out) const
nsSimplePageSequenceFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "*SimplePageSequence<");
nsIAtom* atom;
mContent->GetTag(atom);
if (nsnull != atom) {
nsAutoString tmp;
atom->ToString(tmp);
fputs(tmp, out);
}
fprintf(out, ">(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("SimplePageSequence", aResult);
}
NS_IMETHODIMP

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

@ -39,7 +39,7 @@ public:
const nsRect& aDirtyRect);
// Debugging
NS_IMETHOD ListTag(FILE* out = stdout) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
};
#endif /* nsSimplePageSequence_h___ */

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

@ -123,7 +123,7 @@ public:
NS_IMETHOD List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const;
NS_IMETHOD ListTag(FILE* out) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD GetPosition(nsIPresContext& aCX,
nsIRenderingContext * aRendContext,
@ -2058,7 +2058,9 @@ TextFrame::ComputeTotalWordWidth(nsLineLayout& aLineLayout,
if ((NS_OK == frame->GetContent(content)) && (nsnull != content)) {
#ifdef DEBUG_WORD_WRAPPING
printf(" next textRun=");
frame->ListTag(stdout);
nsAutoString tmp;
frame->GetFrameName(tmp);
fputs(tmp, stdout);
printf("\n");
#endif
nsITextContent* tc;
@ -2232,10 +2234,9 @@ TextFrame::ToCString(nsString& aBuf, PRInt32& aContentLength) const
}
NS_IMETHODIMP
TextFrame::ListTag(FILE* out) const
TextFrame::GetFrameName(nsString& aResult) const
{
fprintf(out, "Text(%d)@%p", ContentIndexInContainer(this), this);
return NS_OK;
return MakeFrameName("Text", aResult);
}
NS_IMETHODIMP

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

@ -105,7 +105,7 @@ class nsHTMLFrameOuterFrame : public nsHTMLContainerFrame {
public:
nsHTMLFrameOuterFrame(nsIContent* aContent, nsIFrame* aParent);
NS_IMETHOD ListTag(FILE* out = stdout) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
@ -141,7 +141,7 @@ public:
nsHTMLFrameInnerFrame(nsIContent* aContent, nsIFrame* aParentFrame);
NS_IMETHOD ListTag(FILE* out = stdout) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
/**
* @see nsIFrame::Paint
@ -288,11 +288,9 @@ nsHTMLFrameOuterFrame::Paint(nsIPresContext& aPresContext,
}
}
NS_IMETHODIMP nsHTMLFrameOuterFrame::ListTag(FILE* out) const
NS_IMETHODIMP nsHTMLFrameOuterFrame::GetFrameName(nsString& aResult) const
{
nsHTMLContainerFrame::ListTag(out);
fputs(" (OUTER)", out);
return NS_OK;
return MakeFrameName("FrameOuter", aResult);
}
NS_IMETHODIMP
@ -568,11 +566,9 @@ PRInt32 nsHTMLFrameInnerFrame::GetMarginHeight(nsIPresContext* aPresContext, nsI
return marginHeight;
}
NS_IMETHODIMP nsHTMLFrameInnerFrame::ListTag(FILE* out) const
NS_IMETHODIMP nsHTMLFrameInnerFrame::GetFrameName(nsString& aResult) const
{
nsLeafFrame::ListTag(out);
fputs(" (INNER)", out);
return NS_OK;
return MakeFrameName("FrameInner", aResult);
}
NS_METHOD

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

@ -62,7 +62,7 @@ static NS_DEFINE_IID(kIFramesetFrameIID, NS_IFRAMESETFRAME_IID);
class nsHTMLFramesetBorderFrame : public nsLeafFrame {
public:
NS_IMETHOD ListTag(FILE* out = stdout) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
nsGUIEvent* aEvent,
@ -1627,11 +1627,9 @@ nsHTMLFramesetBorderFrame::GetCursor(nsIPresContext& aPresContext,
return NS_OK;
}
NS_IMETHODIMP nsHTMLFramesetBorderFrame::ListTag(FILE* out) const
NS_IMETHODIMP nsHTMLFramesetBorderFrame::GetFrameName(nsString& aResult) const
{
nsLeafFrame::ListTag(out);
fputs(" (BORDER)", out);
return NS_OK;
return MakeFrameName("FramesetBorder", aResult);
}
/*******************************************************************************
@ -1700,6 +1698,6 @@ NS_IMETHODIMP nsHTMLFramesetBlankFrame::List(FILE* out, PRInt32 aIndent) const
{
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out); // Indent
fprintf(out, "%X BLANK \n", this);
return nsLeafFrame::List(out, aIndent);
return nsLeafFrame::List(out, aIndent, nsnull);
}

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

@ -379,3 +379,8 @@ nsButtonControlFrame::GetCID()
return kButtonCID;
}
NS_IMETHODIMP
nsButtonControlFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("ButtonControl", aResult);
}

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

@ -40,6 +40,8 @@ public:
nsIAtom* aAttribute,
PRInt32 aHint);
NS_IMETHOD GetFrameName(nsString& aResult) const;
virtual void PostCreateWidget(nsIPresContext* aPresContext,
nscoord& aWidth,
nscoord& aHeight);

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

@ -49,6 +49,10 @@ public:
nsIAtom* aAttribute,
PRInt32 aHint);
NS_IMETHOD GetFrameName(nsString& aResult) const {
return MakeFrameName("CheckboxControl", aResult);
}
virtual const nsIID& GetCID();
virtual const nsIID& GetIID();

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

@ -71,6 +71,11 @@ public:
NS_METHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD GetFrameName(nsString& aResult) const {
return MakeFrameName("FieldSet", aResult);
}
protected:
virtual ~nsFieldSetFrame();

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

@ -332,3 +332,8 @@ nsFileControlFrame::GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
return status;
}
NS_IMETHODIMP
nsFileControlFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("FileControl", aResult);
}

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

@ -39,6 +39,8 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD GetFrameName(nsString& aResult) const;
virtual void MouseClicked(nsIPresContext* aPresContext);
virtual PRInt32 GetMaxNumValues();

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

@ -86,6 +86,10 @@ public:
nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD GetFrameName(nsString& aResult) const {
return MakeFrameName("ButtonControl", aResult);
}
virtual PRBool IsSuccessful(nsIFormControlFrame* aSubmitter);
NS_IMETHOD GetType(PRInt32* aType) const;
NS_IMETHOD GetName(nsString* aName);
@ -452,9 +456,6 @@ nsHTMLButtonControlFrame::HandleEvent(nsIPresContext& aPresContext,
nsIView* grabber;
viewMan->GetMouseEventGrabber(grabber);
if ((grabber == view) || (nsnull == grabber)) {
nsIWidget* window;
PRBool ignore;
switch (aEvent->message) {
case NS_MOUSE_ENTER:
if (mLastMouseState == eMouseDown) {

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

@ -71,6 +71,10 @@ public:
nsGUIEvent* aEvent,
nsEventStatus& aEventStatus);
NS_IMETHOD GetFrameName(nsString& aResult) const {
return MakeFrameName("ImageControl", aResult);
}
virtual void MouseClicked(nsIPresContext* aPresContext);
virtual void SetFormFrame(nsFormFrame* aFormFrame) { mFormFrame = aFormFrame; }

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

@ -91,6 +91,10 @@ public:
NS_IMETHOD GetFor(nsString& aFor);
NS_IMETHOD GetFrameName(nsString& aResult) const {
return MakeFrameName("Label", aResult);
}
protected:
PRBool FindFirstControl(nsIFrame* aParentFrame, nsIFormControlFrame*& aResultFrame);
PRBool FindForControl(nsIFormControlFrame*& aResultFrame);

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

@ -197,3 +197,9 @@ nsLegendFrame::IsInline()
{
return mInline;
}
NS_IMETHODIMP
nsLegendFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("Legend", aResult);
}

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

@ -50,6 +50,8 @@ public:
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD GetFrameName(nsString& aResult) const;
PRInt32 GetAlign();
PRBool IsInline();

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

@ -298,3 +298,9 @@ nsRadioControlGroup::GetName(nsString& aNameResult) const
{
aNameResult = mName;
}
NS_IMETHODIMP
nsRadioControlFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("RadioControl", aResult);
}

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

@ -40,6 +40,8 @@ public:
nsIAtom* aAttribute,
PRInt32 aHint);
NS_IMETHOD GetFrameName(nsString& aResult) const;
virtual PRBool GetChecked(PRBool aGetInitialValue);
virtual void SetChecked(PRBool aValue, PRBool aSetInitialValue);

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

@ -62,6 +62,10 @@ class nsSelectControlFrame : public nsFormControlFrame {
public:
nsSelectControlFrame(nsIContent* aContent, nsIFrame* aParentFrame);
NS_IMETHOD GetFrameName(nsString& aResult) const {
return MakeFrameName("SelectControl", aResult);
}
virtual nsWidgetInitData* GetWidgetInitData(nsIPresContext& aPresContext);
virtual void PostCreateWidget(nsIPresContext* aPresContext,

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

@ -485,3 +485,8 @@ nsTextControlFrame::GetCursor(nsIPresContext& aPresContext, nsPoint& aPoint, PRI
}
NS_IMETHODIMP
nsTextControlFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("TextControl", aResult);
}

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

@ -35,6 +35,8 @@ public:
nsIAtom* aAttribute,
PRInt32 aHint);
NS_IMETHOD GetFrameName(nsString& aResult) const;
virtual void PostCreateWidget(nsIPresContext* aPresContext,
nscoord& aWidth,
nscoord& aHeight);

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

@ -348,7 +348,9 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
if (kidSize.width > availSize.width)
{
printf("WARNING: cell ");
mFirstChild->ListTag(stdout);
nsAutoString tmp;
mFirstChild->GetFrameName(tmp);
fputs(tmp, stdout);
printf(" content returned desired width %d given avail width %d\n",
kidSize.width, availSize.width);
}
@ -1271,3 +1273,8 @@ void nsTableCellFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter)
#endif
NS_IMETHODIMP
nsTableCellFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("TableCell", aResult);
}

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

@ -74,6 +74,8 @@ public:
nsIStyleContext* aStyleContext,
nsIFrame*& aContinuingFrame);
NS_IMETHOD GetFrameName(nsString& aResult) const;
void VerticallyAlignChild(nsIPresContext* aPresContext);
/** return the mapped cell's row span. Always >= 1. */

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

@ -141,4 +141,10 @@ NS_METHOD nsTableColFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilt
}
return NS_OK;
}
}
NS_IMETHODIMP
nsTableColFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("TableCol", aResult);
}

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

@ -52,6 +52,8 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD GetFrameName(nsString& aResult) const;
/** return the index of the column the col represents. always >= 0 */
virtual int GetColumnIndex ();

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

@ -789,4 +789,8 @@ NS_METHOD nsTableColGroupFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *
return NS_OK;
}
NS_IMETHODIMP
nsTableColGroupFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("TableColGroup", aResult);
}

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

@ -64,6 +64,8 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD GetFrameName(nsString& aResult) const;
/** returns the number of columns represented by this group.
* if there are col children, count them (taking into account the span of each)
* else, check my own span attribute.

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

@ -3881,3 +3881,9 @@ NS_METHOD nsTableFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter)
}
return NS_OK;
}
NS_IMETHODIMP
nsTableFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("Table", aResult);
}

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

@ -163,6 +163,7 @@ public:
*
*/
//virtual void ListColumnLayoutData(FILE* out = stdout, PRInt32 aIndent = 0) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
/** return the width of the column at aColIndex */

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

@ -1327,3 +1327,9 @@ NS_METHOD nsTableOuterFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFi
}
return NS_OK;
}
NS_IMETHODIMP
nsTableOuterFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("TableOuter", aResult);
}

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

@ -70,6 +70,8 @@ public:
nsIStyleContext* aStyleContext,
nsIFrame*& aContinuingFrame);
NS_IMETHOD GetFrameName(nsString& aResult) const;
/** return the min width of the caption. Return 0 if there is no caption. */
nscoord GetMinCaptionWidth();

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

@ -1486,4 +1486,8 @@ NS_METHOD nsTableRowFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilt
return NS_OK;
}
NS_IMETHODIMP
nsTableRowFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("TableRow", aResult);
}

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

@ -101,6 +101,8 @@ public:
nsIFrame* aParent,
nsIStyleContext* aStyleContext,
nsIFrame*& aContinuingFrame);
NS_IMETHOD GetFrameName(nsString& aResult) const;
/** set mTallestCell to 0 in anticipation of recalculating it */
void ResetMaxChildHeight();

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

@ -1332,8 +1332,8 @@ NS_METHOD nsTableRowGroupFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *
return NS_OK;
}
NS_IMETHODIMP
nsTableRowGroupFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("TableRowGroup", aResult);
}

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

@ -89,6 +89,8 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD GetFrameName(nsString& aResult) const;
/** returns the type of the mapped row group content in aType.
* caller MUST call release on the returned object if it is not null.
*

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

@ -348,7 +348,9 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
if (kidSize.width > availSize.width)
{
printf("WARNING: cell ");
mFirstChild->ListTag(stdout);
nsAutoString tmp;
mFirstChild->GetFrameName(tmp);
fputs(tmp, stdout);
printf(" content returned desired width %d given avail width %d\n",
kidSize.width, availSize.width);
}
@ -1271,3 +1273,8 @@ void nsTableCellFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter)
#endif
NS_IMETHODIMP
nsTableCellFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("TableCell", aResult);
}

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

@ -74,6 +74,8 @@ public:
nsIStyleContext* aStyleContext,
nsIFrame*& aContinuingFrame);
NS_IMETHOD GetFrameName(nsString& aResult) const;
void VerticallyAlignChild(nsIPresContext* aPresContext);
/** return the mapped cell's row span. Always >= 1. */

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

@ -141,4 +141,10 @@ NS_METHOD nsTableColFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilt
}
return NS_OK;
}
}
NS_IMETHODIMP
nsTableColFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("TableCol", aResult);
}

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

@ -52,6 +52,8 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD GetFrameName(nsString& aResult) const;
/** return the index of the column the col represents. always >= 0 */
virtual int GetColumnIndex ();

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

@ -789,4 +789,8 @@ NS_METHOD nsTableColGroupFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *
return NS_OK;
}
NS_IMETHODIMP
nsTableColGroupFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("TableColGroup", aResult);
}

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

@ -64,6 +64,8 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD GetFrameName(nsString& aResult) const;
/** returns the number of columns represented by this group.
* if there are col children, count them (taking into account the span of each)
* else, check my own span attribute.

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

@ -3881,3 +3881,9 @@ NS_METHOD nsTableFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter)
}
return NS_OK;
}
NS_IMETHODIMP
nsTableFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("Table", aResult);
}

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

@ -163,6 +163,7 @@ public:
*
*/
//virtual void ListColumnLayoutData(FILE* out = stdout, PRInt32 aIndent = 0) const;
NS_IMETHOD GetFrameName(nsString& aResult) const;
/** return the width of the column at aColIndex */

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

@ -1327,3 +1327,9 @@ NS_METHOD nsTableOuterFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFi
}
return NS_OK;
}
NS_IMETHODIMP
nsTableOuterFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("TableOuter", aResult);
}

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

@ -70,6 +70,8 @@ public:
nsIStyleContext* aStyleContext,
nsIFrame*& aContinuingFrame);
NS_IMETHOD GetFrameName(nsString& aResult) const;
/** return the min width of the caption. Return 0 if there is no caption. */
nscoord GetMinCaptionWidth();

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

@ -1486,4 +1486,8 @@ NS_METHOD nsTableRowFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilt
return NS_OK;
}
NS_IMETHODIMP
nsTableRowFrame::GetFrameName(nsString& aResult) const
{
return MakeFrameName("TableRow", aResult);
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше