mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-11 18:24:02 +00:00
Implemented DumpContent() for parser regression test.
r=rickg a=rickg
This commit is contained in:
parent
fd05532b5f
commit
3483832751
@ -146,6 +146,7 @@ public:
|
||||
NS_IMETHOD GetAttributeCount(PRInt32& aResult) const { aResult = 0; return NS_OK; }
|
||||
|
||||
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const { return NS_OK; }
|
||||
NS_IMETHOD DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const { return NS_OK; }
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
|
||||
NS_IMETHOD HandleDOMEvent(nsIPresContext* aPresContext,
|
||||
nsEvent* aEvent,
|
||||
|
@ -1849,6 +1849,51 @@ nsGenericHTMLElement::List(FILE* out, PRInt32 aIndent) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsGenericHTMLElement::DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const {
|
||||
NS_PRECONDITION(nsnull != mDocument, "bad content");
|
||||
|
||||
PRInt32 index;
|
||||
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||
|
||||
nsIAtom* tag;
|
||||
nsAutoString buf;
|
||||
GetTag(tag);
|
||||
if (tag != nsnull) {
|
||||
tag->ToString(buf);
|
||||
fputs("<",out);
|
||||
fputs(buf, out);
|
||||
|
||||
if(aDumpAll) ListAttributes(out);
|
||||
|
||||
fputs(">",out);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
|
||||
PRBool canHaveKids;
|
||||
mContent->CanContainChildren(canHaveKids);
|
||||
if (canHaveKids) {
|
||||
if(aIndent) fputs("\n", out);
|
||||
PRInt32 kids;
|
||||
mContent->ChildCount(kids);
|
||||
for (index = 0; index < kids; index++) {
|
||||
nsIContent* kid;
|
||||
mContent->ChildAt(index, kid);
|
||||
PRInt32 indent=(aIndent)? aIndent+1:0;
|
||||
kid->DumpContent(out,indent,aDumpAll);
|
||||
NS_RELEASE(kid);
|
||||
}
|
||||
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||
fputs("</",out);
|
||||
fputs(buf, out);
|
||||
fputs(">",out);
|
||||
|
||||
if(aIndent) fputs("\n", out);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsGenericHTMLElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult,
|
||||
size_t aInstanceSize) const
|
||||
|
@ -126,6 +126,7 @@ public:
|
||||
nsIAtom*& aPrefix) const;
|
||||
nsresult GetAttributeCount(PRInt32& aResult) const;
|
||||
nsresult List(FILE* out, PRInt32 aIndent) const;
|
||||
nsresult DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const;
|
||||
nsresult SetParentForFormControls(nsIContent* aParent,
|
||||
nsIFormControl* aControl,
|
||||
nsIForm* aForm);
|
||||
|
@ -155,7 +155,10 @@ public:
|
||||
}
|
||||
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const {
|
||||
return mInner.List(out, aIndent);
|
||||
}
|
||||
}
|
||||
NS_IMETHOD DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const {
|
||||
return mInner.DumpContent(out, aIndent,aDumpAll);
|
||||
}
|
||||
NS_IMETHOD BeginConvertToXIF(nsIXIFConverter* aConverter) const {
|
||||
return mInner.BeginConvertToXIF(aConverter);
|
||||
}
|
||||
|
@ -151,6 +151,9 @@ public:
|
||||
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const {
|
||||
return mInner.List(out, aIndent);
|
||||
}
|
||||
NS_IMETHOD DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const {
|
||||
return mInner.DumpContent(out, aIndent,aDumpAll);
|
||||
}
|
||||
NS_IMETHOD BeginConvertToXIF(nsIXIFConverter* aConverter) const {
|
||||
return mInner.BeginConvertToXIF(aConverter);
|
||||
}
|
||||
|
@ -146,6 +146,7 @@ public:
|
||||
NS_IMETHOD GetAttributeCount(PRInt32& aResult) const { aResult = 0; return NS_OK; }
|
||||
|
||||
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const { return NS_OK; }
|
||||
NS_IMETHOD DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const { return NS_OK; }
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const;
|
||||
NS_IMETHOD HandleDOMEvent(nsIPresContext* aPresContext,
|
||||
nsEvent* aEvent,
|
||||
|
@ -1849,6 +1849,51 @@ nsGenericHTMLElement::List(FILE* out, PRInt32 aIndent) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsGenericHTMLElement::DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const {
|
||||
NS_PRECONDITION(nsnull != mDocument, "bad content");
|
||||
|
||||
PRInt32 index;
|
||||
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||
|
||||
nsIAtom* tag;
|
||||
nsAutoString buf;
|
||||
GetTag(tag);
|
||||
if (tag != nsnull) {
|
||||
tag->ToString(buf);
|
||||
fputs("<",out);
|
||||
fputs(buf, out);
|
||||
|
||||
if(aDumpAll) ListAttributes(out);
|
||||
|
||||
fputs(">",out);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
|
||||
PRBool canHaveKids;
|
||||
mContent->CanContainChildren(canHaveKids);
|
||||
if (canHaveKids) {
|
||||
if(aIndent) fputs("\n", out);
|
||||
PRInt32 kids;
|
||||
mContent->ChildCount(kids);
|
||||
for (index = 0; index < kids; index++) {
|
||||
nsIContent* kid;
|
||||
mContent->ChildAt(index, kid);
|
||||
PRInt32 indent=(aIndent)? aIndent+1:0;
|
||||
kid->DumpContent(out,indent,aDumpAll);
|
||||
NS_RELEASE(kid);
|
||||
}
|
||||
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||
fputs("</",out);
|
||||
fputs(buf, out);
|
||||
fputs(">",out);
|
||||
|
||||
if(aIndent) fputs("\n", out);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsGenericHTMLElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult,
|
||||
size_t aInstanceSize) const
|
||||
|
@ -126,6 +126,7 @@ public:
|
||||
nsIAtom*& aPrefix) const;
|
||||
nsresult GetAttributeCount(PRInt32& aResult) const;
|
||||
nsresult List(FILE* out, PRInt32 aIndent) const;
|
||||
nsresult DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const;
|
||||
nsresult SetParentForFormControls(nsIContent* aParent,
|
||||
nsIFormControl* aControl,
|
||||
nsIForm* aForm);
|
||||
|
@ -155,7 +155,10 @@ public:
|
||||
}
|
||||
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const {
|
||||
return mInner.List(out, aIndent);
|
||||
}
|
||||
}
|
||||
NS_IMETHOD DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const {
|
||||
return mInner.DumpContent(out, aIndent,aDumpAll);
|
||||
}
|
||||
NS_IMETHOD BeginConvertToXIF(nsIXIFConverter* aConverter) const {
|
||||
return mInner.BeginConvertToXIF(aConverter);
|
||||
}
|
||||
|
@ -151,6 +151,9 @@ public:
|
||||
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const {
|
||||
return mInner.List(out, aIndent);
|
||||
}
|
||||
NS_IMETHOD DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const {
|
||||
return mInner.DumpContent(out, aIndent,aDumpAll);
|
||||
}
|
||||
NS_IMETHOD BeginConvertToXIF(nsIXIFConverter* aConverter) const {
|
||||
return mInner.BeginConvertToXIF(aConverter);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user