diff --git a/mozilla/parser/htmlparser/public/Makefile.in b/mozilla/parser/htmlparser/public/Makefile.in index 67456cb32b0..33ab884f9ba 100644 --- a/mozilla/parser/htmlparser/public/Makefile.in +++ b/mozilla/parser/htmlparser/public/Makefile.in @@ -64,7 +64,6 @@ EXPORTS = \ nsHTMLTags.h \ nsHTMLTokens.h \ nsScannerString.h \ - nsParserError.h \ nsParserCIID.h \ nsToken.h \ $(NULL) diff --git a/mozilla/parser/htmlparser/public/nsHTMLTokens.h b/mozilla/parser/htmlparser/public/nsHTMLTokens.h index ae8b75263be..73780f5abec 100644 --- a/mozilla/parser/htmlparser/public/nsHTMLTokens.h +++ b/mozilla/parser/htmlparser/public/nsHTMLTokens.h @@ -59,7 +59,6 @@ #include "nsToken.h" #include "nsHTMLTags.h" -#include "nsParserError.h" #include "nsString.h" #include "nsScannerString.h" @@ -71,10 +70,9 @@ class nsScanner; enum eHTMLTokenTypes { eToken_unknown=0, - eToken_start=1, eToken_end, eToken_comment, eToken_entity, - eToken_whitespace, eToken_newline, eToken_text, eToken_attribute, - eToken_script, eToken_style, eToken_skippedcontent, eToken_instruction, - eToken_cdatasection, eToken_error, eToken_doctypeDecl, eToken_markupDecl, + eToken_start=1, eToken_end, eToken_comment, eToken_entity, + eToken_whitespace, eToken_newline, eToken_text, eToken_attribute, + eToken_instruction, eToken_cdatasection, eToken_doctypeDecl, eToken_markupDecl, eToken_last //make sure this stays the last token... }; @@ -401,51 +399,6 @@ public: }; -/** - * Script tokens contain sequences of javascript (or, gulp, - * any other script you care to send). We don't tokenize - * it here, nor validate it. We just wrap it up, and pass - * it along to the html parser, who sends it (later on) - * to the scripting engine. - * - * @update gess 3/25/98 - */ -class CScriptToken: public CHTMLToken { - CTOKEN_IMPL_SIZEOF - -public: - CScriptToken(); - CScriptToken(const nsAString& aString); - virtual PRInt32 GetTokenType(void); - virtual const nsAString& GetStringValue(void); - -protected: - nsString mTextValue; -}; - - -/** - * Style tokens contain sequences of css style. We don't - * tokenize it here, nor validate it. We just wrap it up, - * and pass it along to the html parser, who sends it - * (later on) to the style engine. - * - * @update gess 3/25/98 - */ -class CStyleToken: public CHTMLToken { - CTOKEN_IMPL_SIZEOF - -public: - CStyleToken(); - CStyleToken(const nsAString& aString); - virtual PRInt32 GetTokenType(void); - virtual const nsAString& GetStringValue(void); - -protected: - nsString mTextValue; -}; - - /** * Whitespace tokens are used where whitespace can be * detected as distinct from text. This allows us to @@ -467,26 +420,6 @@ protected: nsString mTextValue; }; -class CErrorToken : public CHTMLToken { - CTOKEN_IMPL_SIZEOF - -public: - CErrorToken(nsParserError* aError=0); - ~CErrorToken(); - virtual PRInt32 GetTokenType(void); - - void SetError(nsParserError* aError); // CErrorToken takes ownership of aError - - // The nsParserError object returned by GetError is still owned by CErrorToken. - // DO NOT use the delete operator on it. Should we change this so that a copy - // of nsParserError is returned which needs to be destroyed by the consumer? - const nsParserError* GetError(void); - - virtual const nsAString& GetStringValue(void); -protected: - nsString mTextValue; - nsParserError* mError; -}; /** * This token is generated by the HTML and Expat tokenizers diff --git a/mozilla/parser/htmlparser/src/nsDTDUtils.cpp b/mozilla/parser/htmlparser/src/nsDTDUtils.cpp index 150268b5d4b..f2249686e70 100644 --- a/mozilla/parser/htmlparser/src/nsDTDUtils.cpp +++ b/mozilla/parser/htmlparser/src/nsDTDUtils.cpp @@ -1322,11 +1322,8 @@ CToken* nsTokenAllocator::CreateTokenOfType(eHTMLTokenTypes aType,eHTMLTags aTag case eToken_newline: result=new(mArenaPool) CNewlineToken(); break; case eToken_text: result=new(mArenaPool) CTextToken(aString); break; case eToken_attribute: result=new(mArenaPool) CAttributeToken(aString); break; - case eToken_script: result=new(mArenaPool) CScriptToken(aString); break; - case eToken_style: result=new(mArenaPool) CStyleToken(aString); break; case eToken_instruction: result=new(mArenaPool) CInstructionToken(aString); break; case eToken_cdatasection: result=new(mArenaPool) CCDATASectionToken(aString); break; - case eToken_error: result=new(mArenaPool) CErrorToken(); break; case eToken_doctypeDecl: result=new(mArenaPool) CDoctypeDeclToken(aString); break; case eToken_markupDecl: result=new(mArenaPool) CMarkupDeclToken(aString); break; default: @@ -1362,11 +1359,8 @@ CToken* nsTokenAllocator::CreateTokenOfType(eHTMLTokenTypes aType,eHTMLTags aTag case eToken_whitespace: result=new(mArenaPool) CWhitespaceToken(); break; case eToken_newline: result=new(mArenaPool) CNewlineToken(); break; case eToken_text: result=new(mArenaPool) CTextToken(); break; - case eToken_script: result=new(mArenaPool) CScriptToken(); break; - case eToken_style: result=new(mArenaPool) CStyleToken(); break; case eToken_instruction: result=new(mArenaPool) CInstructionToken(); break; case eToken_cdatasection: result=new(mArenaPool) CCDATASectionToken(aTag); break; - case eToken_error: result=new(mArenaPool) CErrorToken(); break; case eToken_doctypeDecl: result=new(mArenaPool) CDoctypeDeclToken(aTag); break; case eToken_markupDecl: result=new(mArenaPool) CMarkupDeclToken(); break; default: diff --git a/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp b/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp index 5a636649c51..84d2edb865e 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp +++ b/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp @@ -2097,74 +2097,6 @@ void CEntityToken::AppendSourceTo(nsAString& anOutputString){ //anOutputString+=";"; } -/* - * default constructor - * - * @update gess 3/25/98 - * @param aName -- string to init token name with - * @return - */ -CScriptToken::CScriptToken() : CHTMLToken(eHTMLTag_script) { -} - -/* - * default constructor - * - * @update gess 3/25/98 - * @param aName -- string to init token name with - * @return - */ -CScriptToken::CScriptToken(const nsAString& aString) : CHTMLToken(eHTMLTag_script) { - mTextValue.Assign(aString); -} - -/* - * - * - * @update gess 3/25/98 - * @param - * @return - */ -PRInt32 CScriptToken::GetTokenType(void) { - return eToken_script; -} - -const nsAString& CScriptToken::GetStringValue(void) -{ - return mTextValue; -} - -/* - * default constructor - * - * @update gess 3/25/98 - * @param aName -- string to init token name with - * @return - */ -CStyleToken::CStyleToken() : CHTMLToken(eHTMLTag_style) { -} - -CStyleToken::CStyleToken(const nsAString& aString) : CHTMLToken(eHTMLTag_style) { - mTextValue.Assign(aString); -} - -/* - * - * - * @update gess 3/25/98 - * @param - * @return - */ -PRInt32 CStyleToken::GetTokenType(void) { - return eToken_style; -} - -const nsAString& CStyleToken::GetStringValue(void) -{ - return mTextValue; -} - - /** * * @update gess4/25/98 @@ -2236,35 +2168,6 @@ const nsAString& CInstructionToken::GetStringValue(void) return mTextValue; } - -CErrorToken::CErrorToken(nsParserError *aError) : CHTMLToken(eHTMLTag_unknown) -{ - mError = aError; -} - -CErrorToken::~CErrorToken() -{ - delete mError; -} - -PRInt32 CErrorToken::GetTokenType(void){ - return eToken_error; -} - -void CErrorToken::SetError(nsParserError *aError) { - mError = aError; -} - -const nsParserError * CErrorToken::GetError(void) -{ - return mError; -} - -const nsAString& CErrorToken::GetStringValue(void) -{ - return mTextValue; -} - // Doctype decl token CDoctypeDeclToken::CDoctypeDeclToken(eHTMLTags aTag)