diff --git a/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp b/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp index facb70d18ba..8eff71f860b 100644 --- a/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp +++ b/mozilla/htmlparser/src/nsHTMLContentSinkStream.cpp @@ -43,6 +43,30 @@ static char* gDocTypeHeader = " 0) + tag = mHTMLTagStack[mHTMLStackPos-1]; PRBool preformatted = PR_FALSE; @@ -640,7 +678,7 @@ nsHTMLContentSinkStream::AddLeaf(const nsIParserNode& aNode, ostream& aStream){ if (type == eHTMLTag_text) { const nsString& text = aNode.GetText(); - if (preformatted == PR_TRUE) + if ((mDoFormat == PR_FALSE) || preformatted == PR_TRUE) { text.ToCString(gBuffer,sizeof(gBuffer)-1); aStream << gBuffer; @@ -707,7 +745,7 @@ nsHTMLContentSinkStream::AddLeaf(const nsIParserNode& aNode, ostream& aStream){ } else if (type == eHTMLTag_whitespace) { - if (preformatted || IgnoreWS(tag) == PR_FALSE) + if ((mDoFormat == PR_FALSE) || preformatted || IgnoreWS(tag) == PR_FALSE) { const nsString& text = aNode.GetText(); text.ToCString(gBuffer,sizeof(gBuffer)-1); @@ -717,7 +755,7 @@ nsHTMLContentSinkStream::AddLeaf(const nsIParserNode& aNode, ostream& aStream){ } else if (type == eHTMLTag_newline) { - if (preformatted) + if ((mDoFormat == PR_FALSE) || preformatted) { const nsString& text = aNode.GetText(); text.ToCString(gBuffer,sizeof(gBuffer)-1); @@ -792,7 +830,7 @@ nsHTMLContentSinkStream::AddLeaf(const nsIParserNode& aNode){ NS_IMETHODIMP nsHTMLContentSinkStream::WillBuildModel(void){ mTabLevel=-1; - if(mOutput) { + if(mDoHeader && mOutput) { (*mOutput) << gHeaderComment << endl; (*mOutput) << gDocTypeHeader << endl; } @@ -848,7 +886,7 @@ nsHTMLContentSinkStream::WillResume(void) { -PRBool nsHTMLContentSinkStream::IsInline(eHTMLTags aTag) const +PRBool IsInline(eHTMLTags aTag) { PRBool result = PR_FALSE; @@ -894,7 +932,7 @@ PRBool nsHTMLContentSinkStream::IsInline(eHTMLTags aTag) const return result; } -PRBool nsHTMLContentSinkStream::IsBlockLevel(eHTMLTags aTag) const +PRBool IsBlockLevel(eHTMLTags aTag) { return !IsInline(aTag); } @@ -903,7 +941,7 @@ PRBool nsHTMLContentSinkStream::IsBlockLevel(eHTMLTags aTag) const /** * Desired line break state before the open tag. */ -PRBool nsHTMLContentSinkStream::BreakBeforeOpen(eHTMLTags aTag) const { +PRBool BreakBeforeOpen(eHTMLTags aTag) { PRBool result = PR_FALSE; switch (aTag) { @@ -920,7 +958,7 @@ PRBool nsHTMLContentSinkStream::BreakBeforeOpen(eHTMLTags aTag) const { /** * Desired line break state after the open tag. */ -PRBool nsHTMLContentSinkStream::BreakAfterOpen(eHTMLTags aTag) const { +PRBool BreakAfterOpen(eHTMLTags aTag) { PRBool result = PR_FALSE; switch (aTag) { @@ -944,7 +982,7 @@ PRBool nsHTMLContentSinkStream::BreakAfterOpen(eHTMLTags aTag) const { /** * Desired line break state before the close tag. */ -PRBool nsHTMLContentSinkStream::BreakBeforeClose(eHTMLTags aTag) const { +PRBool BreakBeforeClose(eHTMLTags aTag) { PRBool result = PR_FALSE; switch (aTag) @@ -970,7 +1008,7 @@ PRBool nsHTMLContentSinkStream::BreakBeforeClose(eHTMLTags aTag) const { /** * Desired line break state after the close tag. */ -PRBool nsHTMLContentSinkStream::BreakAfterClose(eHTMLTags aTag) const { +PRBool BreakAfterClose(eHTMLTags aTag) { PRBool result = PR_FALSE; switch (aTag) @@ -990,7 +1028,7 @@ PRBool nsHTMLContentSinkStream::BreakAfterClose(eHTMLTags aTag) const { * This implies that BreakAfterOpen() and BreakBeforeClose() * are true no matter what those methods return. */ -PRBool nsHTMLContentSinkStream::IndentChildren(eHTMLTags aTag) const { +PRBool IndentChildren(eHTMLTags aTag) { PRBool result = PR_FALSE; @@ -1016,7 +1054,7 @@ PRBool nsHTMLContentSinkStream::IndentChildren(eHTMLTags aTag) const { * All tags after this tag and before the closing tag will be output with no * formatting. */ -PRBool nsHTMLContentSinkStream::PreformattedChildren(eHTMLTags aTag) const { +PRBool PreformattedChildren(eHTMLTags aTag) { PRBool result = PR_FALSE; if (aTag == eHTMLTag_pre) { @@ -1028,14 +1066,14 @@ PRBool nsHTMLContentSinkStream::PreformattedChildren(eHTMLTags aTag) const { /** * Eat the open tag. Pretty much just for . */ -PRBool nsHTMLContentSinkStream::EatOpen(eHTMLTags aTag) const { +PRBool EatOpen(eHTMLTags aTag) { return PR_FALSE; } /** * Eat the close tag. Pretty much just for

. */ -PRBool nsHTMLContentSinkStream::EatClose(eHTMLTags aTag) const { +PRBool EatClose(eHTMLTags aTag) { return PR_FALSE; } @@ -1047,13 +1085,13 @@ PRBool nsHTMLContentSinkStream::EatClose(eHTMLTags aTag) const { * e.g. there is already WS there or we are after a tag that * has PermitWSAfter*(). */ -PRBool nsHTMLContentSinkStream::PermitWSBeforeOpen(eHTMLTags aTag) const { +PRBool PermitWSBeforeOpen(eHTMLTags aTag) { PRBool result = IsInline(aTag) == PR_FALSE; return result; } /** @see PermitWSBeforeOpen */ -PRBool nsHTMLContentSinkStream::PermitWSAfterOpen(eHTMLTags aTag) const { +PRBool PermitWSAfterOpen(eHTMLTags aTag) { if (aTag == eHTMLTag_pre) { return PR_FALSE; @@ -1062,7 +1100,7 @@ PRBool nsHTMLContentSinkStream::PermitWSAfterOpen(eHTMLTags aTag) const { } /** @see PermitWSBeforeOpen */ -PRBool nsHTMLContentSinkStream::PermitWSBeforeClose(eHTMLTags aTag) const { +PRBool PermitWSBeforeClose(eHTMLTags aTag) { if (aTag == eHTMLTag_pre) { return PR_FALSE; @@ -1071,13 +1109,13 @@ PRBool nsHTMLContentSinkStream::PermitWSBeforeClose(eHTMLTags aTag) const { } /** @see PermitWSBeforeOpen */ -PRBool nsHTMLContentSinkStream::PermitWSAfterClose(eHTMLTags aTag) const { +PRBool PermitWSAfterClose(eHTMLTags aTag) { return PR_TRUE; } /** @see PermitWSBeforeOpen */ -PRBool nsHTMLContentSinkStream::IgnoreWS(eHTMLTags aTag) const { +PRBool IgnoreWS(eHTMLTags aTag) { PRBool result = PR_FALSE; switch (aTag) diff --git a/mozilla/htmlparser/src/nsHTMLContentSinkStream.h b/mozilla/htmlparser/src/nsHTMLContentSinkStream.h index 40e882f553d..5f8ad79eb37 100644 --- a/mozilla/htmlparser/src/nsHTMLContentSinkStream.h +++ b/mozilla/htmlparser/src/nsHTMLContentSinkStream.h @@ -36,8 +36,8 @@ * may choose to override this behavior or set runtime flags for desired results. */ -#ifndef NS_HTMLCONTENTSINK_STREAM -#define NS_HTMLCONTENTSINK_STREAM +#ifndef NS_TXTCONTENTSINK_STREAM +#define NS_TXTCONTENTSINK_STREAM #include "nsIParserNode.h" #include "nsIHTMLContentSink.h" @@ -60,7 +60,7 @@ class nsHTMLContentSinkStream : public nsIHTMLContentSink { * Standard constructor * @update gess7/7/98 */ - nsHTMLContentSinkStream(); + nsHTMLContentSinkStream(PRBool aDoFormat = PR_TRUE, PRBool aDoHeader = PR_TRUE); /** * Constructor with associated stream. If you use this, it means that you want @@ -68,7 +68,7 @@ class nsHTMLContentSinkStream : public nsIHTMLContentSink { * @update gess7/7/98 * @param aStream -- ref to stream where you want output sent */ - nsHTMLContentSinkStream(ostream& aStream); + nsHTMLContentSinkStream(ostream& aStream,PRBool aDoFormat = PR_TRUE, PRBool aDoHeader = PR_TRUE); /** * virtual destructor @@ -76,7 +76,7 @@ class nsHTMLContentSinkStream : public nsIHTMLContentSink { */ virtual ~nsHTMLContentSinkStream(); - void SetOutputStream(ostream& aStream); + NS_IMETHOD_(void) SetOutputStream(ostream& aStream); // nsISupports NS_DECL_ISUPPORTS @@ -123,78 +123,10 @@ protected: void WriteAttributes(const nsIParserNode& aNode,ostream& aStream); void AddStartTag(const nsIParserNode& aNode, ostream& aStream); void AddEndTag(const nsIParserNode& aNode, ostream& aStream); - - PRBool IsInline(eHTMLTags aTag) const; - PRBool IsBlockLevel(eHTMLTags aTag) const; - void AddIndent(ostream& aStream); - /** - * Desired line break state before the open tag. - */ - PRInt32 BreakBeforeOpen(eHTMLTags aTag) const; - /** - * Desired line break state after the open tag. - */ - PRInt32 BreakAfterOpen(eHTMLTags aTag) const; - - /** - * Desired line break state before the close tag. - */ - PRInt32 BreakBeforeClose(eHTMLTags aTag) const; - - /** - * Desired line break state after the close tag. - */ - PRInt32 BreakAfterClose(eHTMLTags aTag) const; - - /** - * Indent/outdent when the open/close tags are encountered. - * This implies that breakAfterOpen() and breakBeforeClose() - * are PR_TRUE no matter what those methods return. - */ - PRBool IndentChildren(eHTMLTags aTag) const; - - /** - * All tags after this tag and before the closing tag will be output with no - * formatting. - */ - PRBool PreformattedChildren(eHTMLTags aTag) const; - - /** - * Eat the close tag. Pretty much just for . - */ - PRBool EatOpen(eHTMLTags aTag) const; - - /** - * Eat the close tag. Pretty much just for

. - */ - PRBool EatClose(eHTMLTags aTag) const; - - /** - * Are we allowed to insert new white space before the open tag. - * - * Returning PR_FALSE does not prevent inserting WS - * before the tag if WS insertion is allowed for another reason, - * e.g. there is already WS there or we are after a tag that - * has PermitWSAfter*(). - */ - PRBool PermitWSBeforeOpen(eHTMLTags aTag) const; - - /** @see PermitWSBeforeOpen */ - PRBool PermitWSAfterOpen(eHTMLTags aTag) const; - - /** @see PermitWSBeforeOpen */ - PRBool PermitWSBeforeClose(eHTMLTags aTag) const; - - /** @see PermitWSBeforeOpen */ - PRBool PermitWSAfterClose(eHTMLTags aTag) const; - - /** Certain structures allow us to ignore the whitespace from the source - * document */ - PRBool IgnoreWS(eHTMLTags aTag) const; protected: @@ -207,11 +139,14 @@ protected: eHTMLTags mHTMLTagStack[1024]; // warning: hard-coded nesting level PRInt32 mColPos; - + PRBool mDoFormat; + PRBool mDoHeader; }; extern NS_HTMLPARS nsresult -NS_New_HTML_ContentSinkStream(nsIHTMLContentSink** aInstancePtrResult); +NS_New_HTML_ContentSinkStream(nsIHTMLContentSink** aInstancePtrResult, + PRBool aDoFormat = PR_TRUE, + PRBool aDoHeader = PR_TRUE); #endif diff --git a/mozilla/htmlparser/src/nsXIFDTD.cpp b/mozilla/htmlparser/src/nsXIFDTD.cpp index be716713c27..72a19d08a82 100644 --- a/mozilla/htmlparser/src/nsXIFDTD.cpp +++ b/mozilla/htmlparser/src/nsXIFDTD.cpp @@ -412,14 +412,6 @@ nsresult nsXIFDTD::WillBuildModel(nsString& aFileName,PRBool aNotifySink){ if(mSink) { -#if defined(WIN32) - const char* filename="c:\\temp\\save.html"; - mOut = new fstream(filename,ios::out); - - ((nsHTMLContentSinkStream*)mSink)->SetOutputStream(*mOut); - -#endif - mSink->WillBuildModel(); } @@ -438,13 +430,6 @@ nsresult nsXIFDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink){ if(mSink) { result = mSink->DidBuildModel(anErrorCode); - - if (mOut != nsnull) - { - mOut->close(); - delete mOut; - } - } return result; diff --git a/mozilla/htmlparser/src/nsXIFDTD.h b/mozilla/htmlparser/src/nsXIFDTD.h index 4d23c556279..2f30c77f50e 100644 --- a/mozilla/htmlparser/src/nsXIFDTD.h +++ b/mozilla/htmlparser/src/nsXIFDTD.h @@ -649,8 +649,6 @@ protected: nsVoidArray mNodeStack; nsVoidArray mTokenStack; - fstream* mOut; - PRInt32 mHTMLStackPos; eHTMLTags mHTMLTagStack[512]; nsAutoString* mHTMLNameStack[512]; diff --git a/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp b/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp index facb70d18ba..8eff71f860b 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp +++ b/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.cpp @@ -43,6 +43,30 @@ static char* gDocTypeHeader = " 0) + tag = mHTMLTagStack[mHTMLStackPos-1]; PRBool preformatted = PR_FALSE; @@ -640,7 +678,7 @@ nsHTMLContentSinkStream::AddLeaf(const nsIParserNode& aNode, ostream& aStream){ if (type == eHTMLTag_text) { const nsString& text = aNode.GetText(); - if (preformatted == PR_TRUE) + if ((mDoFormat == PR_FALSE) || preformatted == PR_TRUE) { text.ToCString(gBuffer,sizeof(gBuffer)-1); aStream << gBuffer; @@ -707,7 +745,7 @@ nsHTMLContentSinkStream::AddLeaf(const nsIParserNode& aNode, ostream& aStream){ } else if (type == eHTMLTag_whitespace) { - if (preformatted || IgnoreWS(tag) == PR_FALSE) + if ((mDoFormat == PR_FALSE) || preformatted || IgnoreWS(tag) == PR_FALSE) { const nsString& text = aNode.GetText(); text.ToCString(gBuffer,sizeof(gBuffer)-1); @@ -717,7 +755,7 @@ nsHTMLContentSinkStream::AddLeaf(const nsIParserNode& aNode, ostream& aStream){ } else if (type == eHTMLTag_newline) { - if (preformatted) + if ((mDoFormat == PR_FALSE) || preformatted) { const nsString& text = aNode.GetText(); text.ToCString(gBuffer,sizeof(gBuffer)-1); @@ -792,7 +830,7 @@ nsHTMLContentSinkStream::AddLeaf(const nsIParserNode& aNode){ NS_IMETHODIMP nsHTMLContentSinkStream::WillBuildModel(void){ mTabLevel=-1; - if(mOutput) { + if(mDoHeader && mOutput) { (*mOutput) << gHeaderComment << endl; (*mOutput) << gDocTypeHeader << endl; } @@ -848,7 +886,7 @@ nsHTMLContentSinkStream::WillResume(void) { -PRBool nsHTMLContentSinkStream::IsInline(eHTMLTags aTag) const +PRBool IsInline(eHTMLTags aTag) { PRBool result = PR_FALSE; @@ -894,7 +932,7 @@ PRBool nsHTMLContentSinkStream::IsInline(eHTMLTags aTag) const return result; } -PRBool nsHTMLContentSinkStream::IsBlockLevel(eHTMLTags aTag) const +PRBool IsBlockLevel(eHTMLTags aTag) { return !IsInline(aTag); } @@ -903,7 +941,7 @@ PRBool nsHTMLContentSinkStream::IsBlockLevel(eHTMLTags aTag) const /** * Desired line break state before the open tag. */ -PRBool nsHTMLContentSinkStream::BreakBeforeOpen(eHTMLTags aTag) const { +PRBool BreakBeforeOpen(eHTMLTags aTag) { PRBool result = PR_FALSE; switch (aTag) { @@ -920,7 +958,7 @@ PRBool nsHTMLContentSinkStream::BreakBeforeOpen(eHTMLTags aTag) const { /** * Desired line break state after the open tag. */ -PRBool nsHTMLContentSinkStream::BreakAfterOpen(eHTMLTags aTag) const { +PRBool BreakAfterOpen(eHTMLTags aTag) { PRBool result = PR_FALSE; switch (aTag) { @@ -944,7 +982,7 @@ PRBool nsHTMLContentSinkStream::BreakAfterOpen(eHTMLTags aTag) const { /** * Desired line break state before the close tag. */ -PRBool nsHTMLContentSinkStream::BreakBeforeClose(eHTMLTags aTag) const { +PRBool BreakBeforeClose(eHTMLTags aTag) { PRBool result = PR_FALSE; switch (aTag) @@ -970,7 +1008,7 @@ PRBool nsHTMLContentSinkStream::BreakBeforeClose(eHTMLTags aTag) const { /** * Desired line break state after the close tag. */ -PRBool nsHTMLContentSinkStream::BreakAfterClose(eHTMLTags aTag) const { +PRBool BreakAfterClose(eHTMLTags aTag) { PRBool result = PR_FALSE; switch (aTag) @@ -990,7 +1028,7 @@ PRBool nsHTMLContentSinkStream::BreakAfterClose(eHTMLTags aTag) const { * This implies that BreakAfterOpen() and BreakBeforeClose() * are true no matter what those methods return. */ -PRBool nsHTMLContentSinkStream::IndentChildren(eHTMLTags aTag) const { +PRBool IndentChildren(eHTMLTags aTag) { PRBool result = PR_FALSE; @@ -1016,7 +1054,7 @@ PRBool nsHTMLContentSinkStream::IndentChildren(eHTMLTags aTag) const { * All tags after this tag and before the closing tag will be output with no * formatting. */ -PRBool nsHTMLContentSinkStream::PreformattedChildren(eHTMLTags aTag) const { +PRBool PreformattedChildren(eHTMLTags aTag) { PRBool result = PR_FALSE; if (aTag == eHTMLTag_pre) { @@ -1028,14 +1066,14 @@ PRBool nsHTMLContentSinkStream::PreformattedChildren(eHTMLTags aTag) const { /** * Eat the open tag. Pretty much just for . */ -PRBool nsHTMLContentSinkStream::EatOpen(eHTMLTags aTag) const { +PRBool EatOpen(eHTMLTags aTag) { return PR_FALSE; } /** * Eat the close tag. Pretty much just for

. */ -PRBool nsHTMLContentSinkStream::EatClose(eHTMLTags aTag) const { +PRBool EatClose(eHTMLTags aTag) { return PR_FALSE; } @@ -1047,13 +1085,13 @@ PRBool nsHTMLContentSinkStream::EatClose(eHTMLTags aTag) const { * e.g. there is already WS there or we are after a tag that * has PermitWSAfter*(). */ -PRBool nsHTMLContentSinkStream::PermitWSBeforeOpen(eHTMLTags aTag) const { +PRBool PermitWSBeforeOpen(eHTMLTags aTag) { PRBool result = IsInline(aTag) == PR_FALSE; return result; } /** @see PermitWSBeforeOpen */ -PRBool nsHTMLContentSinkStream::PermitWSAfterOpen(eHTMLTags aTag) const { +PRBool PermitWSAfterOpen(eHTMLTags aTag) { if (aTag == eHTMLTag_pre) { return PR_FALSE; @@ -1062,7 +1100,7 @@ PRBool nsHTMLContentSinkStream::PermitWSAfterOpen(eHTMLTags aTag) const { } /** @see PermitWSBeforeOpen */ -PRBool nsHTMLContentSinkStream::PermitWSBeforeClose(eHTMLTags aTag) const { +PRBool PermitWSBeforeClose(eHTMLTags aTag) { if (aTag == eHTMLTag_pre) { return PR_FALSE; @@ -1071,13 +1109,13 @@ PRBool nsHTMLContentSinkStream::PermitWSBeforeClose(eHTMLTags aTag) const { } /** @see PermitWSBeforeOpen */ -PRBool nsHTMLContentSinkStream::PermitWSAfterClose(eHTMLTags aTag) const { +PRBool PermitWSAfterClose(eHTMLTags aTag) { return PR_TRUE; } /** @see PermitWSBeforeOpen */ -PRBool nsHTMLContentSinkStream::IgnoreWS(eHTMLTags aTag) const { +PRBool IgnoreWS(eHTMLTags aTag) { PRBool result = PR_FALSE; switch (aTag) diff --git a/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.h b/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.h index 40e882f553d..5f8ad79eb37 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.h +++ b/mozilla/parser/htmlparser/src/nsHTMLContentSinkStream.h @@ -36,8 +36,8 @@ * may choose to override this behavior or set runtime flags for desired results. */ -#ifndef NS_HTMLCONTENTSINK_STREAM -#define NS_HTMLCONTENTSINK_STREAM +#ifndef NS_TXTCONTENTSINK_STREAM +#define NS_TXTCONTENTSINK_STREAM #include "nsIParserNode.h" #include "nsIHTMLContentSink.h" @@ -60,7 +60,7 @@ class nsHTMLContentSinkStream : public nsIHTMLContentSink { * Standard constructor * @update gess7/7/98 */ - nsHTMLContentSinkStream(); + nsHTMLContentSinkStream(PRBool aDoFormat = PR_TRUE, PRBool aDoHeader = PR_TRUE); /** * Constructor with associated stream. If you use this, it means that you want @@ -68,7 +68,7 @@ class nsHTMLContentSinkStream : public nsIHTMLContentSink { * @update gess7/7/98 * @param aStream -- ref to stream where you want output sent */ - nsHTMLContentSinkStream(ostream& aStream); + nsHTMLContentSinkStream(ostream& aStream,PRBool aDoFormat = PR_TRUE, PRBool aDoHeader = PR_TRUE); /** * virtual destructor @@ -76,7 +76,7 @@ class nsHTMLContentSinkStream : public nsIHTMLContentSink { */ virtual ~nsHTMLContentSinkStream(); - void SetOutputStream(ostream& aStream); + NS_IMETHOD_(void) SetOutputStream(ostream& aStream); // nsISupports NS_DECL_ISUPPORTS @@ -123,78 +123,10 @@ protected: void WriteAttributes(const nsIParserNode& aNode,ostream& aStream); void AddStartTag(const nsIParserNode& aNode, ostream& aStream); void AddEndTag(const nsIParserNode& aNode, ostream& aStream); - - PRBool IsInline(eHTMLTags aTag) const; - PRBool IsBlockLevel(eHTMLTags aTag) const; - void AddIndent(ostream& aStream); - /** - * Desired line break state before the open tag. - */ - PRInt32 BreakBeforeOpen(eHTMLTags aTag) const; - /** - * Desired line break state after the open tag. - */ - PRInt32 BreakAfterOpen(eHTMLTags aTag) const; - - /** - * Desired line break state before the close tag. - */ - PRInt32 BreakBeforeClose(eHTMLTags aTag) const; - - /** - * Desired line break state after the close tag. - */ - PRInt32 BreakAfterClose(eHTMLTags aTag) const; - - /** - * Indent/outdent when the open/close tags are encountered. - * This implies that breakAfterOpen() and breakBeforeClose() - * are PR_TRUE no matter what those methods return. - */ - PRBool IndentChildren(eHTMLTags aTag) const; - - /** - * All tags after this tag and before the closing tag will be output with no - * formatting. - */ - PRBool PreformattedChildren(eHTMLTags aTag) const; - - /** - * Eat the close tag. Pretty much just for . - */ - PRBool EatOpen(eHTMLTags aTag) const; - - /** - * Eat the close tag. Pretty much just for

. - */ - PRBool EatClose(eHTMLTags aTag) const; - - /** - * Are we allowed to insert new white space before the open tag. - * - * Returning PR_FALSE does not prevent inserting WS - * before the tag if WS insertion is allowed for another reason, - * e.g. there is already WS there or we are after a tag that - * has PermitWSAfter*(). - */ - PRBool PermitWSBeforeOpen(eHTMLTags aTag) const; - - /** @see PermitWSBeforeOpen */ - PRBool PermitWSAfterOpen(eHTMLTags aTag) const; - - /** @see PermitWSBeforeOpen */ - PRBool PermitWSBeforeClose(eHTMLTags aTag) const; - - /** @see PermitWSBeforeOpen */ - PRBool PermitWSAfterClose(eHTMLTags aTag) const; - - /** Certain structures allow us to ignore the whitespace from the source - * document */ - PRBool IgnoreWS(eHTMLTags aTag) const; protected: @@ -207,11 +139,14 @@ protected: eHTMLTags mHTMLTagStack[1024]; // warning: hard-coded nesting level PRInt32 mColPos; - + PRBool mDoFormat; + PRBool mDoHeader; }; extern NS_HTMLPARS nsresult -NS_New_HTML_ContentSinkStream(nsIHTMLContentSink** aInstancePtrResult); +NS_New_HTML_ContentSinkStream(nsIHTMLContentSink** aInstancePtrResult, + PRBool aDoFormat = PR_TRUE, + PRBool aDoHeader = PR_TRUE); #endif diff --git a/mozilla/parser/htmlparser/src/nsXIFDTD.cpp b/mozilla/parser/htmlparser/src/nsXIFDTD.cpp index be716713c27..72a19d08a82 100644 --- a/mozilla/parser/htmlparser/src/nsXIFDTD.cpp +++ b/mozilla/parser/htmlparser/src/nsXIFDTD.cpp @@ -412,14 +412,6 @@ nsresult nsXIFDTD::WillBuildModel(nsString& aFileName,PRBool aNotifySink){ if(mSink) { -#if defined(WIN32) - const char* filename="c:\\temp\\save.html"; - mOut = new fstream(filename,ios::out); - - ((nsHTMLContentSinkStream*)mSink)->SetOutputStream(*mOut); - -#endif - mSink->WillBuildModel(); } @@ -438,13 +430,6 @@ nsresult nsXIFDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink){ if(mSink) { result = mSink->DidBuildModel(anErrorCode); - - if (mOut != nsnull) - { - mOut->close(); - delete mOut; - } - } return result; diff --git a/mozilla/parser/htmlparser/src/nsXIFDTD.h b/mozilla/parser/htmlparser/src/nsXIFDTD.h index 4d23c556279..2f30c77f50e 100644 --- a/mozilla/parser/htmlparser/src/nsXIFDTD.h +++ b/mozilla/parser/htmlparser/src/nsXIFDTD.h @@ -649,8 +649,6 @@ protected: nsVoidArray mNodeStack; nsVoidArray mTokenStack; - fstream* mOut; - PRInt32 mHTMLStackPos; eHTMLTags mHTMLTagStack[512]; nsAutoString* mHTMLNameStack[512];