bug 324738: Remove some unnecessary complexity from the parser and hardcode DTDs. r=sicking sr=jst
git-svn-id: svn://10.0.0.236/trunk@188251 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -92,7 +92,6 @@ Stopwatch vsTimer;
|
||||
#endif
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kClassIID, NS_VIEWSOURCE_HTML_IID);
|
||||
|
||||
// Define this to dump the viewsource stuff to a file
|
||||
//#define DUMP_TO_FILE
|
||||
@@ -131,9 +130,6 @@ nsresult CViewSourceHTML::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
else if(aIID.Equals(NS_GET_IID(nsIDTD))) { //do IParser base class...
|
||||
*aInstancePtr = (nsIDTD*)(this);
|
||||
}
|
||||
else if(aIID.Equals(kClassIID)) { //do this class...
|
||||
*aInstancePtr = (CViewSourceHTML*)(this);
|
||||
}
|
||||
else {
|
||||
*aInstancePtr=0;
|
||||
return NS_NOINTERFACE;
|
||||
@@ -158,7 +154,8 @@ nsresult NS_NewViewSourceHTML(nsIDTD** aInstancePtrResult)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return it->QueryInterface(kClassIID, (void **) aInstancePtrResult);
|
||||
NS_ADDREF(*aInstancePtrResult = it);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -349,52 +346,6 @@ CViewSourceHTML::~CViewSourceHTML(){
|
||||
mParser=0; //just to prove we destructed...
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @update gess1/8/99
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
const nsIID& CViewSourceHTML::GetMostDerivedIID(void) const{
|
||||
return kClassIID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this method if you want the DTD to construct a fresh
|
||||
* instance of itself.
|
||||
* @update gess7/23/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
nsresult CViewSourceHTML::CreateNewInstance(nsIDTD** aInstancePtrResult){
|
||||
return NS_NewViewSourceHTML(aInstancePtrResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called to determine if the given DTD can parse
|
||||
* a document in a given source-type.
|
||||
* NOTE: Parsing always assumes that the end result will involve
|
||||
* storing the result in the main content model.
|
||||
* @update gess6/24/98
|
||||
* @param
|
||||
* @return TRUE if this DTD can satisfy the request; FALSE otherwise.
|
||||
*/
|
||||
NS_IMETHODIMP_(eAutoDetectResult)
|
||||
CViewSourceHTML::CanParse(CParserContext& aParserContext)
|
||||
{
|
||||
if (eViewSource == aParserContext.mParserCommand) {
|
||||
if (aParserContext.mDocType == ePlainText) {
|
||||
return eValidDetect;
|
||||
}
|
||||
|
||||
// We claim to parse XML... now _that_ is funny.
|
||||
return ePrimaryDetect;
|
||||
}
|
||||
|
||||
return eUnknownDetect;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The parser uses a code sandwich to wrap the parsing process. Before
|
||||
* the process begins, WillBuildModel() is called. Afterwards the parser
|
||||
|
||||
Reference in New Issue
Block a user