diff --git a/htmlparser/src/nsIParser.h b/htmlparser/src/nsIParser.h index 5274f5e4139..52395dcd0ba 100644 --- a/htmlparser/src/nsIParser.h +++ b/htmlparser/src/nsIParser.h @@ -47,7 +47,7 @@ class nsIContentSink; class nsIStreamObserver; class nsString; class nsIURL; - +class nsTagStack; enum eParseMode { @@ -150,7 +150,8 @@ class nsIParser : public nsISupports { virtual nsresult Parse(nsIInputStream& aStream, PRBool aEnableVerify=PR_FALSE) = 0; virtual nsresult Parse(nsString& aSourceBuffer,void* aKey,const nsString& aContentType,PRBool aEnableVerify,PRBool aLastCall) = 0; - //virtual PRBool IsValid(nsString& aSourceBuffer,const nsString& aContentTypeaLastCall) = 0; + virtual PRBool IsValidFragment(nsString& aSourceBuffer,nsTagStack& aStack,PRUint32 anInsertPos,const nsString& aContentType)=0; + virtual nsresult InsertFragment(nsString& aSourceBuffer,void* aKey,nsTagStack& aStack,PRUint32 anInsertPos,const nsString& aContentType)=0; /** * This method gets called when the tokens have been consumed, and it's time diff --git a/htmlparser/src/nsParser.cpp b/htmlparser/src/nsParser.cpp index 0c1a4c74fff..8e60573da79 100644 --- a/htmlparser/src/nsParser.cpp +++ b/htmlparser/src/nsParser.cpp @@ -756,7 +756,7 @@ nsresult nsParser::Parse(nsString& aSourceBuffer,void* aKey,const nsString& aCon * @param * @return */ -PRBool nsParser::IsValidFragment(nsString& aSourceBuffer,nsTagStack& aStack,nsHTMLTag aTag,const nsString& aContentType){ +PRBool nsParser::IsValidFragment(nsString& aSourceBuffer,nsTagStack& aStack,PRUint32 anInsertPos,const nsString& aContentType){ PRBool result=PR_FALSE; return result; } @@ -767,10 +767,11 @@ PRBool nsParser::IsValidFragment(nsString& aSourceBuffer,nsTagStack& aStack,nsHT * @param * @return */ -PRBool nsParser::ParseFragment(nsString& aSourceBuffer,void* aKey,nsTagStack& aStack,nsHTMLTag aTag,const nsString& aContentType){ +nsresult nsParser::InsertFragment(nsString& aSourceBuffer,void* aKey,nsTagStack& aStack,PRUint32 anInsertPos,const nsString& aContentType){ PRBool result=PR_FALSE; return result; } + /** * This routine is called to cause the parser to continue diff --git a/htmlparser/src/nsParser.h b/htmlparser/src/nsParser.h index 9a203f087f2..80345df0d46 100644 --- a/htmlparser/src/nsParser.h +++ b/htmlparser/src/nsParser.h @@ -183,8 +183,9 @@ friend class CTokenHandler; */ virtual nsresult Parse(nsString& aSourceBuffer,void* aKey,const nsString& aContentType,PRBool aEnableVerify=PR_FALSE,PRBool aLastCall=PR_FALSE); - virtual PRBool IsValidFragment(nsString& aSourceBuffer,nsTagStack& aStack,nsHTMLTag aTag,const nsString& aContentType); - virtual PRBool ParseFragment(nsString& aSourceBuffer,void* aKey,nsTagStack& aStack,nsHTMLTag aTag,const nsString& aContentType); + + virtual PRBool IsValidFragment(nsString& aSourceBuffer,nsTagStack& aStack,PRUint32 anInsertPos,const nsString& aContentType); + virtual nsresult InsertFragment(nsString& aSourceBuffer,void* aKey,nsTagStack& aStack,PRUint32 anInsertPos,const nsString& aContentType); /** diff --git a/parser/htmlparser/src/nsIParser.h b/parser/htmlparser/src/nsIParser.h index 5274f5e4139..52395dcd0ba 100644 --- a/parser/htmlparser/src/nsIParser.h +++ b/parser/htmlparser/src/nsIParser.h @@ -47,7 +47,7 @@ class nsIContentSink; class nsIStreamObserver; class nsString; class nsIURL; - +class nsTagStack; enum eParseMode { @@ -150,7 +150,8 @@ class nsIParser : public nsISupports { virtual nsresult Parse(nsIInputStream& aStream, PRBool aEnableVerify=PR_FALSE) = 0; virtual nsresult Parse(nsString& aSourceBuffer,void* aKey,const nsString& aContentType,PRBool aEnableVerify,PRBool aLastCall) = 0; - //virtual PRBool IsValid(nsString& aSourceBuffer,const nsString& aContentTypeaLastCall) = 0; + virtual PRBool IsValidFragment(nsString& aSourceBuffer,nsTagStack& aStack,PRUint32 anInsertPos,const nsString& aContentType)=0; + virtual nsresult InsertFragment(nsString& aSourceBuffer,void* aKey,nsTagStack& aStack,PRUint32 anInsertPos,const nsString& aContentType)=0; /** * This method gets called when the tokens have been consumed, and it's time diff --git a/parser/htmlparser/src/nsParser.cpp b/parser/htmlparser/src/nsParser.cpp index 0c1a4c74fff..8e60573da79 100644 --- a/parser/htmlparser/src/nsParser.cpp +++ b/parser/htmlparser/src/nsParser.cpp @@ -756,7 +756,7 @@ nsresult nsParser::Parse(nsString& aSourceBuffer,void* aKey,const nsString& aCon * @param * @return */ -PRBool nsParser::IsValidFragment(nsString& aSourceBuffer,nsTagStack& aStack,nsHTMLTag aTag,const nsString& aContentType){ +PRBool nsParser::IsValidFragment(nsString& aSourceBuffer,nsTagStack& aStack,PRUint32 anInsertPos,const nsString& aContentType){ PRBool result=PR_FALSE; return result; } @@ -767,10 +767,11 @@ PRBool nsParser::IsValidFragment(nsString& aSourceBuffer,nsTagStack& aStack,nsHT * @param * @return */ -PRBool nsParser::ParseFragment(nsString& aSourceBuffer,void* aKey,nsTagStack& aStack,nsHTMLTag aTag,const nsString& aContentType){ +nsresult nsParser::InsertFragment(nsString& aSourceBuffer,void* aKey,nsTagStack& aStack,PRUint32 anInsertPos,const nsString& aContentType){ PRBool result=PR_FALSE; return result; } + /** * This routine is called to cause the parser to continue diff --git a/parser/htmlparser/src/nsParser.h b/parser/htmlparser/src/nsParser.h index 9a203f087f2..80345df0d46 100644 --- a/parser/htmlparser/src/nsParser.h +++ b/parser/htmlparser/src/nsParser.h @@ -183,8 +183,9 @@ friend class CTokenHandler; */ virtual nsresult Parse(nsString& aSourceBuffer,void* aKey,const nsString& aContentType,PRBool aEnableVerify=PR_FALSE,PRBool aLastCall=PR_FALSE); - virtual PRBool IsValidFragment(nsString& aSourceBuffer,nsTagStack& aStack,nsHTMLTag aTag,const nsString& aContentType); - virtual PRBool ParseFragment(nsString& aSourceBuffer,void* aKey,nsTagStack& aStack,nsHTMLTag aTag,const nsString& aContentType); + + virtual PRBool IsValidFragment(nsString& aSourceBuffer,nsTagStack& aStack,PRUint32 anInsertPos,const nsString& aContentType); + virtual nsresult InsertFragment(nsString& aSourceBuffer,void* aKey,nsTagStack& aStack,PRUint32 anInsertPos,const nsString& aContentType); /**