Bug 254843 eToken_script is unused
patch by cst@andrew.cmu.edu r=peterv sr=peterv git-svn-id: svn://10.0.0.236/trunk@161136 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
06de48dcbb
commit
8bde60ceed
@ -64,7 +64,6 @@ EXPORTS = \
|
||||
nsHTMLTags.h \
|
||||
nsHTMLTokens.h \
|
||||
nsScannerString.h \
|
||||
nsParserError.h \
|
||||
nsParserCIID.h \
|
||||
nsToken.h \
|
||||
$(NULL)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user