mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Backed out changeset 4c6e2e3f23f9 (bug 1539759) for failures on nsExpatDriver::WillBuildModel . CLOSED TREE
This commit is contained in:
parent
f9d6a0877e
commit
c8e45a1834
@ -1765,8 +1765,6 @@ XML_SetAttlistDeclHandler(XML_Parser parser,
|
||||
if (parser != NULL)
|
||||
attlistDeclHandler = attdecl;
|
||||
}
|
||||
#endif
|
||||
/* END MOZILLA CHANGE */
|
||||
|
||||
void XMLCALL
|
||||
XML_SetEntityDeclHandler(XML_Parser parser,
|
||||
@ -1775,6 +1773,8 @@ XML_SetEntityDeclHandler(XML_Parser parser,
|
||||
if (parser != NULL)
|
||||
entityDeclHandler = handler;
|
||||
}
|
||||
#endif
|
||||
/* END MOZILLA CHANGE */
|
||||
|
||||
void XMLCALL
|
||||
XML_SetXmlDeclHandler(XML_Parser parser,
|
||||
|
@ -154,18 +154,6 @@ static int Driver_HandleExternalEntityRef(void* aExternalEntityRefHandler,
|
||||
aPublicId);
|
||||
}
|
||||
|
||||
static void Driver_HandleEntityDecl(
|
||||
void* aUserData, const XML_Char* aEntityName, int aIsParameterEntity,
|
||||
const XML_Char* aValue, int aValueLength, const XML_Char* aBase,
|
||||
const XML_Char* aSystemId, const XML_Char* aPublicId,
|
||||
const XML_Char* aNotationName) {
|
||||
NS_ASSERTION(aUserData, "expat driver should exist");
|
||||
if (aUserData) {
|
||||
static_cast<nsExpatDriver*>(aUserData)->HandleEntityDecl(
|
||||
aEntityName, aValue, aValueLength);
|
||||
}
|
||||
}
|
||||
|
||||
/***************************** END CALL BACKS ********************************/
|
||||
|
||||
/***************************** CATALOG UTILS *********************************/
|
||||
@ -486,19 +474,6 @@ nsresult nsExpatDriver::HandleEndDoctypeDecl() {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsExpatDriver::HandleEntityDecl(const char16_t* aEntityName,
|
||||
const char16_t* aEntityValue,
|
||||
const uint32_t aLength) {
|
||||
MOZ_ASSERT(
|
||||
mInInternalSubset || mInExternalDTD,
|
||||
"Should only see entity declarations in the internal subset or in DTDs");
|
||||
auto charLength = aLength / sizeof(char16_t);
|
||||
nsDependentSubstring entityVal(aEntityValue, charLength);
|
||||
if (entityVal.FindChar('<') != -1) {
|
||||
MaybeStopParser(NS_ERROR_UNEXPECTED);
|
||||
}
|
||||
}
|
||||
|
||||
static nsresult ExternalDTDStreamReaderFunc(nsIUnicharInputStream* aIn,
|
||||
void* aClosure,
|
||||
const char16_t* aFromSegment,
|
||||
@ -1082,9 +1057,6 @@ nsExpatDriver::WillBuildModel(const CParserContext& aParserContext,
|
||||
|
||||
XML_SetParamEntityParsing(mExpatParser,
|
||||
XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE);
|
||||
if (doc->NodePrincipal()->IsSystemPrincipal()) {
|
||||
XML_SetEntityDeclHandler(mExpatParser, Driver_HandleEntityDecl);
|
||||
}
|
||||
XML_SetDoctypeDeclHandler(mExpatParser, Driver_HandleStartDoctypeDecl,
|
||||
Driver_HandleEndDoctypeDecl);
|
||||
|
||||
|
@ -49,8 +49,6 @@ class nsExpatDriver : public nsIDTD, public nsITokenizer {
|
||||
const char16_t* aPubid,
|
||||
bool aHasInternalSubset);
|
||||
nsresult HandleEndDoctypeDecl();
|
||||
void HandleEntityDecl(const char16_t* aEntityName,
|
||||
const char16_t* aEntityValue, const uint32_t aLength);
|
||||
|
||||
private:
|
||||
// Load up an external stream to get external entity information
|
||||
|
Loading…
Reference in New Issue
Block a user