fixed nsbeta2 bug 41049; removed warnings
git-svn-id: svn://10.0.0.236/trunk@72004 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -876,7 +876,9 @@ nsresult CNavDTD::DidHandleStartTag(nsCParserNode& aNode,eHTMLTags aChildTag){
|
||||
eHTMLTags theGrandParentTag=mBodyContext->TagAt(theCount-2);
|
||||
|
||||
nsAutoString theNumber;
|
||||
PRInt32 theCounter=mBodyContext->IncrementCounter(theGrandParentTag,aNode,theNumber);
|
||||
|
||||
mBodyContext->IncrementCounter(theGrandParentTag,aNode,theNumber);
|
||||
|
||||
CTextToken theToken(theNumber);
|
||||
PRInt32 theLineNumber=0;
|
||||
nsCParserNode theNode(&theToken,theLineNumber);
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
* Contributor(s): rickg@netscape.com
|
||||
*/
|
||||
|
||||
//#define ENABLE_CRC
|
||||
//#define ENABLE_CRC
|
||||
//#define RICKG_DEBUG
|
||||
|
||||
|
||||
|
||||
#include "nsDebug.h"
|
||||
#include "nsIDTDDebug.h"
|
||||
@@ -544,9 +544,9 @@ nsresult COtherDTD::BuildModel(nsIParser* aParser,nsITokenizer* aTokenizer,nsITo
|
||||
break;
|
||||
}
|
||||
}//while
|
||||
mTokenizer=oldTokenizer;
|
||||
mTokenizer=oldTokenizer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else result=NS_ERROR_HTMLPARSER_BADTOKENIZER;
|
||||
return result;
|
||||
@@ -832,8 +832,8 @@ nsresult COtherDTD::HandleStartToken(CToken* aToken) {
|
||||
mSink->OpenHTML(*theNode);
|
||||
mBodyContext->Push(theNode,0);
|
||||
}
|
||||
theTagWasHandled=PR_TRUE;
|
||||
break;
|
||||
theTagWasHandled=PR_TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
CElement* theElement=gElementTable->mElements[theParent];
|
||||
@@ -849,7 +849,7 @@ nsresult COtherDTD::HandleStartToken(CToken* aToken) {
|
||||
}
|
||||
|
||||
} //if
|
||||
}//if
|
||||
}//if
|
||||
|
||||
RecycleNode(theNode);
|
||||
return result;
|
||||
@@ -901,13 +901,13 @@ nsresult COtherDTD::HandleEndToken(CToken* aToken) {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve the attributes for this node, and add then into
|
||||
* the node.
|
||||
*
|
||||
* @update gess4/22/98
|
||||
* @param aNode is the node you want to collect attributes for
|
||||
* @param aNode is the node you want to collect attributes for
|
||||
* @param aCount is the # of attributes you're expecting
|
||||
* @return error code (should be 0)
|
||||
*/
|
||||
@@ -917,8 +917,8 @@ nsresult COtherDTD::CollectAttributes(nsCParserNode& aNode,eHTMLTags aTag,PRInt3
|
||||
nsresult result=NS_OK;
|
||||
int theAvailTokenCount=mTokenizer->GetCount();
|
||||
if(aCount<=theAvailTokenCount) {
|
||||
//gElementTable->mElements[aTag]->GetSkipTarget();
|
||||
CToken* theToken=0;
|
||||
eHTMLTags theSkipTarget=gElementTable->mElements[aTag]->GetSkipTarget();
|
||||
for(attr=0;attr<aCount;attr++){
|
||||
theToken=mTokenizer->PopToken();
|
||||
if(theToken) {
|
||||
|
||||
@@ -555,6 +555,38 @@ public:
|
||||
CFormControlElement::Initialize(*this,aTag);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**********************************************************
|
||||
This defines the form element itself
|
||||
**********************************************************/
|
||||
class CFormElement: public CBlockElement {
|
||||
public:
|
||||
|
||||
static void Initialize(CElement& anElement,eHTMLTags aTag){
|
||||
CElement::Initialize(anElement,aTag,CBlockElement::GetGroup(),CBlockElement::GetBlockGroupMembers());
|
||||
}
|
||||
|
||||
CFormElement() : CBlockElement(eHTMLTag_form) {
|
||||
CFormElement::Initialize(*this,eHTMLTag_form);
|
||||
mContainsGroups.mBits.mSelf=0;
|
||||
mContainsGroups.mBits.mFormControl=1;
|
||||
}
|
||||
|
||||
virtual PRBool CanContain(CElement* anElement,nsDTDContext* aContext) {
|
||||
PRBool result=CElement::CanContain(anElement,aContext);
|
||||
if((!result) && (aContext->mTransitional)) {
|
||||
|
||||
//If we're in transitional mode, then also allow inline elements...
|
||||
|
||||
CGroupMembers& theFlowGroup=CFlowElement::GetContainedGroups();
|
||||
result=ContainsGroup(theFlowGroup,anElement->mGroup);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
/**********************************************************
|
||||
@@ -956,9 +988,9 @@ public:
|
||||
PRInt32 theCount=aContext->GetCount();
|
||||
eHTMLTags theGrandParentTag=aContext->TagAt(theCount-2);
|
||||
|
||||
nsCParserNode *theNode=(nsCParserNode*)aNode;
|
||||
nsCParserNode *theNode=(nsCParserNode*)aNode;
|
||||
nsAutoString theNumber;
|
||||
PRInt32 theCounter=aContext->IncrementCounter(theGrandParentTag,*theNode,theNumber);
|
||||
aContext->IncrementCounter(theGrandParentTag,*theNode,theNumber);
|
||||
|
||||
CTextToken theToken(theNumber);
|
||||
PRInt32 theLineNumber=0;
|
||||
@@ -1226,6 +1258,7 @@ public:
|
||||
CTextAreaElement() : CTextContainer(eHTMLTag_textarea) {
|
||||
mGroup.mBits.mHeadMisc=1;
|
||||
mGroup=CFormControlElement::GetGroup();
|
||||
mProperties.mIsSinkContainer=0;
|
||||
}
|
||||
|
||||
virtual nsresult HandleStartToken(nsIParserNode* aNode,eHTMLTags aTag,nsDTDContext* aContext,nsIHTMLContentSink* aSink) {
|
||||
@@ -1244,6 +1277,7 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
/**********************************************************
|
||||
@@ -1662,7 +1696,7 @@ public:
|
||||
if(theNode) {
|
||||
nsString theStr=theNode->mToken->GetStringValueXXX();
|
||||
PRInt32 theLen=theStr.Length();
|
||||
PRInt32 thePos=theStr.RFindChar(kGreaterThan);
|
||||
//PRInt32 thePos=theStr.RFindChar(kGreaterThan);
|
||||
|
||||
theStr.Truncate(theLen-1);
|
||||
theStr.Cut(0,2);
|
||||
@@ -1904,7 +1938,8 @@ public:
|
||||
mAppletElement(eHTMLTag_applet),
|
||||
mObjectElement(eHTMLTag_object),
|
||||
mFieldsetElement(),
|
||||
mCounterElement()
|
||||
mCounterElement(),
|
||||
mFormElement()
|
||||
{
|
||||
memset(mElements,0,sizeof(mElements));
|
||||
InitializeElements();
|
||||
@@ -1950,6 +1985,7 @@ public:
|
||||
CAppletElement mObjectElement;
|
||||
CFieldsetElement mFieldsetElement;
|
||||
CCounterElement mCounterElement;
|
||||
CFormElement mFormElement;
|
||||
};
|
||||
|
||||
|
||||
@@ -2074,6 +2110,7 @@ void CElementTable::InitializeElements() {
|
||||
|
||||
CSpecialElement::Initialize( mDfltElements[eHTMLTag_font], eHTMLTag_font);
|
||||
CElement::Initialize( mDfltElements[eHTMLTag_form], eHTMLTag_form, CBlockElement::GetGroup(), CBlockElement::GetBlockGroupMembers());
|
||||
mDfltElements[eHTMLTag_form].mContainsGroups.mBits.mFormControl=1;
|
||||
mDfltElements[eHTMLTag_form].mIncludeKids=kFormKids;
|
||||
|
||||
CElement::Initialize( mDfltElements[eHTMLTag_frame], eHTMLTag_frame, CFrameElement::GetGroup(), CLeafElement::GetContainedGroups());
|
||||
@@ -2251,6 +2288,7 @@ void CElementTable::InitializeElements() {
|
||||
mElements[eHTMLTag_object]=&mObjectElement;
|
||||
mElements[eHTMLTag_fieldset]=&mFieldsetElement;
|
||||
mElements[eHTMLTag_counter]=&mCounterElement;
|
||||
mElements[eHTMLTag_form]=&mFormElement;
|
||||
}
|
||||
|
||||
void CElementTable::DebugDumpGroups(CElement* aTag){
|
||||
@@ -2378,7 +2416,7 @@ void CElementTable::DebugDumpBlockElements(const char* aTitle) {
|
||||
PRInt32 theTagID=eHTMLTag_unknown;
|
||||
PRBool result=PR_FALSE;
|
||||
|
||||
printf("Block Elements -- %s: \n");
|
||||
printf("Block Elements -- %s: \n",aTitle);
|
||||
while(theTagID<=eHTMLTag_userdefined) {
|
||||
CElement *theTag=GetElement((eHTMLTags)theTagID);
|
||||
if(theTag) {
|
||||
|
||||
@@ -508,7 +508,9 @@ public:
|
||||
case eSpelled: SpelledString(aValue,aString); break;
|
||||
case eRoman: RomanString(aValue,aString); break;
|
||||
case eFootnote: FootnoteString(aValue,aString); break;
|
||||
case eUserSeries: SeriesString(aValue,aString,aCharSet,anOffset,aBase);
|
||||
case eUserSeries: SeriesString(aValue,aString,aCharSet,anOffset,aBase); break;
|
||||
default:
|
||||
DecimalString(aValue,aString); break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -551,7 +553,6 @@ public:
|
||||
PRInt32 root=1000000000;
|
||||
PRInt32 expn=4;
|
||||
PRInt32 modu=0;
|
||||
PRInt32 div=0;
|
||||
PRInt32 temp=0;
|
||||
|
||||
aValue=abs(aValue);
|
||||
@@ -559,12 +560,14 @@ public:
|
||||
|
||||
while(root && aValue) {
|
||||
if(temp=aValue/root) {
|
||||
if (div=temp/100) {//start with hundreds part
|
||||
PRInt32 div=temp/100;
|
||||
if (div) {//start with hundreds part
|
||||
aString.AppendWithConversion(ones[div]);
|
||||
aString.AppendWithConversion(bases[1]);
|
||||
}
|
||||
modu=(temp%10);
|
||||
if (div=((temp%100)/10)) {
|
||||
div=(temp%100)/10;
|
||||
if (div) {
|
||||
if (div<2) {
|
||||
aString.AppendWithConversion(teens[modu]);
|
||||
modu=0;
|
||||
@@ -655,7 +658,6 @@ public:
|
||||
static void FootnoteString(PRInt32 aValue,nsString& aString) {
|
||||
static char kFootnoteSet[]="abcdefg";
|
||||
|
||||
PRBool negative=(aValue<0);
|
||||
int seriesLen = strlen (kFootnoteSet) - 1;
|
||||
int count=0;
|
||||
int repCount=0;
|
||||
|
||||
@@ -876,7 +876,9 @@ nsresult CNavDTD::DidHandleStartTag(nsCParserNode& aNode,eHTMLTags aChildTag){
|
||||
eHTMLTags theGrandParentTag=mBodyContext->TagAt(theCount-2);
|
||||
|
||||
nsAutoString theNumber;
|
||||
PRInt32 theCounter=mBodyContext->IncrementCounter(theGrandParentTag,aNode,theNumber);
|
||||
|
||||
mBodyContext->IncrementCounter(theGrandParentTag,aNode,theNumber);
|
||||
|
||||
CTextToken theToken(theNumber);
|
||||
PRInt32 theLineNumber=0;
|
||||
nsCParserNode theNode(&theToken,theLineNumber);
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
* Contributor(s): rickg@netscape.com
|
||||
*/
|
||||
|
||||
//#define ENABLE_CRC
|
||||
//#define ENABLE_CRC
|
||||
//#define RICKG_DEBUG
|
||||
|
||||
|
||||
|
||||
#include "nsDebug.h"
|
||||
#include "nsIDTDDebug.h"
|
||||
@@ -544,9 +544,9 @@ nsresult COtherDTD::BuildModel(nsIParser* aParser,nsITokenizer* aTokenizer,nsITo
|
||||
break;
|
||||
}
|
||||
}//while
|
||||
mTokenizer=oldTokenizer;
|
||||
mTokenizer=oldTokenizer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else result=NS_ERROR_HTMLPARSER_BADTOKENIZER;
|
||||
return result;
|
||||
@@ -832,8 +832,8 @@ nsresult COtherDTD::HandleStartToken(CToken* aToken) {
|
||||
mSink->OpenHTML(*theNode);
|
||||
mBodyContext->Push(theNode,0);
|
||||
}
|
||||
theTagWasHandled=PR_TRUE;
|
||||
break;
|
||||
theTagWasHandled=PR_TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
CElement* theElement=gElementTable->mElements[theParent];
|
||||
@@ -849,7 +849,7 @@ nsresult COtherDTD::HandleStartToken(CToken* aToken) {
|
||||
}
|
||||
|
||||
} //if
|
||||
}//if
|
||||
}//if
|
||||
|
||||
RecycleNode(theNode);
|
||||
return result;
|
||||
@@ -901,13 +901,13 @@ nsresult COtherDTD::HandleEndToken(CToken* aToken) {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve the attributes for this node, and add then into
|
||||
* the node.
|
||||
*
|
||||
* @update gess4/22/98
|
||||
* @param aNode is the node you want to collect attributes for
|
||||
* @param aNode is the node you want to collect attributes for
|
||||
* @param aCount is the # of attributes you're expecting
|
||||
* @return error code (should be 0)
|
||||
*/
|
||||
@@ -917,8 +917,8 @@ nsresult COtherDTD::CollectAttributes(nsCParserNode& aNode,eHTMLTags aTag,PRInt3
|
||||
nsresult result=NS_OK;
|
||||
int theAvailTokenCount=mTokenizer->GetCount();
|
||||
if(aCount<=theAvailTokenCount) {
|
||||
//gElementTable->mElements[aTag]->GetSkipTarget();
|
||||
CToken* theToken=0;
|
||||
eHTMLTags theSkipTarget=gElementTable->mElements[aTag]->GetSkipTarget();
|
||||
for(attr=0;attr<aCount;attr++){
|
||||
theToken=mTokenizer->PopToken();
|
||||
if(theToken) {
|
||||
|
||||
@@ -555,6 +555,38 @@ public:
|
||||
CFormControlElement::Initialize(*this,aTag);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**********************************************************
|
||||
This defines the form element itself
|
||||
**********************************************************/
|
||||
class CFormElement: public CBlockElement {
|
||||
public:
|
||||
|
||||
static void Initialize(CElement& anElement,eHTMLTags aTag){
|
||||
CElement::Initialize(anElement,aTag,CBlockElement::GetGroup(),CBlockElement::GetBlockGroupMembers());
|
||||
}
|
||||
|
||||
CFormElement() : CBlockElement(eHTMLTag_form) {
|
||||
CFormElement::Initialize(*this,eHTMLTag_form);
|
||||
mContainsGroups.mBits.mSelf=0;
|
||||
mContainsGroups.mBits.mFormControl=1;
|
||||
}
|
||||
|
||||
virtual PRBool CanContain(CElement* anElement,nsDTDContext* aContext) {
|
||||
PRBool result=CElement::CanContain(anElement,aContext);
|
||||
if((!result) && (aContext->mTransitional)) {
|
||||
|
||||
//If we're in transitional mode, then also allow inline elements...
|
||||
|
||||
CGroupMembers& theFlowGroup=CFlowElement::GetContainedGroups();
|
||||
result=ContainsGroup(theFlowGroup,anElement->mGroup);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
/**********************************************************
|
||||
@@ -956,9 +988,9 @@ public:
|
||||
PRInt32 theCount=aContext->GetCount();
|
||||
eHTMLTags theGrandParentTag=aContext->TagAt(theCount-2);
|
||||
|
||||
nsCParserNode *theNode=(nsCParserNode*)aNode;
|
||||
nsCParserNode *theNode=(nsCParserNode*)aNode;
|
||||
nsAutoString theNumber;
|
||||
PRInt32 theCounter=aContext->IncrementCounter(theGrandParentTag,*theNode,theNumber);
|
||||
aContext->IncrementCounter(theGrandParentTag,*theNode,theNumber);
|
||||
|
||||
CTextToken theToken(theNumber);
|
||||
PRInt32 theLineNumber=0;
|
||||
@@ -1226,6 +1258,7 @@ public:
|
||||
CTextAreaElement() : CTextContainer(eHTMLTag_textarea) {
|
||||
mGroup.mBits.mHeadMisc=1;
|
||||
mGroup=CFormControlElement::GetGroup();
|
||||
mProperties.mIsSinkContainer=0;
|
||||
}
|
||||
|
||||
virtual nsresult HandleStartToken(nsIParserNode* aNode,eHTMLTags aTag,nsDTDContext* aContext,nsIHTMLContentSink* aSink) {
|
||||
@@ -1244,6 +1277,7 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
/**********************************************************
|
||||
@@ -1662,7 +1696,7 @@ public:
|
||||
if(theNode) {
|
||||
nsString theStr=theNode->mToken->GetStringValueXXX();
|
||||
PRInt32 theLen=theStr.Length();
|
||||
PRInt32 thePos=theStr.RFindChar(kGreaterThan);
|
||||
//PRInt32 thePos=theStr.RFindChar(kGreaterThan);
|
||||
|
||||
theStr.Truncate(theLen-1);
|
||||
theStr.Cut(0,2);
|
||||
@@ -1904,7 +1938,8 @@ public:
|
||||
mAppletElement(eHTMLTag_applet),
|
||||
mObjectElement(eHTMLTag_object),
|
||||
mFieldsetElement(),
|
||||
mCounterElement()
|
||||
mCounterElement(),
|
||||
mFormElement()
|
||||
{
|
||||
memset(mElements,0,sizeof(mElements));
|
||||
InitializeElements();
|
||||
@@ -1950,6 +1985,7 @@ public:
|
||||
CAppletElement mObjectElement;
|
||||
CFieldsetElement mFieldsetElement;
|
||||
CCounterElement mCounterElement;
|
||||
CFormElement mFormElement;
|
||||
};
|
||||
|
||||
|
||||
@@ -2074,6 +2110,7 @@ void CElementTable::InitializeElements() {
|
||||
|
||||
CSpecialElement::Initialize( mDfltElements[eHTMLTag_font], eHTMLTag_font);
|
||||
CElement::Initialize( mDfltElements[eHTMLTag_form], eHTMLTag_form, CBlockElement::GetGroup(), CBlockElement::GetBlockGroupMembers());
|
||||
mDfltElements[eHTMLTag_form].mContainsGroups.mBits.mFormControl=1;
|
||||
mDfltElements[eHTMLTag_form].mIncludeKids=kFormKids;
|
||||
|
||||
CElement::Initialize( mDfltElements[eHTMLTag_frame], eHTMLTag_frame, CFrameElement::GetGroup(), CLeafElement::GetContainedGroups());
|
||||
@@ -2251,6 +2288,7 @@ void CElementTable::InitializeElements() {
|
||||
mElements[eHTMLTag_object]=&mObjectElement;
|
||||
mElements[eHTMLTag_fieldset]=&mFieldsetElement;
|
||||
mElements[eHTMLTag_counter]=&mCounterElement;
|
||||
mElements[eHTMLTag_form]=&mFormElement;
|
||||
}
|
||||
|
||||
void CElementTable::DebugDumpGroups(CElement* aTag){
|
||||
@@ -2378,7 +2416,7 @@ void CElementTable::DebugDumpBlockElements(const char* aTitle) {
|
||||
PRInt32 theTagID=eHTMLTag_unknown;
|
||||
PRBool result=PR_FALSE;
|
||||
|
||||
printf("Block Elements -- %s: \n");
|
||||
printf("Block Elements -- %s: \n",aTitle);
|
||||
while(theTagID<=eHTMLTag_userdefined) {
|
||||
CElement *theTag=GetElement((eHTMLTags)theTagID);
|
||||
if(theTag) {
|
||||
|
||||
@@ -508,7 +508,9 @@ public:
|
||||
case eSpelled: SpelledString(aValue,aString); break;
|
||||
case eRoman: RomanString(aValue,aString); break;
|
||||
case eFootnote: FootnoteString(aValue,aString); break;
|
||||
case eUserSeries: SeriesString(aValue,aString,aCharSet,anOffset,aBase);
|
||||
case eUserSeries: SeriesString(aValue,aString,aCharSet,anOffset,aBase); break;
|
||||
default:
|
||||
DecimalString(aValue,aString); break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -551,7 +553,6 @@ public:
|
||||
PRInt32 root=1000000000;
|
||||
PRInt32 expn=4;
|
||||
PRInt32 modu=0;
|
||||
PRInt32 div=0;
|
||||
PRInt32 temp=0;
|
||||
|
||||
aValue=abs(aValue);
|
||||
@@ -559,12 +560,14 @@ public:
|
||||
|
||||
while(root && aValue) {
|
||||
if(temp=aValue/root) {
|
||||
if (div=temp/100) {//start with hundreds part
|
||||
PRInt32 div=temp/100;
|
||||
if (div) {//start with hundreds part
|
||||
aString.AppendWithConversion(ones[div]);
|
||||
aString.AppendWithConversion(bases[1]);
|
||||
}
|
||||
modu=(temp%10);
|
||||
if (div=((temp%100)/10)) {
|
||||
div=(temp%100)/10;
|
||||
if (div) {
|
||||
if (div<2) {
|
||||
aString.AppendWithConversion(teens[modu]);
|
||||
modu=0;
|
||||
@@ -655,7 +658,6 @@ public:
|
||||
static void FootnoteString(PRInt32 aValue,nsString& aString) {
|
||||
static char kFootnoteSet[]="abcdefg";
|
||||
|
||||
PRBool negative=(aValue<0);
|
||||
int seriesLen = strlen (kFootnoteSet) - 1;
|
||||
int count=0;
|
||||
int repCount=0;
|
||||
|
||||
Reference in New Issue
Block a user